You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tim Streater <ti...@clothears.org.uk> on 2011/11/23 21:22:00 UTC

[users@httpd] apache setup questions

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?

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?

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?


--
Cheers  --  Tim


Re: [users@httpd] apache setup questions

Posted by Nick Kew <ni...@webthing.com>.
On 23 Nov 2011, at 20:39, Wade Evans wrote:

> 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 

Probably.  mod_fcgid was donated to apache a couple of years ago.
When that filters through to distros is up to the packagers.

-- 
Nick Kew
---------------------------------------------------------------------
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-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] apache setup questions

Posted by Wade Evans <wa...@gmail.com>.
If all you want to do is run PHP scripts to service AJAX requests, why not
load the php module, set the type handler, and move on to a more
interesting problem?

-w


On Wed, Nov 23, 2011 at 12:22 PM, Tim Streater <ti...@clothears.org.uk> 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?
>
> 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?
>
> 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?
>
>
> --
> Cheers  --  Tim
>
>
>
> ---------------------------------------------------------------------
> 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-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>

Re: [users@httpd] apache setup questions

Posted by Rainer Frey <ra...@inxmail.de>.
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-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org