httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcello Lorenzi <mlore...@sorint.it>
Subject Re: [users@httpd] Configure remote php-fpm server with SetHandler
Date Wed, 28 Jan 2015 20:32:00 GMT
Try with this:

<VirtualHost *:80>
...
	 ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/mnt/app/test/$1
...
</VirtualHost>


On 01/28/2015 09:26 PM, Santiago DIEZ wrote:
> Hi there,
>
>
> I have an /*httpd-2.4.10*/ server (ip 5.39.81.177:80 
> <http://5.39.81.177:80>) with htdocs files located in _/var/www/_.
>
> I have a remote /*php-fpm*/ server (ip 91.121.180.140:9000 
> <http://91.121.180.140:9000>) with htdocs files mounted in 
> _/htdocs/5-39-81-177/_.
>
> The httpd server currently passes php execution to the remote php-fpm 
> server with the following configuration :
> LoadModule proxy_module modules/mod_proxy.so
> LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
> ProxyPassMatch \.php$ fcgi://91.121.180.140:9000/htdocs/5-39-81-188/ 
> <http://91.121.180.140:9000/htdocs/5-39-81-188/>
>
> *It works fine*.
>
>
>
> Now that I'm done fooling around with ProxyPassMatch, I'd like to play 
> around with SetHandler.
>
> I tried the following configuration :
> LoadModule proxy_module modules/mod_proxy.so
> LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
> <FilesMatch \.php$>
>     SetHandler "proxy:fcgi://91.121.180.140:9000/htdocs/5-39-81-188/ 
> <http://91.121.180.140:9000/htdocs/5-39-81-188/>"
> </FilesMatch>
>
> But I get a *404: Not Found*.
>
> I read in the logs the following :
> mod_proxy_fcgi.c(786): [client 127.0.0.1:41289 
> <http://127.0.0.1:41289>] AH01076: url: 
> fcgi://91.121.180.140:9000/htdocs/5-39-81-188//var/www/info.php 
> <http://91.121.180.140:9000/htdocs/5-39-81-188//var/www/info.php> 
> proxyname: (null) proxyport: 0
>
> So the error makes sense because the file on the fpm server is 
> /htdocs/5-39-81-188/info.php and not /htdocs/5-39-81-188/var/www/info.php.
>
>
> *My question: How can I tell the directive to skip the /var/www/ part 
> when proxying the request?*
>
>
> Let's be clear on my purpose here. I'm strictly playing with 
> SetHandler and yes my fpm server is on a different machine.
> You might think "it's wrong practice"... I don't care.
> You might want to say "stick to ProxyPassMatch if it works"... NO I 
> want to play with SetHandler.
> You might want to offer an alternative... Fine, do it. But I don't 
> care, my toy IS SetHandler.
>
> Thanks you all for your help.
> -------------------------
> *Santiago DIEZ*
> -------------------------
> <http://www.google.com/url?q=http%3A%2F%2Fsantiago.news.free.fr%2Flogo.png&sa=D&sntz=1&usg=AFrqEzfmW2Io3OI5IqEGiVeDRebZgD4TaQ>
> -------------------------
> *Quark Systems & CAOBA*
> /23 rue du Buisson Saint-Louis, 75010 Paris
> /-------------------------


Mime
View raw message