httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hajo Locke <>
Subject Re: [users@httpd] Configuration help - addhandler <> mod_proxy_fcgi
Date Mon, 11 Sep 2017 13:34:00 GMT

Am 11.09.2017 um 14:58 schrieb Eric Covener:
> On Mon, Sep 11, 2017 at 4:28 AM, Hajo Locke <> wrote:
>> Hello List,
>> currently i use classic mod_fastcgi (fastcgiexternalserver) with php-fpm,
>> which is quite reliable.
>> A disadvantage of this setup is, that not every response-header set by
>> .htaccess will really send to client.
>> Something like this is the current setup:
>> <IfModule mod_fastcgi.c>
>>      AddHandler myphp-cgi .php
>>      Action myphp-cgi /cgi-fpm/php71-fpm
>> </IfModule>
>> The big advantage is, that my users are able to use addhandler by .htaccess
>> to choose any provided php-version.
>> Now i try to switch from mod_fastcgi to new recommend way of mod_proxy_fcgi
>> The basic variants with SetHandler are working easily:
>> <FilesMatch \.php$|\.php70$|\.phpx$>
>>      SetHandler "proxy:unix:/dev/shm/php70fpm.sock|fcgi://localhost/"
>>   </FilesMatch>
>> Now i want to use AddHandler again, so .htaccess files of my users will
>> automatically work former way and choose proper php-version.
>> Unfortunately i was not able to combine AddHandler, Action and the proxy in
>> a working way:
>> Addhandler php-mycgi .php
>> Action php-mycgi "proxy:unix:/dev/shm/php71fpm.sock|fcgi://localhost/"
>> When enabling this in global conf every request to php files results in a
>> 400 response:
>> [Mon Sep 11 10:10:09.375597 2017] [core:error] [pid 23826] [client
>> x.x.x.x:53050] AH00126: Invalid URI in request GET /phpinfo.php HTTP/1.1
>> Please give me a hint to a working configuration. All my attempts were not
>> successful.
> Action could be tricky here. Are you using php-fpm? Have you
> considered allowing users to point at different sockets for diffrenent
> fpm pools?
thanks for your answer. yes, i want to proxy to a socket provided by 
php-fpm. I run some different php-versions and allow my Users to choose 
fitting version by:

AddHander php70 .php
Addhandler php71 .php

With classical modfastcgi this is easy. Every User has its own socket 
provided by php-fpm pool-configuration and is used in VHosts of this user.

I investigated some time and found this:
To my surprise this code is alreay present in apache 2.4.27
This is working:
Addhandler "proxy:unix:///dev/shm/php70fpm.sock|fcgi://localhost/" .php

It seems problem it is more mod_actions related and action is not 
supporting the proxy-notation. This would not be a problem for a pure 
serverside configuration.
But in this case all my users have to rewrite their .htaccess . with too 
much users in hosting this is not possible.
I have to find a way where notation like "Addhandler php71 .php" also 
works with a fcgi-proxy, so creating a basic handlername and bind this 
to a proxy action.
But unfortunately i cant achieve this on my own.

Thanks for your help.

> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message