Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been following this guide which uses this default.vcl. However, when starting Varnish I get the following error:

 * Starting HTTP accelerator                                                                                                                                                                                                                                           [fail] 
storage_malloc: max size 1024 MB.
Message from VCC-compiler:
Expected '(' got ';'
(program line 341), at
(input Line 43 Pos 22)
Running VCC-compiler failed, exit 1
VCL compilation failed

Which means that there is something wrong with purge here:

sub vcl_hit {
        if (req.request == "PURGE") {
                error 200 "Purged.";

I don't see anything wrong, can someone explain?


share|improve this question
Can you please post the complete config file? – Paul Apr 7 '12 at 14:34
Hi Paul, you can find it here:… – FLX Apr 7 '12 at 14:50
What version of Varnish are you running (varnishd -V)? purge is only available in Varnish 3. In Varnish 2.x the equivalent was set obj.ttl = 0s; – cyberx86 Apr 7 '12 at 15:47
Ah, that was it, I installed Varnish 3 from now :) – FLX Apr 7 '12 at 16:13
up vote 2 down vote accepted

The code block you have used is perfectly valid - in fact I use a nearly identical one with my Varnish setup (and I presume many others do as well).

As the error suggests there is a problem with purge. Since purge was only introduced in Varnish 3.x, if you are using a prior version of Varnish (2.x) the command will be unrecognised, and compilation will fail. You can determine your version of Varnish by running varnishd -V.

If you are using a previous version of Varnish, and are unable to upgrade, the equivalent command is set obj.ttl = 0s;.

Varnish maintains up-to-date repositories for Ubuntu/Debian and RHEL/CentOS distributions on their download page.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.