清漆4.0.1,未知的命令:“VCL”,但头上需要命令?

我在Debian Jessie,Varnish 4.0.1上

从varnish 4 Wiki "Starting with Varnish 4.0, each VCL file must start by declaring its version with a special "vcl 4.0;" marker at the top of the file.""Starting with Varnish 4.0, each VCL file must start by declaring its version with a special "vcl 4.0;" marker at the top of the file."

我已经抓住了这个为WordPress的configuration在这里 ,它实际上工作。

但似乎configuration的某些部分失败,一些function不能正常工作,我不能在我的安装上login任何用户。

当我做testing时,代码“ vcl 4.0; ”失败:

 * top 0.0 TEST /etc/varnish/default.vcl starting ---- top 0.0 Unknown command: "vcl" * top 0.0 RESETTING after /etc/varnish/default.vcl * top 0.0 TEST /etc/varnish/default.vcl FAILED 

如果最初的标记失败,并且我在Varnish 4.0.1上,有什么我失踪了?

等一下,你用varnishtesting你的VCL,这不是正确的工具。

varnishtest是一个testing清漆caching的程序,它读取脚本文件来testing服务器(参见man varnishtest)

如果你想在正在运行的varnish中加载你的vcl,请使用varnishadm:

 vcl.load vcl1 /etc/varnish/default.vcl 200 VCL compiled. vcl.list 200 active 0 boot available 0 vcl1 vcl.use vcl1 200 VCL 'vcl1' now active 

或者在启动时使用varnishd的-fparameter passing它。