Difference between revisions of "Varnish"

From ArchWiki
Jump to: navigation, search
m (automatic style fixes)
Line 1: Line 1:
[[Category:Daemons and system services (English)]]
+
[[Category:Daemons and system services]]
 
{{i18n|Varnish}}
 
{{i18n|Varnish}}
  

Revision as of 14:17, 23 April 2012

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Varnish Cache is a web application accelerator also known as a caching HTTP reverse proxy. You install it in front of any server that speaks HTTP and configure it to cache the contents.

Multiple backends

By default, varnish comes configured in /etc/conf.d/varnish to use localhost:8080 as the only backend:

/etc/conf.d/varnish
VARNISHD_OPTS="-a 0.0.0.0:80 \
               -b localhost:8080 \
               -T localhost:6082 \
               -s malloc,64M
               -u nobody -g nobody"

VARNISH_CFG="/etc/varnish/default.vcl"

Also, the VARNISH_CFG file is not loaded on varnish instalation nor service startup. So in case you want multiple backends from a VCL file, you need to edit /etc/varnish/default.vcl with at least one backend and call:

$ /etc/rc.d/varnish reload

Manual VCL load

If the previous VCL configuration reload failed, try loading the VCL file manually:

  1. Connect to the varnish console:
    $ varnishadm -T localhost:6082
  2. Load the default VCL. Make sure it has at least one backend:
    varnish> vcl.load default /etc/varnish/default.vcl
  3. Make it active:
    varnish> vcl.use default
  4. Start the child proccess (optional):
    varnish> start