Wednesday, December 23, 2009

Installing Varnish 2.0.6 From Source On Ubuntu

It's a nice thing to get init scripts and startup variables set in an easy way.

Download, build package, install - easy peasy

sudo apt-get update
sudo apt-get install subversion autotools-dev automake1.9 libtool autoconf libncurses-dev xsltproc quilt debhelper
cd /tmp
sudo svn co http://www.varnish-cache.org/svn/tags/varnish-2.0.6
cd varnish-2.0.6/varnish-cache
sudo dpkg-buildpackage
cd ..
sudo dpkg -i libvarnish1_2.0.6-2_i386.deb
sudo dpkg -i varnish_2.0.6-2_i386.deb

To make varnish listen on port 80, edit the default config:
sudo nano /etc/default/varnish

I wanted to set it up to cache static files so to shrink headers I want to unset any extra cookies sendt in header
nano /etc/varnish/default.vcl
sub vcl_recv {
    unset req.http.cookie;
}

No comments:

Post a Comment