Re: Re: php-fpm and apache
| From: | Vince LaMonica | Date: | Fri, 29 Dec 2017 17:45:48 +0000 |
| Subject: | Re: Re: php-fpm and apache | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-326301@lists.php.net to get a copy of this message | ||
@lbutlr wrote:
Hi, I hate to repost, but I did not receive this message back from the list, so I am unsure it got posted. So it's not a complete repeat, I've added a little information.
I have php working within Apache 2.4 by adding the Proxy method to the virtual host, but am holding off on doing this for all the virtual hosts if I can avoid it.
DocumentRoot /usr/local/www/roundcube/
ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/usr/local/www/roundcube/$1
I'd recommend creating a socket instead [lower overhead]. I do this for a few dozen virtual domains and it's been running smoothly for a few years.
Example:
Protocols h2 http/1.1
DocumentRoot /home/web_example1.com/websites/example1.com/www
SuexecUserGroup web_example1 web_example1
<FilesMatch \.php$>
SetHandler "proxy:unix:/var/run/php/php7-fpm-example1.sock|fcgi://example1"</FilesMatch> <Proxy "fcgi://example1/"> Require ip 1.2.3.4 </Proxy> The "1.2.3.4" IP should be your public IP that the proxy can use [otherwise anyone can use your host as a proxy]. Then edit your /etc/php/7.0/fpm/pool.d/www.example1.com.conf with your path to the UNIX socket along with the rest of the php-fpm settings for your virtual domain. HTH, /vjl/