I want to move from Apache 2.2 to Apache 2.4, but there is no mod_fastcgi
, and the recommended upgrade path is mod_proxy_fcgi
However I can't figure out how to accomplish the following:
<IfModule mod_fastcgi.c>
Alias /php5.fcgi /usr/local/www/fastcgi/php5.fcgi
FastCGIExternalServer /usr/local/www/fastcgi/php5.fcgi -flush -host 127.0.0.1:9000
AddType application/x-httpd-fastphp5 .php
Action application/x-httpd-fastphp5 /php5.fcgi
<Directory "/usr/local/www/fastcgi/">
Order deny,allow
Deny from all
<Files "php5.fcgi">
Order allow,deny
Allow from all
</Files>
</Directory>
</IfModule>
This allows all the virtual hosts and everything that requires PHP to use a single PHP-FPM process, the new ProxyPassMatch
requires that I set up an individual entry for each vhost, which is time consuming and error prone...
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/path/to/vhost/$1
For now I've reverted back to Apache 2.2, but I would love to find a solution to this problem.
You could use server variables to achieve what you want: The answer from this question might help you:
0-is-not-replaced-by-server-name-when-used-with-apaches-proxypassmatch
First of all you need to be clear about whether you're going to have separate pools of processes per domain. If you do, then you need to map domains to a separate fastgi port for each pool.
The suggested configuration approach, or something like it is necessary if you're going to have a pool of php processes for each domain. If you don't do that, then all your domains have to run using the same userID, which makes them quite exposed to each other if for example these are separate hosted clients. IF they're all your own stuff, and there's not too much to protect, then maybe you don't care as much. Eg if you're just parking domains, then user-per-domain is probably a silly waste of resources.
If you are hosting many people's sites then I think to be responsible, you should move to having a process pool per user. I'm not saying it'll be a simple transition though, and yes, there are resourcing issues, though the configuration management part of this should be relatively easy. You will want some sort of scripted system for generating the configuration. My tool of choice for such things is puppet, but there are plenty of alternatives.
Whether you take that advice or not, you first want to make that decision and then re-phrase your question regarding the mechanics of how to accomplish what you want.