Varnish + FreeBSD + Cpanel

Vasile Cristescu vasile at cristescu.org
Thu Dec 2 11:31:15 CET 2010


Hello,

I have a FreeBSD box (7.2-RELEASE) on which I use Cpanel (WHM 11.26.20) to 
manage the domains. I'm trying to install Varnish (from ports) in front of 
Apache (Server version: Apache/2.2.13 Server built:   Oct 12 2009 12:20:31
Cpanel::Easy::Apache v3.2.0 rev4793 ).

I have change the port apache listens on to *:8080, and edited default.acl as 
following:

 backend default {
     .host = "127.0.0.1";
     .port = "8080";
 }

sub vcl_recv {
     if (req.http.x-forwarded-for) {
        set req.http.X-Forwarded-For =
            req.http.X-Forwarded-For ", " client.ip;
     } else {
        set req.http.X-Forwarded-For = client.ip;
     }
     if (req.request != "GET" &&
       req.request != "HEAD" &&
       req.request != "PUT" &&
       req.request != "POST" &&
       req.request != "TRACE" &&
       req.request != "OPTIONS" &&
       req.request != "DELETE") {
         /* Non-RFC2616 or CONNECT which is weird. */
         return (pipe);
     }
     if (req.request != "GET" && req.request != "HEAD") {
         /* We only deal with GET and HEAD by default */
         return (pass);
     }
     if (req.http.Authorization || req.http.Cookie) {
         /* Not cacheable by default */
         return (pass);
     }
     return (lookup);
 }

I've restarted apache, started varnishd, but when I try to access a domain I 
get the default cpanel apache index (welcome to cpanel .. etc).

Does anyone have any idea what am I doing wrong ? 

-- 
Best Regards,
Vasile Cristescu




More information about the varnish-misc mailing list