- Start with Poralix's NGINX + Varnish + Apache on Directadmin powered server post as an overall guide
- First, Add the Extra Packages for Enterprise Linux (EPEL) repository to your server and straight after that, install Varnish using Yum. Focus on the section titled Varnish 4.1
- Switch back to the overall guide and finish the installation by modifying your DirectAdmin installation as instructed.
- Next, update /etc/varnish/default.vcl with this one.
- Now let's start Varnish:
Note: the following command assumes you're on a CentOS 7 box
service varnish start
If no errors appear Varnish just started and you now have a front end cache ahead of an NGINX front end proxy in front of an Apache web server.
- Last step, set Varnish to autostart every time you reboot the server :
Note: again, the following command is for a CentOS 7 box
sudo systemctl enable varnish.service
- All set! Varnish should now be running in front of NGINX and apache as a front end cache. Much win!