I’m totally stack on what can be the source of this problem.
I was trying to use gitweb and I found a 500 internal server error. On tracking the error I have discovered that not only that cgi script is not working but is all cgi scripts on the server that actually doesn’t work with a 500 internal server error.
The only thing I can obtain from the logs is from the virtual server error log:
Premature end of script headers: test.cgi
The problem is not on the cgi at all as I have just tested with a hello world script, so it seems something is failing or something is blocking the execution of cgi (perl in this case) scripts before even they start execution.
Not any other logs show anything. suexec.log shows nothing related.
The virtual server runs as Fcgid and the apache configuration looks fine to me:
SuexecUserGroup “#xxx” “#xxx”
ServerName xxxxxxx.xxx
ServerAlias www.xxxxxxx.xxx
ServerAlias webmail.xxxxxxx.xxx
ServerAlias admin.xxxxxxx.xxx
DocumentRoot /home/xxxxxxx/public_html
ErrorLog /var/log/virtualmin/xxxxxxx.xxx_error_log
CustomLog /var/log/virtualmin/xxxxxxx.xxx_access_log combined
ScriptAlias /cgi-bin/ /home/xxxxxxx/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/xxxxxxx/public_html>
Options -Indexes +ExecCGI +FollowSymLinks +IncludesNOEXEC
allow from all
AllowOverride All
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/xxxxxxx/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/xxxxxxx/fcgi-bin/php5.fcgi .php5
<Directory /home/xxxxxxx/cgi-bin>
allow from all
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.xxxxxxx.xxx
RewriteRule ^(.) https://xxxxxxx.xxx:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.xxxxxxx.xxx
RewriteRule ^(.) https://xxxxxxx.xxx:10000/ [R]
RemoveHandler .php
RemoveHandler .php5
IPCCommTimeout 10000
FcgidMaxRequestLen 1073741824
RedirectMatch /cgi-bin/mailman/([^/.])(.cgi)?(.) https://xxxxxxx.xxx:10000/virtualmin-mailman/unauthenticated/$1.cgi$3
RedirectMatch /mailman/([^/.])(.cgi)?(.) https://xxxxxxx.xxx:10000/virtualmin-mailman/unauthenticated/$1.cgi$3
Alias /pipermail /var/lib/mailman/archives/public
Alias /dav /home/xxxxxxx/public_html
<Location /git>
DAV on
AuthType Basic
AuthName xxxxxxx.xxx
AuthUserFile /home/xxxxxxx/etc/git.basic.passwd
Require valid-user
Satisfy All
RedirectMatch ^/git$ http://xxxxxxx.xxx/git/gitweb.cgi
RedirectMatch ^/git/$ http://xxxxxxx.xxx/git/gitweb.cgi
RewriteEngine off
AddHandler cgi-script .cgi
<Location /dav>
DAV on
AuthType Basic
AuthName “xxxxxxx.xxx”
AuthUserFile /home/xxxxxxx/etc/dav.digest.passwd
Require user xxxxxxx
ForceType text/plain
Satisfy All
RemoveHandler .php
RemoveHandler .php5
RewriteEngine off
Require user xxxxxxx
I don’t know where to look for more clues about the problem.