{"id":327,"date":"2014-09-22T13:47:41","date_gmt":"2014-09-22T13:47:41","guid":{"rendered":"http:\/\/www.nicovs.be\/?p=327"},"modified":"2014-09-22T13:49:38","modified_gmt":"2014-09-22T13:49:38","slug":"phpredmin-with-apache-php5-fpm-and-mod_proxy_fcgi","status":"publish","type":"post","link":"https:\/\/www.nicovs.be\/?p=327","title":{"rendered":"phpRedmin with apache, php5-fpm and mod_proxy_fcgi"},"content":{"rendered":"<p>With apache 2.4 and PHP5-FPM, the way to go is using mod_proxy_fcgi.<\/p>\n<p>Since configuration of a normal proxy vhost \u00a0configuration 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&#8230; \ud83d\ude09<\/p>\n<p>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.<\/p>\n<p>We were having some issues with the configuration&#8230;The homepage was accessible, but all subpages were not proxied they they should. Pretty weird, as phpmemcachedadmin, phpmyadmin,&#8230; work without any special configuration on the apache side.<\/p>\n<p>Hours of research led to the following fix: We created an extra vhost, and made some specific proxy rules in it:<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true\">VirtualHost *:80&gt;\r\n\r\n        ServerName phpredmin.servername.tld\r\n        DocumentRoot \/var\/www\/default\/wwwroot\/phpredmin\r\n\r\n\r\n        ErrorLog ${APACHE_LOG_DIR}\/error.log\r\n        CustomLog ${APACHE_LOG_DIR}\/access.log combined\r\n        LogLevel alert\r\n        DirectoryIndex index.php\r\n        Options -Indexes +FollowSymLinks +MultiViews\r\n        RewriteEngine on\r\n\r\n        Alias \/phpredmin \/var\/www\/default\/wwwroot\/phpredmin\/public\r\n        &lt;Directory \/var\/www\/default\/wwwroot\/phpredmin\/public&gt;\r\n                 RewriteCond %{REQUEST_FILENAME} !-f\r\n                 RewriteCond %{REQUEST_FILENAME} !-d\r\n                 RewriteRule . fcgi:\/\/127.0.0.1:9000\/var\/www\/default\/wwwroot\/phpredmin\/public\/index.php [P,L]\r\n\r\n\r\n                 RewriteRule ^\/?(.*\\.php)$ fcgi:\/\/127.0.0.1:9000\/var\/www\/default\/wwwroot\/phpredmin\/public\/$1 [P,L]\r\n                 RewriteCond %{REQUEST_FILENAME} -d\r\n                 RewriteRule ^\/?(.*)$ fcgi:\/\/127.0.0.1:9000\/var\/www\/default\/wwwroot\/phpredmin\/public\/$1 [P,L]\r\n\r\n                 DirectoryIndex disabled\r\n                 ProxyErrorOverride on\r\n                 require ip 192.168.2.0\/24\r\n                 require ip 192.168.10.0\/24\r\n        &lt;\/Directory&gt;\r\n\r\n&lt;\/VirtualHost&gt;<\/pre>\n<p>Credits to Carl V \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With apache 2.4 and PHP5-FPM, the way to go is using mod_proxy_fcgi. Since configuration of a normal proxy vhost \u00a0configuration 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 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[79,45,31],"tags":[],"class_list":["post-327","post","type-post","status-publish","format-standard","hentry","category-apache","category-linux","category-php-fpm-2"],"_links":{"self":[{"href":"https:\/\/www.nicovs.be\/index.php?rest_route=\/wp\/v2\/posts\/327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nicovs.be\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nicovs.be\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nicovs.be\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nicovs.be\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=327"}],"version-history":[{"count":2,"href":"https:\/\/www.nicovs.be\/index.php?rest_route=\/wp\/v2\/posts\/327\/revisions"}],"predecessor-version":[{"id":329,"href":"https:\/\/www.nicovs.be\/index.php?rest_route=\/wp\/v2\/posts\/327\/revisions\/329"}],"wp:attachment":[{"href":"https:\/\/www.nicovs.be\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nicovs.be\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nicovs.be\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}