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 import std; and do some std.syslog. However, when I restart varnish, the VCC compiler fails:

$ sudo service varnish restart
 * Stopping HTTP accelerator varnishd                                [ OK ] 
 * Starting HTTP accelerator varnishd                                [fail] 
SMA.s0: max size 2048 MB.
Message from VCC-compiler:
Could not load module std
        /usr/lib/varnish/vmods/libvmod_std.so
        /usr/lib/varnish/vmods/libvmod_std.so: cannot open shared object file: No such file or directory
('input' Line 15 Pos 8)
import std;
-------###-

Running VCC-compiler failed, exit 1

VCL compilation failed

I'm running Ubuntu 11.10 and my varnish version:

$ varnishd -V
varnishd (varnish-3.0.0 revision cbf1284)
Copyright (c) 2006 Verdens Gang AS
Copyright (c) 2006-2011 Varnish Software AS

Isn't std a built-in VMOD? How can I solve this? Thanks.


UPDATE: I managed to upgrade Varnish to 3.0.3 by following the instructions on their official website. However, I still don't understand why std is not there in 3.0.0.

share|improve this question
add comment

3 Answers 3

Download the latest source version 3.0.3 of Varnish and compile it. After installing, locate libvmod_std.so to confirm that this module is also installed. Then you can start the varnish to check it with your new vcl with import std;. For debugging you can add -d -d option in the varnish startup defaults in file /etc/default/varnish. Check man vmod_std for more detail on varnish standard module. It is working fine for me for this version.

Installation by default put the vcl file under /usr/local/etc/varnish and binaries under /usr/local/bin/varnish* and varnishd can be found in /usr/bin/. You need to change the following in the init.d startup file /etc/init.d/varnish because it is different from the installation by apt-get.

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/sbin/varnishd

Also change the vcl file path in the /etc/default/varnish like

-f /usr/local/etc/varnish/default.vcl

Now, you should be able to start and stop the newly compiled varnish like you used varnish installed via apt-get.

share|improve this answer
    
Will self-compiled version works seamlessly with Ubuntu? Since I have already installed Varnish through apt-get, I'm afraid something will be broken. –  Xiao Jia Jan 2 '13 at 6:02
    
Yes it will work seamlessly as I am using it too. Just remove the varnish with apt-get remove varnish before compiling it. Compilation is pretty standard. You just need to follow the step mentioned in the documentation. –  Somesh Jan 2 '13 at 6:15
    
Thanks for your reply. Can I let the compiled varnish take over the apt-get one, so that my service will not be interrupt? –  Xiao Jia Jan 2 '13 at 7:05
add comment

Can you please upgrade your varnish on your machine with this command:

aptitude upgrade varnish

It should fix the problem. If not, please comment and will try to find some other fix.

share|improve this answer
    
Cannot upgrade it in this way. I'm running Ubuntu 11.10 so I suppose 3.0.0 is the latest version in the repository. –  Xiao Jia Jan 2 '13 at 9:27
add comment

I finally managed to upgrade Varnish to 3.0.3 by following the instructions on the official website: https://www.varnish-cache.org/installation/ubuntu

To use the varnish-cache.org repository, do the following

  1. curl http://repo.varnish-cache.org/debian/GPG-key.txt | sudo apt-key add -
  2. echo "deb http://repo.varnish-cache.org/ubuntu/ lucid varnish-3.0" | sudo tee -a /etc/apt/sources.list
  3. sudo apt-get update
  4. sudo apt-get install varnish

They only provide packages for Ubuntu's LTS releases, not all the intermediate releases. So it says lucid but works fine with oneric (11.10).

After upgrading Varnish to 3.0.3, I can sudo service varnish reload and import std; works fine now.

share|improve this answer
add comment

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.