1

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.

2
  • 1
    And you have no security concerns with hundreds of domains on the one machine in sharing a PHP-FPM process? Why not use pools? Apr 16, 2014 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, 2014 at 7:20

2 Answers 2

1

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

0

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.

1
  • 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, 2014 at 21:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .