Steps I've done to setup Varnish:
-
Install Varnish (with varnish modules) on Debian9 (using commands from: https://github.com/ezsystems/ezplatform-http-cache/blob/v0.4.0/docs/varnish/varnish.md)
varnish is already the newest version (5.0.0-7+deb9u2).
varnish-modules is already the newest version (0.9.1-4).
-
Change Varnish to use 80 port: (I've used a mix of: http://varnish-cache.org/docs/trunk/tutorial/putting_varnish_on_port_80.html and https://stackoverflow.com/questions/40867749/varnish-wont-start-as-a-daemon with
-j none
for now) -
Use our vcl files: https://github.com/ezsystems/ezplatform-http-cache/tree/master/docs/varnish/vcl
-
Change parameters to point to my environment:
backend ezplatform {
.host = "sd.local";
.port = "80";
}
(with additional hosts entry added: 192.168.33.1 sd.local
so that the domain is resolved correctly)
- ezplatform.yml changes:
purge_type: 'http' (in http_cache section)
purge_servers: ['http://192.168.33.15:80'] (defined for main siteaccess group in http_cache section)
(as in https://doc.ezplatform.com/en/2.0/guide/http_cache/#update-yml-configuration)
- Apache changes:
SetEnv SYMFONY_HTTP_CACHE 0
SetEnv SYMFONY_TRUSTED_PROXIES "192.168.33.15"
(IP of the varnish instance)
(as described here: https://doc.ezplatform.com/en/2.0/guide/http_cache/#configure-ez-publish)
- Env cache cleared