0

I've been trying to setup varnish cache on my server for a good hour now but I can't seem to figure out why I'm getting this error:

$ 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

I'm using the default configuration from a clean install of varnish. Here's my full /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"

Any help would be greatly appreciated! If you need more details, let me know.

1 Answers1

0

varnishd -C is used to compile (as in C language compile) a vcl file. You only compile vcl files not the config file. Your file does not have to specifically end with a .vcl extension but it does have to be in vcl syntax: Varnish VCL documentation

Ray Jennings
  • 336
  • 2
  • 10
  • You would typically only use varnishd -C to check that your vcl file has correct syntax. Like any other computer program, checking syntax is one thing, testing it something else. – Ray Jennings Apr 21 '16 at 22:12
  • Indeed, I was using varnishd -C to verify for syntax errors only. I'm still having the same issue. – Marc Boisvert Apr 24 '16 at 09:43
  • But you are trying to compile config settings and not a VCL file - that is never going to work. You are using the wrong tool. – Ray Jennings Apr 27 '16 at 19:17