Tag Archives: varnish

Varnish with Apache on Ubuntu 16.04

1.
In
/lib/systemd/system/varnish.service
and
/etc/default/varnish
set port to 80:

ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m

and

DAEMON_OPTS="-a :80 \

2.
In
/etc/varnish/default.vcl
point to port 8080, where Apache will be serving content:

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

3.
Finally, change Apache’s default port 80 to 8080, in
/etc/apache2/sites-enabled/mysite.conf

To test:

GET -Used http://siteaddress.com