[TriLUG] Apache/Passenger/PHP weirdness

Cristóbal Palmer cmp at cmpalmer.org
Wed May 19 21:50:51 EDT 2010


On Wed, May 19, 2010 at 6:51 PM, Thomas Ingram <thomas at ravinggenius.com> wrote:
> I added fcgid.conf to the gist. I'm *assuming* mod_fcgid is loaded,
> but I'm not sure how to verify that. Also `httpd -S` gives me "httpd:
> command not found". Not sure why because I know Apache is installed.

If you're on RHEL or CentOS, you're probably looking for /usr/sbin/httpd -S

On a debian or Ubuntu system you're probably looking for /usr/sbin/apache2ctl -S

As for your fcgid.conf, that's looking leaner than it should. Mine not
quite fills a screen. You should definitely spend some time at
http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html instead of taking
my word for it (esp. for performance tuning, which I'm leaving out),
but here are some chunks from mine for a box that has WordPress on it:

--- Begin ---

# This is the Apache server configuration file for providing FastCGI support
# through mod_fcgid
# Documentation is available at http://fastcgi.coremail.cn/doc.htm

LoadModule fcgid_module modules/mod_fcgid.so
# 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>
# Sane place to put sockets and shared memory file
SocketPath run/mod_fcgid
SharememPath run/mod_fcgid/fcgid_shm
# let's use this for php, shall we?
AddType text/html .php
DirectoryIndex index.php
IdleTimeout 240
<Files *.php>
   SetHandler fcgid-script
   Options +ExecCGI
   FCGIWrapper /usr/bin/php-cgi .php
</Files>
# allows basic auth to work
RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]

--- End ---

A few notable settings/values I haven't given you because they will
depend on your resources:

DefaultMinClassProcessCount
DefaultMaxClassProcessCount
SpawnScoreUpLimit
SpawnScore
TerminationScore

Have a good look through the docs and play with values while test test testing.

Cheers,
-- 
Cristóbal M. Palmer
ibiblio.org systems
UNC Chapel Hill



More information about the TriLUG mailing list