So, I've been trying to run two PHP 5.6 websites behind Varnish for performance reasons (all this are happening on a VPS instance, not the shared ones).
So I had no trouble setting up varnish using the approach that you describe here during your earlier days at WF.
I have also set up Apache using another tutorial here about Apache + Django, and i tested a basic html root folder and everything works properly. The problem i'm facing is how do i make my apache instance to run PHP 5.6??
For the life of me I cannot pull it off. I've tried using this configuration that uses php56-cgi which didn't work:
<VirtualHost 127.0.0.1:$APP_PORT>
ServerName <domain>.com
ServerAlias www.<domain>.com
DocumentRoot /home/<username>/apps/<php_site_app>
DirectoryIndex index.html index.htm index.cgi index.php
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/path/to/your/documentroot/$1
ProxyPreserveHost on
AddDefaultCharset utf-8
Options +ExecCGI
AddHandler cgi-script .cgi
Alias /cgi-bin/php56.cgi /home/php-cgi/php56.cgi
Action php56-cgi /cgi-bin/php56.cgi
AddHandler php56-cgi .php
SetEnv PHP_INI_SCAN_DIR /home/<username>/apps/<php_site>/
Include /home/<username>/apps/<apache_custom_instance>/apache2/conf/extra/httpd-autoindex.conf
<Directory /home/kyris/webapps/riknews>
AllowOverride all
<FilesMatch \.ht(access|passwd)>
Require all denied
</FilesMatch>
<FilesMatch (\.user\.ini|php\.ini)>
Require all denied
</FilesMatch>
<FilesMatch \.php$>
SetHandler php56-cgi
</FilesMatch>
</Directory>
</VirtualHost>`
I also tried running the underlying php-fpm instance using a custom conf file (so I created a proxy app to get a port, and then made the php-fpm listen to that port and dump error logs on my user's logs folder), and then used this instead of the php56-cgi handler:
SetHandler "proxy:fcgi://localhost/:<custom_port>
which was coming back with an Error (Of course php-fpm is with PHP 7 on the machine, but I thought I'll give it a try, just to see how far I could go!).
Any pointers on what config I should be running on my apache to load this old php sites?
I am now thinking to install mod_php myself and give that a go but I am not feeling very hopeful!
Thanks a lot!