Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
    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

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://$1

For now I've reverted back to Apache 2.2, but I would love to find a solution to this problem.

share|improve this question
And you have no security concerns with hundreds of domains on the one machine in sharing a PHP-FPM process? Why not use pools? – Guy Hughes Apr 16 '14 at 4:22
I understand how to use the pools, and I understand that from a security point that would be much better, unfortunately that is not an option for me due to client requirements. I'd be using the same pool anyway, I'd just be replicating the ProxyPassMatch hundreds of times, and still be pointing to the same PHP-FPM process/pool. – X-Istence Apr 16 '14 at 7:20

You could use server variables to achieve what you want: The answer from this question might help you:


share|improve this answer

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.

share|improve this answer
My question is quite clear in that I am trying to replicate the FastCGI solution which maps however many VirtualHosts to a single PHP-FPM pool. – X-Istence Apr 24 '14 at 21:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.