Compiling Varnish on a minimal JeOS System
Varnish is an excellent-looking “HTTP accelerator”, designed specifically as a high-performance caching reverse-proxy to sit in front of your hard-working application servers, and relieve them of load. It’s a bit of a pain in the ass to install from source on JeOS, though. Here’s what I ended up doing:
-
Install XSLTProc:
sudo apt-get install xsltproc
-
Install some helpful GNU tools:
sudo apt-get install automake autoconf libtool libncurses5
-
Install
groff-base
. If you don’t do this, your compilation will fail becausesoelim
isn’t available:sudo apt-get install groff-base
-
Install Subversion:
sudo apt-get install subversion
-
Checkout the Varnish trunk:
mkdir -p ~/src cd ~/src svn co http://varnish.projects.linpro.no/svn/trunk/varnish-cache
-
Generate
configure
and makefiles:cd ~/src/varnish-cache ./autogen.sh
-
Configure, make, test (this is SVN trunk, after all), install. This step (particularly the tests) will take a while, go make some tea:
./configure && make && make check && sudo make install
-
Tell JeOS where to look for Varnish’s shared libraries. I can’t imagine why the installer doesn’t do this, I’ll assume for the moment that it’s an artifact of building directly from SVN. If you don’t do this, you’ll get errors like “varnishd: error while loading shared libraries: libvarnish.so.1: cannot open shared object file: No such file or directory”:
sudo ldconfig -n /usr/local/lib
-
Go read the Varnish introduction. That’s what I’m doing at the moment… it seems like a good next step. :)