Operating system: Ubuntu
OS version: 14.04
This is part of my preparation to update this server to newer Ubuntu.
I have fastcgi installed along side mod_php since all my sites are currently still in mod_php. The existing sites are working well using mod_php and no changes to their configurations. But the goal is to switch them to fastcgi using the UI for Website Options. Those options currently show:
Apache mod_php (run as Apache’s user)
CGI wrapper (run as virtual server owner)
Here is an unchanged apache config for a new subdomain I created, set to CGI wrapper. It generates a 500 Internal Server Error, and the apache error log says:
[cgi:error] [pid 17630] [client 70.191.91.6:63835] End of script output before headers: php5.cgi
(I know this is likely some sort of permission error)
Here’s the apache config (domains obscured):
ServerName testfcgi.###conference.org
ServerAlias www.testfcgi.###conference.org
ServerAlias webmail.testfcgi.###conference.org
ServerAlias admin.testfcgi.###conference.org
ServerAlias testfcgi.archives.###conference.org
ServerAlias www.testfcgi.archives.###conference.org
ServerAlias testfcgi.svn.###.org
ServerAlias www.testfcgi.svn.###.org
DocumentRoot /home/scientific-conference/domains/testfcgi.###conference.org/public_html
ErrorLog /var/log/virtualmin/testfcgi.###conference.org_error_log
CustomLog /var/log/virtualmin/testfcgi.###conference.org_access_log combined
ScriptAlias /cgi-bin/ /home/scientific-conference/domains/testfcgi.###conference.org/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/scientific-conference/domains/testfcgi.###conference.org/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksifOwnerMatch
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddType application/x-httpd-php5 .php5
AddType application/x-httpd-php5 .php
Action application/x-httpd-php5 /cgi-bin/php5.cgi
<Directory /home/scientific-conference/domains/testfcgi.###conference.org/cgi-bin>
allow from all
Require all granted
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.testfcgi.###conference.org
RewriteRule ^(.) http://testfcgi.###conference.org:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.testfcgi.###conference.org
RewriteRule ^(.) https://testfcgi.###conference.org:10000/ [R]
<Location /svn>
DAV svn
SVNParentPath /home/scientific-conference/domains/testfcgi.###conference.org/svn
AuthType Basic
AuthName testfcgi.###conference.org
AuthUserFile /home/scientific-conference/domains/testfcgi.###conference.org/etc/svn.basic.passwd
Require valid-user
AuthzSVNAccessFile /home/scientific-conference/domains/testfcgi.###conference.org/etc/svn-access.conf
Satisfy Any
RewriteEngine off
ErrorDocument 404 default
RemoveHandler .php
RemoveHandler .php5
php_admin_value engine Off
SuexecUserGroup “#1006” “#1003”
Switching to mod_php also fails, but differently. After about 5 seconds the browser times out without showing any errors or feedback of any kind. There are no entries in the apache error log. Here’s the configuration file for that setting:
ServerName testfcgi.###conference.org
ServerAlias www.testfcgi.###conference.org
ServerAlias webmail.testfcgi.###conference.org
ServerAlias admin.testfcgi.###conference.org
ServerAlias testfcgi.archives.###conference.org
ServerAlias www.testfcgi.archives.###conference.org
ServerAlias testfcgi.svn.###.org
ServerAlias www.testfcgi.svn.###.org
DocumentRoot /home/scientific-conference/domains/testfcgi.###conference.org/public_html
ErrorLog /var/log/virtualmin/testfcgi.###conference.org_error_log
CustomLog /var/log/virtualmin/testfcgi.###conference.org_access_log combined
ScriptAlias /cgi-bin/ /home/scientific-conference/domains/testfcgi.###conference.org/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/scientific-conference/domains/testfcgi.###conference.org/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksifOwnerMatch
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php .php
AddType application/x-httpd-php5.5 .php5.5
<Directory /home/scientific-conference/domains/testfcgi.###conference.org/cgi-bin>
allow from all
Require all granted
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.testfcgi.###conference.org
RewriteRule ^(.) http://testfcgi.###conference.org:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.testfcgi.###conference.org
RewriteRule ^(.) https://testfcgi.###conference.org:10000/ [R]
<Location /svn>
DAV svn
SVNParentPath /home/scientific-conference/domains/testfcgi.###conference.org/svn
AuthType Basic
AuthName testfcgi.###conference.org
AuthUserFile /home/scientific-conference/domains/testfcgi.###conference.org/etc/svn.basic.passwd
Require valid-user
AuthzSVNAccessFile /home/scientific-conference/domains/testfcgi.###conference.org/etc/svn-access.conf
Satisfy Any
RewriteEngine off
ErrorDocument 404 default
So, what’s causing the issue, and how do I configure Virtualmin to do it correctly automatically? There must be a template somewhere…
Thanks.