Apache HTTP Server and load balancing to PHP FPM	
	+
    
    
    +
Par Remi le jeudi 17 septembre 2015, 14:39 - HowTo - Lien permanent
One of the benefits of FPM is a clear separation and isolation of web front-end (httpd) and from the application server (php-fpm).
Here is a simple configuration example using Apache as a load balancer to various FPM instances.
The base configuration is really (too) simple
    # Load balancer creation
    <Proxy balancer://phpfpmlb>
        BalancerMember fcgi://10.0.0.12:9000
        BalancerMember fcgi://10.0.0.34:9000
    </Proxy>
    # Redirect PHP execution to the balancer
    <FilesMatch \.php$>
        SetHandler "proxy:balancer://phpfpmlb"
    </FilesMatch>For more information, read the documentation:







Commentaires
Sadly, this doesn't work yet on RHEL-7 (see PHP bug #62172 and RHEL bug #1302797).
On the PHP side, I plan to apply the fix in upcoming versions 5.6.18 and 7.0.3.