0

我一直在尝试在我的服务器上设置清漆缓存一个小时,但我似乎无法弄清楚为什么会出现此错误:

$ sudo varnishd -C -f /etc/default/varnish
Error:
Message from VCC-compiler:
Unterminated string at
('/etc/default/varnish' Line 21 Pos 13)
DAEMON_OPTS="-a :6081 \
------------###########

Running VCC-compiler failed, exited with 2
VCL compilation failed

我正在使用全新安装的清漆的默认配置。这是我完整的 /etc/default/varnish:

# Should we start varnishd at boot?  Set to "no" to disable.
START=yes

# Maximum number of open files (for ulimit -n)
NFILES=131072

# Maximum locked memory size (for ulimit -l)
# Used for locking the shared memory log in memory.  If you increase log size,
# you need to increase this number as well
MEMLOCK=82000

DAEMON_OPTS="-a :6081 \
             -T localhost:6082 \
             -f /etc/varnish/default.vcl \
             -S /etc/varnish/secret \
             -s malloc,256m"

任何帮助将不胜感激!如果您需要更多详细信息,请告诉我。

4

1 回答 1

0

varnishd -C 用于编译(如在 C 语言中编译)一个 vcl 文件。您只编译 vcl 文件而不是配置文件。您的文件不必特别以 .vcl 扩展名结尾,但它必须采用 vcl 语法: Varnish VCL 文档

于 2016-04-21T22:08:54.383 回答