[FASTCGI] mod_fastcgi catch all ?

Fabrice Bacchella fbacchella at spamcop.net
Fri Sep 10 13:13:16 EDT 2010


Le 10 sept. 2010 à 18:04, Rénald Casagraude a écrit :

> Hi,
> 
> On 10 sept. 2010, at 17:22, Fabrice Bacchella wrote:
> 
>>>> And it's enough to have fastcgi sends all queries to remhost. Shouldn't an Action, AddHandler be needed ?
>>> 
>>> Sure it is !
>> 
>> But it's not. fastcgi catch this directory altough I don't ask it do so.
> 
> I wanted to say : "Sure it is if you want to *easily* filter queries :-)"
> mod_FastCGI handle every thing that resolve to the filename specified after FastCgiExternalServer directive

Ok, that's I wanted to know. It's made on purpose.
I wanted to do something like :
RewriteRule \.php - [handler=fastcgi-script]
FastCGIExternalServer DOCUMENTROOT/ -host ng91:9000

Yes, I'm a big fan of mod_rewrite, must be crazy.

> 
> In fact the only need for you is to resolve what you want to handle to the path specified by FastCgiExternalServer, eg :
> 
> <VirtualHost *>
>  DocumentRoot /my/doc/root
> 
>  # /my/fcgi/bin/dir/ doesn't need to exist
>  Alias /fcgi/ /my/fcgi/bin/dir/
>  AddHandler php-fastcgi .php
>  Action php-fastcgi /fcgi/php.fcgi
>  # therefore /my/fcgi/bin/dir/php.fcgi doesn't need to exist
>  FastCgiExternalServer /my/fcgi/bin/dir/php.fcgi -socket /my/path/to/php-fcgi.sock
> </VirtualHost>


First, don't forget virtual to the action line.

Also /my/fcgi/bin/dir/php.fcgi can't be totally made up. The directory /my/fcgi/bin/dir must exists and have "Allow from all".

I came out with something slightly shorter and straight forward :

 AddHandler php-fastcgi .php
 Action php-fastcgi /php.fcgi virtual
 FastCgiExternalServer DOCUMENTROOT/php.fcgi -host remotehost:9000

Because I haven't been able to reproduce and understand your setup and saw very strange values in PATH_TRANSLATED. Must be something with the way Apache (2.2) resolves paths.

That's the same thing that I wanted to do, with just an extra step : two machines with identical web installation, but a separation of dynamic and static contents.

Thanks anyway. 






More information about the FastCGI-developers mailing list