Re: Re: php-fpm and apache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux