无法在Ubuntu 11.10下的Varnish 3.0.0中使用vmod std

我想import std; 并做一些std.syslog 。 但是,当我重新启动清漆时,VCC编译器将失败:

 $ 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 

我正在运行Ubuntu 11.10和我的清漆版本:

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

不是std的内置VMOD? 我该如何解决这个问题? 谢谢。


更新:我设法升级清漆3.0.3按照其官方网站上的说明。 不过,我还是不明白为什么std在3.0.0中不存在。

下载Varnish的最新源代码版本3.0.3并编译它 。 安装后, locate libvmod_std.so以确认该模块也已安装。 然后你可以启动清漆,检查你的新的VCL与import std; 。 对于debugging,可以在/etc/default/varnish文件中的varnish启动默认值中添加-d -d选项。 请查看man vmod_std了解更多关于清漆标准模块的详细信息。 这个版本对我来说工作得很好。

默认情况下安装在/usr/local/etc/varnish下的vcl文件和/usr/local/bin/varnish*下的二进制文件,varnishd可以在/usr/bin/ 。 您需要在init.d启动文件/etc/init.d/varnish更改以下内容,因为它与apt-get的安装不同。

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

还要改变/etc/default/varnish的vcl文件path

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

现在,你应该能够启动和停止新编译的清漆,就像使用apt-get安装的清漆一样。

你可以用这个命令在你的机器上升级你的清漆:

 aptitude upgrade varnish 

它应该解决这个问题。 如果没有,请评论,并尝试find一些其他的修复。

我最终设法按照官方网站上的说明将Varnish升级到3.0.3: https : //www.varnish-cache.org/installation/ubuntu

要使用varnish-cache.org存储库,请执行以下操作

  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

他们只为Ubuntu的LTS版本提供软件包,而不是所有的中间版本。 所以它说lucid但工作得很好(11.10)。

将Varnish升级到3.0.3后,我可以sudo service varnish reloadimport std; 现在工作正常。