Today gnusys.net had a little downtime as i was trying to change my apache-php interface into FastCGI.
The installation of php-cgi and mod_fcgid went pretty simple in my Debian Etch;so was the configuration
The tricky part was that the wordpress blog was giving Internal Server Error in the index page.
====
[Thu May 22 04:15:41 2008] [notice] mod_fcgid: call /var/www/gnusys/index.php with wrapper /usr/bin/php5-cgi
[Thu May 22 04:15:41 2008] [notice] mod_fcgid: server /var/www/gnusys/index.php(10073) started
[Thu May 22 04:15:41 2008] [info] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Thu May 22 04:15:41 2008] [error] [client 59.93.6.103] Premature end of script headers: index.php
[Thu May 22 04:15:44 2008] [notice] mod_fcgid: process /var/www/gnusys/index.php(10052) exit(communication error), get unexpected signal 11
====
The above logs were not good enough.I tried changing the file and directory permissions and the normal first aides you give on the symptom of an Internal Server error
Strangely all my other php applications was working just fine except the blog. I also tried removing the object-cache.php file that integrates my wordpress with xcache without much help
In the end the problem was sorted out to be with my xcache php extension.I disabled the extension from the php.ini and hurray the wordpress loaded just fine!
Xcache is not compatiable with mod_fcgid!.Please disable this module if you use mod_fcgid
Heres my configuration with mod_fcgid
neutron:/var/www/gnusys# cat /etc/apache2/mods-enabled/fcgid.load
LoadModule fcgid_module /usr/lib/apache2/modules/mod_fcgid.so
neutron:/var/www/gnusys#
neutron:/var/www/gnusys# cat /etc/apache2/mods-enabled/fcgid.conf
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi .php
SocketPath /var/lib/apache2/fcgid/sock
IPCConnectTimeout 3600
</IfModule>
neutron:/var/www/gnusys#
neutron:/var/www/gnusys# cat /etc/apache2/sites-enabled/gnusys.net
<VirtualHost *>
ServerName gnusys.net
ServerAlias www.gnusys.net
DocumentRoot /var/www/gnusys
<Directory “/var/www/gnusys”>
AllowOverride FileInfo Limit Options Indexes
FCGIWrapper /usr/bin/php5-cgi .php
</Directory>
</VirtualHost>
neutron:/var/www/gnusys#
I am trying to integrate suPHP with this .There is visible perfomance degradation while i dumped my mod_php + xcache config.But this is just more secure and better for a shared environment. And since i am on a dedicated environment i will probably return back to my old config.
Posted under Apache, hosting, php