Hello,
I have been playing with apache 2.4 on ubuntu 16.04 LTS server. My goal here is to show the minimum settings required to get php-fpm running in hopes it can be implemented with virtualmin soon. I would take a crack at it myself but I am really unfamiliar with the perl code of virtualmin...
There is a veritable tonne of (conflicting) information about configuring apache, php-fpm, and various combinations of fcgi, fastcgi, etc.
The method I found only requires mod_proxy and mod_proxy_fcgi.
My reference is https://wiki.apache.org/httpd/PHP-FPM. I also asked a few questions on the apache-users maillists. Assumptions ubuntu 16.04 LTS server has the following - apache 2.4.18 - php 7.0 - no virtualmin (aka plain linux server...)
using 000-default.conf that came with apache
test.php located in /var/www/html:
<?php
phpinfo();
?>
notes:
- The ProxyPassMatch part appends the php file path from the url to /var/www/html/.
- The port listened to by php-fpm could be a unix socket located in the user/site's home directory
php-fpm information: php-fpm is part of php now. It's no longer a separate effort. it supports the concepts of "pools", each pool can have a different uid/gid, and even bind to a different port/socket. The ProxyPassMatch directive can be declared at the vhost level, thus code could be run in user sandboxes. This site shows some of the weaknesses of php-fpm and ways to leverage around it.
What do you all think?
--jason