phpninja Posted February 21, 2017 Share Posted February 21, 2017 Apache2 VirtualHost Block -> ProxyPass fastcgi PHP-FPM + sub-directory w/ different ProxyPass ... how? It seems like I have tried everything that I could think of. I tried putting a sub directory Directory directive in, with a secondary Proxy Pass, with no luck. ProxyPass fcgi://127.0.0.1:9071/home/exampledomain/public_html$1 (PHP 7.1.2) ProxyPass fcgi://127.0.0.1:9056/home/exampledomain/public_html$1 (PHP 5.6) I need to use PHP 5.6 on a sub directory. Does anyone know how I can achieve this? # VIRTUAL SERVER # # TLD: exampledomain.com # # Username: exampledomain # # SSL # <VirtualHost 10.1.1.100:443> ServerName exampledomain.com ServerAlias exampledomain.com DocumentRoot /home/exampledomain/public_html ErrorLog /home/exampledomain/exampledomain.com_ssl_error_log CustomLog /home/exampledomain/exampledomain.com_ssl_access_log combined ScriptAlias /cgi-bin/ /home/exampledomain/cgi-bin/ DirectoryIndex index.html index.php index.php4 index.php5 index.htm <Directory /home/exampledomain/public_html> Options -Indexes +FollowSymlinks #allow from all #AllowOverride None Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch AllowOverride All Require all granted </Directory> <Directory /home/exampledomain/cgi-bin> #allow from all #AllowOverride None Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch AllowOverride All Require all granted </Directory> RewriteEngine on RewriteCond %{HTTP_HOST} =www.exampledomain.com RewriteRule ^(.*) https://exampledomain.com/ [R] SSLEngine on SSLCertificateFile /home/exampledomain/ssl.cert SSLCertificateKeyFile /home/exampledomain/ssl.key SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1 php_value memory_limit 64M php_value suhosin.session.encrypt Off <LocationMatch ^(.*\.php)$> ProxyPass fcgi://127.0.0.1:9071/home/exampledomain/public_html$1 </LocationMatch> </VirtualHost> Quote Link to comment https://forums.phpfreaks.com/topic/303259-apache2-virtualhost-block-proxypass-fastcgi-php-fpm-sub-directory-w-different-proxypass-how/ Share on other sites More sharing options...
phpninja Posted February 22, 2017 Author Share Posted February 22, 2017 [sOLVED] Directly under your main </Directory>add this block (Top one is Everything , unless otherwise specified) and the second block is a designated sub directory with a custom PHP-FPM pass. Port 9071 = PHP71-PHP-FPM Port 9056 = RH-PHP56-PHP-FPM <LocationMatch ^(.*\.php)$> ProxyPass fcgi://127.0.0.1:9071/home/exampledomain/public_html$1 </LocationMatch> <LocationMatch ^/forum(.*\.php)$> ProxyPass fcgi://127.0.0.1:9056/home/exampledomain/public_html/forum$1 </LocationMatch> Quote Link to comment https://forums.phpfreaks.com/topic/303259-apache2-virtualhost-block-proxypass-fastcgi-php-fpm-sub-directory-w-different-proxypass-how/#findComment-1543230 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.