Varnish 错误:/etc/init.d/varnish: 50: /etc/default/varnish: -p: 未找到

Varnish 错误:/etc/init.d/varnish: 50: /etc/default/varnish: -p: 未找到

我已经在 Ubuntu 12.04 x64 上安装了 Varnish,并想将它与我的 Magento 商店一起使用。

信息:

  • Magento 1.9.0.1
  • Varnish 缓存 3.0.5
  • Magento 松节油 0.6.0

我已经关注安装说明对于 Magento Turpentine,第 2 点内容如下:

你需要使用以下命令启动 Varnish:-p esi_syntax=0x2 option

/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.

是什么原因造成的?如何解决?

答案1

您添加了一个新选项,但忘记将结束的引号移至最后一个选项的末尾。

因此检查

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

相关内容