With apache 2.4 and PHP5-FPM, the way to go is using mod_proxy_fcgi.
Since configuration of a normal proxy vhost configuration is out of the scope of this article, I will not explain how to do this. There are lots of resources out there to find on how to impelement this. If i find the time to make an article on this, i will do so… 😉
So, today we were trying to configure phpredmin (imo the best Redis manamement tool out there) to work with Apache 2.4 using mod_proxy_fcgi to connect to PHP5-FPM.
We were having some issues with the configuration…The homepage was accessible, but all subpages were not proxied they they should. Pretty weird, as phpmemcachedadmin, phpmyadmin,… work without any special configuration on the apache side.
Hours of research led to the following fix: We created an extra vhost, and made some specific proxy rules in it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
VirtualHost *:80> ServerName phpredmin.servername.tld DocumentRoot /var/www/default/wwwroot/phpredmin ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined LogLevel alert DirectoryIndex index.php Options -Indexes +FollowSymLinks +MultiViews RewriteEngine on Alias /phpredmin /var/www/default/wwwroot/phpredmin/public <Directory /var/www/default/wwwroot/phpredmin/public> RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . fcgi://127.0.0.1:9000/var/www/default/wwwroot/phpredmin/public/index.php [P,L] RewriteRule ^/?(.*\.php)$ fcgi://127.0.0.1:9000/var/www/default/wwwroot/phpredmin/public/$1 [P,L] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^/?(.*)$ fcgi://127.0.0.1:9000/var/www/default/wwwroot/phpredmin/public/$1 [P,L] DirectoryIndex disabled ProxyErrorOverride on require ip 192.168.2.0/24 require ip 192.168.10.0/24 </Directory> </VirtualHost> |
Credits to Carl V 😉