Building a Varnish VMOD

Building a Varnish VMOD in ubuntu is bit complicated process. we are going to use varnish-3.0.5. For VMOD we are going to use https://github.com/varnish/libvmod-shield.

Lets create a folder and get the varnish’s source code.

mkdir varnish
cd varnish
apt-get source varnish 

Then we will create a make file from the source

cd varnish-3.0.5
./autogen.sh
./configure
make 

Then we will get code from https://github.com/varnish/libvmod-shield and install the VMOD

cd ..
git clone https://github.com/varnish/libvmod-shield.git 
cd libvmod-shield/
./autogen.sh 
./configure VARNISHSRC=../varnish-3.0.5
make
make install

This will install VMOD shield.

If you see the following error

/usr/lib/x86_64-linux-gnu/varnish/vmods/libvmod_shield.so: 
cannot open shared object file: No such file or directory

then you need to symlink the VMOD in the /usr/local/lib/varnish/vmods/ to /usr/lib/x86_64-linux-gnu/varnish/vmods/libvmod_shield.so

ln -s /usr/local/lib/varnish/vmods/libvmod_shield.so /usr/lib/x86_64-linux-gnu/varnish/vmods/libvmod_shield.so

Now you can use shield in you vcl.

import shield

About Zakir Hyder

This entry was written by .

28. September 2014 by Zakir Hyder
Categories: Linux, Ubuntu, Varnish | Tags: , , , , , , | Comments

Comments

  1. […] Building a Varnish VMOD in ubuntu is bit complicated process. we are going to use varnish-3.0.5. For VMOD we are going to use https://github.com/varnish/libvmod-shield. Lets create a folder and get the varnish's source code. Then we will create a make…  […]

  2. […] Varnish can add a extra layer of security as well as HTTP accelerator. https://github.com/comotion/VSF is a Web Application Firewall (WAF) written using the Varnish Control Language (VCL) and a sprinkling of Varnish Modules (vmods). If you want to know how to install vmod go to http://blog.jambura.com/2014/09/28/building-a-varnish-vmod/ […]