我已经在Ubuntu 12.04 x64上安装了Varnish,并且想要在我的Magento商店中使用它。
信息:
我遵循了Magento松节油的安装说明 ,第2点的内容如下:
您需要使用
-p esi_syntax=0x2 option启动Varnish
这是我的/etc/default/varnish文件的样子:
# Configuration file for varnish START=yes NFILES=131072 MEMLOCK=82000 DAEMON_OPTS="-a :80 \ -T localhost:6082 \ -f /etc/varnish/default.vcl \ -S /etc/varnish/secret \ -s malloc,256m" \ -p esi_syntax=0x2
当做sudo service varnish restart我得到
/etc/init.d/varnish: 50: /etc/default/varnish: -p: not found /etc/init.d/varnish: 50: /etc/default/varnish: -p: not found * Stopping HTTP accelerator varnishd ...done. /etc/init.d/varnish: 50: /etc/default/varnish: -p: not found * Starting HTTP accelerator varnishd ...done.
这是什么原因造成的?我该如何解决?
您添加了一个新选项,但忘记将结束引号移到最后一个选项的末尾。
所以检查
DAEMON_OPTS="-a :80 \ -T localhost:6082 \ -f /etc/varnish/default.vcl \ -S /etc/varnish/secret \ -s malloc,256m" \ # <<< Currently here -p esi_syntax=0x2
它应该看起来像这样
DAEMON_OPTS="-a :80 \ -T localhost:6082 \ -f /etc/varnish/default.vcl \ -S /etc/varnish/secret \ -s malloc,256m \ -p esi_syntax=0x2" # <<< Should be here