How to Configure Zpanel with Varnish Cache (with Pictures)
Edit Article

  • 1 Editor

This guide brings you easy steps on how to setup Varnish Cache so that it may run in front of the default web server of zPanel, Apache on either Ubuntu or CentOS. Just to jog your memory a little bit, Varnish Cache is great web accelerator software which makes it possible to cache the web content either on the server’s disk or RAM (this you can choose). This helps the web request be even delivered with minimal access to Apache as the backbend. This results in a decreased usage of CPU. Many people believe that Varnish is actually an awesome weapon to survive from Reddit and Digg effect. But the best is yet to come. The best thing about it is that its installation can be done side by side with a control panel like cPanel/WHM and also with zPanel too.

This article will tell you how to install and configure zPanel and run it Varnish Cache.



The first step is to login to your server as root or as a use with root / sudo privileges.


The next step is to issue a command to install zPanelX CP.

For Ubuntu LTS: bash <(curl -Ss

In case the above code does not work;

bash <(curl -Ss For CentOSbash <(curl -Ss

In case the above code does not work;

bash <(curl -Ss [[1]]) Step-3:

Once the installation finishes you should be able to see the zPanel username. It should be zadmin and the password should also be zadmin.


You should now configure all and every basic setting and zPanel setup for your website. The least you can do is add a new website to the newly install zPanel.



The first thing is to open up your browser and from there you need to log in to the zPanel dashboard. You need to log in as zAdmin.


Now you need to go to the menu and from there Server admin > Module Admin > Apache Config.



You need to change the port on which Apache is set to work. It is usually set to port 80. Just change it according to your predefined setting of Varnish. I usually set it to 8080,



Now just scroll down a bit and just click on “Save Changes” button.


Once the changes are saved, you should login back into your server by using command line. Go to zPanel’s Apache configuration. If you using CentOS then it might be located at:




Now you need to open up your favorite text editor. Once opened, edit httpd-vhosts.conf file. I in this case will be using Nano.



Once done you’ll be able to see pretty clearly that all the default *:80 port will be replaced by *:8080 port. Along with this, all the virtual hosts entries of all your domains will be changed too. If that does not happen then simply restart Apache. Of somehow that does not work too then replace all the :80 with :8080.


Now save the changes and then just exit.


That is it. You are now all set. Just restart Apache and start the Varnish Cache:



Article Tools

Did this article help you?


an Author!

Write an Article