Table of Contents

varnish

Varnish is a web accelerator.

Wikipedia: A web accelerator is a proxy server that reduces web site access times. They can be a self-contained hardware appliance or installable software.

Configuration

Edit /etc/varnish/default.vcl:

backend default {
  .host = "127.0.0.1";
  .port = "80";
}

The web server must accept connections on that IP address and serve the content. A standard virtualhost would listen only on public IP addresses.

Start varnishd:

varnishd -f /etc/varnish/default.vcl -s malloc,1G -T 127.0.0.1:2000 -a 0.0.0.0:8080

Notes

Ubuntu

curl http://repo.varnish-cache.org/debian/GPG-key.txt | apt-key add -
echo "deb http://repo.varnish-cache.org/ubuntu/ lucid varnish-3.0" >> /etc/apt/sources.list
apt-get update
apt-get install varnish