Setting up Varnish for Drupal on CentOS 6

Varnish has an offical repository so let’s add it to Yum as outlined on

Set Varnish to start on system boot

Setup DAEMON_OPTS in /etc/sysconfig/varnish, something like below. It will be commented out by default:

Edit the default.vcl file. We use the following for Drupal, which Four Kitchens kindly made available.

Now update your web server to serve from port 8080, and restart the server and varnish.

Download and enable the drupal varnish module:

Add something like the following to settings.php:

Hopefully the site is now using Varnish, you can get some good stats using the varnishlog and varnishstat programs that are included with Varnish.

Leave a Reply

Your email address will not be published. Required fields are marked *