On 23.11.2011, at 21:22, Tim Streater wrote:

> I'm looking at how apache is set up under OS X Lion and Snow Leopard. It 
> seems to me in both cases that, for the default apache config, fast-cgi is 
> disabled as the corresponding LoadModule is commented out. Is there a 
> particular reason why this should be?

Well it's a default config, it is expected that you have to adapt it for your 
needs. FastCGI simply is a feature that many do not need. Even PHP is something 
that many do not need.

> I notice that under SL, the fast-cgi module is a good bit older than other 
> modules, and under Lion, there isn't even one provided. Does this mean that 
> it has been integrated into apache or might there be some other reason?

It means that mod_fastcgi has not seen any development for quite some time. It 
has never been part of httpd. An alternative fastc-cgi module, mod_fcgid, has 
been donated to the Apache Foundation, and is maintained as separate module 
within the httpd project. It is not by default included in httpd either. It is 
more actively developed, but has (at least) one drawback compared to 
mod_fastcgi: it needs to spawn the FastCGI processes itself and thus does not 
support the fcgi process manaement in recent PHP versions.

I guess Apple simply moved to a "follow upstream" approach wrt FastCGI.

> I'd like to run an instance of apache that *only* needs to respond to AJAX 
> requests from localhost (in fact, I'm already doing this). It won't be asked 
> to serve html pages, it will only be running PHP scripts. Is this a situation 
> where ideally apache would be doing fast-cgi? Are there any optimisations I 
> can do with the apache config in this situation?

FastCGI has some advantages and some drawbacks compared to mod_php. In short:
* a different user than apache, and even a different user than other PHP apps 
can be used per location
* a non-threaded PHP runtime can be used with a threaded httpd MPM
* a PHP crash or memory leak does not affect httpd
But there is overhead, and more complex configuration and you need to install 
the module yourself. And the advantages sound rather academic in your setup, 
esp. if you're talking about a single PHP app. 

In this particular case it is even questionable whether apache is the best 
suited tool for the job. You might want to consider nginx or lighttpd for that, 
as it seems to be easier to set these up with support for PHPs own fcgi process 
management.

Rainer Frey


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
   "   from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to