2 posts tagged “apache”
Just ran into another potential useful tip for you. If you find that your FastCGI configuration settings are being ignored when running mod_fcgid 2.2 and Apache 2.x and you're using VirtualHosts try calling the configuration directives from within the VirtualHost block.
Apparently mod_fcgid settings (like IPCCommTimeout and the like) which are set in the global config file or anywhere outside of the vhost block are wiped out within the VirtualHost block, replaced by the default settings.
So in you httpd.conf, do:
# Load FastCGI module
LoadModule fcgid_module modules/mod_fcgid.so# Include global FastCGI settings module
Include conf/extra/mod_fcgid.conf
Then within each VirtualHost you can include your Apache defaults and then override them:
# Include global FastCGI settings module
Include conf/extra/mod_fcgid.conf<IfModule mod_fcgid.c>
# Use FastCGI to process .fcg .fcgi & .fpl scripts
# Don't do this if mod_fastcgi is present, as it will try to do the same thing
<IfModule !mod_fastcgi.c>
AddHandler fcgid-script fcg fcgi fpl
</IfModule>ProcessLifeTime 7200
</IfModule>
...or just specify them all in place. Just for reference here are the settings I like particularly for running Movable Type under FastCGI. YMMV.
# Use FastCGI to process .fcg .fcgi & .fpl scripts
# Don't do this if mod_fastcgi is present, as it will try to do the same thing
<IfModule !mod_fastcgi.c>
AddHandler fcgid-script fcg fcgi fpl
</IfModule><IfModule mod_fcgid.c>
# Sane place to put sockets
SocketPath /tmp/fcgid_sock/
IdleTimeout 3600
ProcessLifeTime 7200
MaxProcessCount 1000
DefaultMinClassProcessCount 3
DefaultMaxClassProcessCount 100
IPCConnectTimeout 8
IPCCommTimeout 360
BusyTimeout 300
</IfModule>
This is just a little hint for anyone who, like me, ran into this problem. If you are trying to compile mod_fcgid 2.2 for Apache 2.x on Mac OS X and are getting errors like this on load of a fastgi script:
[Wed Jan 16 15:18:49 2008] [error] (13)Permission denied: mod_fcgid: couldn't bind unix domain socket /opt/local/apache2/run/mod_fcgid/10597.34
[Wed Jan 16 15:18:49 2008] [warn] (13)Permission denied: mod_fcgid: spawn process /Users/jay/Sites/tdi.local/bnn/cgi/mt/mt.fcgi error
The fix is to change the SocketPath configuration directive from the default (which is usually something like run/mod_fcgid) to /tmp/fcgid_sock/.
I'm not sure why, but the socket can't be written to under the Apache run directory despite having the correct permissions but under tmp it works great. Chalk one up for the "computers are run by evil little magical elves" camp.