Varnish can cache any web based content, meaning any CMS, intranet, ReST/Web API, or Streaming media content can literally gain performance increases in the range of 300-1000x times compared to what standard web servers can provide.
But, before you get to Varnish, You want to get Varnish. You have two choices:
We have packages for a number of operating systems, and we have the open source project available on Github.
If you plan to subscribe to Varnish Plus, check out products at our website
To just get started with installation on your machine:
Your choice of operating system, preferably UNIX. Below we have some helpful commands to get you started with your choice of OS.
pkg_add -r varnish
cd /usr/ports/varnish && make install clean
The latest version is available as prebuilt RPMs (el5 and el6) on `https://packagecloud.io/varnishcache/`_ .
See the online Red Hat installation instructions for more information.
Varnish is included in the EPEL repository, however due to incompatible syntax changes in newer versions of Varnish, only older versions are available.
We therefore recommend that you install the latest version directly from our repository, as described above.
Varnish is distributed with both Debian and Ubuntu.
sudo apt-get install varnish
Please note that this might not be the latest version of Varnish. If you need a newer version of Varnish for the OS version you are using, please follow the instructions in the Varnish Book or as shown below.
curl -L https://packagecloud.io/varnishcache/varnish41/gpgkey | sudo apt-key add - sudo nano /etc/apt/sources.list.d/varnishcache_varnish41.list deb https://packagecloud.io/varnishcache/varnish41/ubuntu/ trusty main deb-src https://packagecloud.io/varnishcache/varnish41/ubuntu/ trusty main
sudo apt-get update sudo apt-get install varnish
For more information visit the packagecloud page.
If you are installing Varnish Cache 4.0, replace varnish41 for varnish40 in the command above. Instructions for Debian and Ubuntu are the same.
If there are no binary packages available for your system, or if you want to compile Varnish from source for other reasons, such as personal interest or anything that counts as a reason, follow these steps:
Download the appropriate release tarball, which you can find on the repository source .
Alternatively, if you want to hack on Varnish, you should clone our git repository by doing:
git clone https://github.com/varnishcache/varnish-cache
A UNIX machine or a Mac
In order to build Varnish from source you need a number of packages installed. On a Debian or Ubuntu system these are:
automake autotools-dev libedit-dev libjemalloc-dev libncurses-dev libpcre3-dev libtool pkg-config python-docutils python-sphinx graphviz
To build Varnish on a Red Hat or CentOS system you need the following packages installed:
autoconf automake jemalloc-devel libedit-devel libtool ncurses-devel pcre-devel pkgconfig python-docutils python-sphinx graphviz
As of SmartOS pkgsrc 2015Q4, install the following packages:
pkgin in autoconf automake libedit libtool ncurses \ pcre graphviz py27-sphinx python27 gmake gcc49 \ pkg-config
Optionally, to pull from a repository:
pkgin in git
Finally if you have all of the above dependencies satisfied. You can move on to building your Varnish from scratch.
cd varnish-cache sh autogen.sh sh configure make
The configure script takes some arguments, but more likely than not you can forget about that for now, almost everything in Varnish can be tweaked with runtime parameters.
Before you install, you may want to run the test suite, and make a cup of tea while it runs, as it usually takes a couple of minutes:
Don’t worry if one or two tests fail; some of the tests are a bit too timing sensitive. (Please tell us which so we can fix them.)
If a lot of tests fail and in particular if the b00000.vtc test fails, something is horribly wrong, and you will get nowhere without figuring out what is causing all the chaos.
And finally, the true test of a brave heart!
sudo make install