How to install Varnish on Plesk 11

This short how-to will show you how to easily install Varnish on a CentOS Plesk 11 server, and set it up as a reverse proxy cache with Apache behind it.

Warning: The steps listed here use a 3rd party yum repository, and installs Varnish which is not officially supported by Parallels Plesk Panel, or by Codero. Please proceed at your own caution.


  • Important: Make a backup of your psa database, and all of your configuration files before following these steps. Do you not proceed until you have done so.
  • Change Apache's port from 80 to 8088(or a port of your choosing) in Plesk's configuration:
mysql -uadmin -p$(cat /etc/psa/.psa.shadow) -D psa -e'replace into misc (param, val) values ("http_port", 8088);'
/usr/local/psa/admin/bin/httpdmng --reconfigure-all
  • Change all of the "Listen 80" lines to the new port
vim /etc/httpd/conf/httpd.conf
  • Install varnish from atomic repo:
    • Important: The ART yum repository is a 3rd party repository, and is not maintained or supported by Codero. However, it should be reasonably safe to use as they try to maintain compatibility with Plesk.
wget -q -O - | sh
yum install varnish
  • Edit /etc/yum.repos.d/atomic.repo and set enabled to 0
    • If you do not disable this repository, you may unexpectedly update other packages on your system such as php or mysql.
  • Edit /etc/sysconfig/varnish and edit these lines:
  • Changing the listen port is the most important step, to ensure Varnish starts on port 80 instead of its default port. You may also want to change VARNISH_STORAGE to malloc instead of file. Malloc will use memory to store the cache, instead of storing the cache in a file on the disk which can be slower.


Removal is fairly simple and straight forward.

  • First, stop Varnish from listening on port 80 by editing /etc/sysconfig/varnish and changing this line


  • Change the port Apache uses back to 80
  • Edit /etc/http/conf/httpd.conf
    • Change the Listen line back to 80 instead of 8080
  • Update and rebuild Plesk's apache configuration
mysql -uadmin -p$(cat /etc/psa/.psa.shadow) -D psa -e'replace into misc (param, val) values ("http_port", 80);'
/usr/local/psa/admin/bin/httpdmng --reconfigure-all
  • Stop varnish, and restart apache
/etc/init.d/varnish stop
/etc/init.d/httpd start
chkconfig varnish off



Please refer to the official Varnish documentation for help on configuring Varnish.

An extremely basic varnish config can contain this in /etc/varnish/default.vcl:

backend default {
  .host = "";  # Should be set to the IP your website is listening on in Apache
  .port = "8088";
Posted in
Last update:
2015-12-03 20:39
Average rating:0 (0 Votes)