Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to install an additional module for Varnish Cache, the Shield module.

How can I do that? I installed Varnish 3.0 from the Ubuntu repositories.

How do I get the Varnish source which the module needs to compile? Do I need to compile Varnish from source as well? Does this disable updating Varnish through the repositories?

Can someone give a step-by-step instruction?

share|improve this question
1  
This is a helpful question, upvoted. –  amateur barista Aug 9 '12 at 18:44

2 Answers 2

up vote 6 down vote accepted

You can get the source packages with

apt-get source varnish

It looks like the module only requires the varnish sources for the header files so you don't need to compile varnish. You should be ok to continue updating varnish from the reops although when you upgrade the main package be prepared to download the source and rebuild the module.

If you downloaded the module source to your $HOME/libvmod-shield and the varnish is in $HOME/varnish-3.0.2 then

cd $HOME/libvmod-shield
./configure VARNISHSRC=$HOME/varnish-3.0.2
make 
sudo make install
sudo make check

or something similar should get you going.

share|improve this answer
    
Thanks! Very nice. –  Tobe Jul 14 '12 at 18:06
2  
I had to build the Varnish source first, then I had to also specify the module directory like ./configure VARNISHSRC=/usr/local/src/varnish-3.0.0 VMODDIR=/usr/lib/varnish/vmods –  Tobe Jul 14 '12 at 18:09
    
@Tobe : I'm facing a similar problem. Could you please tell me how I can build safely. I fear that building would mess with the varnish, as it is already installed. Thanks –  naka Oct 12 '13 at 12:46
    
Take a backup of your configuration-files, then you can restore Varnish from the repositories if something goes wrong. But it should be pretty safe to install. Try following Ians suggestion, other than that I can't help you. –  Tobe Oct 12 '13 at 17:19
    
I was not able to get varnish source using apt-get source varnish. I used git for getting source. I have written a blog post about the steps for installing varnish module poovelil.org/installing-varnish-module-in-ubuntu –  robert Nov 15 '13 at 1:17

I know you asked about how to do this on Ubuntu, but this answer comes up in searches. :)

On CentOS (or other RHEL-based systems), you want to do something like this:

rpm -i "http://example.com/varnish.src.rpm"
rpmbuild -bc /usr/src/redhat/SPECS/varnish.spec

cd libvmod-foo
./configure VARNISHSRC=/usr/src/redhat/BUILD/varnish-$VERSION
make
make install
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.