From: petter Date: Wed, 6 Aug 2008 12:10:02 +0000 (+0000) Subject: Updated the man page for vcl to include the default bin/varnishd/default.vcl so it... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=558024752c982b788cb0f047f14b1792454e1a8c;p=varnish Updated the man page for vcl to include the default bin/varnishd/default.vcl so it is easier kept in sync. Same goes for etc/default.vcl, which now is generated from the same bin/varnishd/default.vcl. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3065 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/etc/Makefile.am b/varnish-cache/etc/Makefile.am index daf6bea4..ee6f6d72 100644 --- a/varnish-cache/etc/Makefile.am +++ b/varnish-cache/etc/Makefile.am @@ -1,3 +1,24 @@ # $Id$ -EXTRA_DIST = default.vcl zope-plone.vcl +EXTRA_DIST = zope-plone.vcl + +dist_data_DATA = default.vcl + +default.vcl: + echo -e "This is a basic VCL configuration file for varnish. See the vcl(7)\n\ +man page for details on VCL syntax and semantics.\n\ +\n\ +Default backend definition. Set this to point to your content\n\ +server.\n\ +\n\ +backend default {\n\ + .host = "127.0.0.1";\n\ + .port = "8080";\n\ +}\n\ +\n\ +Below is a commented-out copy of the default VCL logic. If you\n\ +redefine any of these subroutines, the built-in logic will be\n\ +appended to your code.\n" > tmp.vcl + sed -n '/vcl_recv/,$$p' ../bin/varnishd/default.vcl >> tmp.vcl + sed 's/^\(.*\)$$/#\1/' tmp.vcl > default.vcl + rm tmp.vcl diff --git a/varnish-cache/etc/default.vcl b/varnish-cache/etc/default.vcl deleted file mode 100644 index a61135f8..00000000 --- a/varnish-cache/etc/default.vcl +++ /dev/null @@ -1,115 +0,0 @@ -# -# This is a basic VCL configuration file for varnish. See the vcl(7) -# man page for details on VCL syntax and semantics. -# -# $Id$ -# - -# Default backend definition. Set this to point to your content -# server. - -backend default { - .host = "127.0.0.1"; - .port = "8080"; -} - -# Below is a commented-out copy of the default VCL logic. If you -# redefine any of these subroutines, the built-in logic will be -# appended to your code. - -## Called when a client request is received -# -#sub vcl_recv { -# if (req.request != "GET" && -# req.request != "HEAD" && -# req.request != "PUT" && -# req.request != "POST" && -# req.request != "TRACE" && -# req.request != "OPTIONS" && -# req.request != "DELETE") { -# pipe; -# } -# if (req.http.Expect) { -# pipe; -# } -# if (req.request != "GET" && req.request != "HEAD") { -# pass; -# } -# if (req.http.Authorization || req.http.Cookie) { -# pass; -# } -# lookup; -#} -# -## Called when entering pipe mode -# -#sub vcl_pipe { -# pipe; -#} -# -## Called when entering pass mode -# -#sub vcl_pass { -# pass; -#} -# -## Called when entering an object into the cache -# -#sub vcl_hash { -# set req.hash += req.url; -# if (req.http.host) { -# set req.hash += req.http.host; -# } else { -# set req.hash += server.ip; -# } -# hash; -#} -# -## Called when the requested object was found in the cache -# -#sub vcl_hit { -# if (!obj.cacheable) { -# pass; -# } -# deliver; -#} -# -## Called when the requested object was not found in the cache -# -#sub vcl_miss { -# fetch; -#} -# -## Called when the requested object has been retrieved from the -## backend, or the request to the backend has failed -# -#sub vcl_fetch { -# if (!obj.valid) { -# error obj.status; -# } -# if (!obj.cacheable) { -# pass; -# } -# if (obj.http.Set-Cookie) { -# pass; -# } -# set obj.prefetch = -30s; insert; -#} -# -## Called before a cached object is delivered to the client -# -#sub vcl_deliver { -# deliver; -#} -# -## Called when an object nears its expiry time -# -#sub vcl_timeout { -# discard; -#} -# -# Called when an object is about to be discarded -# -#sub vcl_discard { -# discard; -#} diff --git a/varnish-cache/man/Makefile.am b/varnish-cache/man/Makefile.am index ca8d5377..e532b16f 100644 --- a/varnish-cache/man/Makefile.am +++ b/varnish-cache/man/Makefile.am @@ -1,3 +1,8 @@ # $Id$ dist_man_MANS = vcl.7 + +vcl.7: vcl.7so default.vcl + soelim $< > $@ +default.vcl: ../bin/varnishd/default.vcl + sed -n '/vcl_recv/,$$w $@' $< diff --git a/varnish-cache/man/vcl.7 b/varnish-cache/man/vcl.7so similarity index 93% rename from varnish-cache/man/vcl.7 rename to varnish-cache/man/vcl.7so index c9c1ef8d..b34b3bad 100644 --- a/varnish-cache/man/vcl.7 +++ b/varnish-cache/man/vcl.7so @@ -506,81 +506,7 @@ backend default { set backend.port = "http"; } -sub vcl_recv { - if (req.request != "GET" && - req.request != "HEAD" && - req.request != "PUT" && - req.request != "POST" && - req.request != "TRACE" && - req.request != "OPTIONS" && - req.request != "DELETE") { - pipe; - } - if (req.http.Expect) { - pipe; - } - if (req.request != "GET" && req.request != "HEAD") { - pass; - } - if (req.http.Authorization || req.http.Cookie) { - pass; - } - lookup; -} - -sub vcl_pipe { - pipe; -} - -sub vcl_pass { - pass; -} - -sub vcl_hash { - set req.hash += req.url; - if (req.http.host) { - set req.hash += req.http.host; - } else { - set req.hash += server.ip; - } - hash; -} - -sub vcl_hit { - if (!obj.cacheable) { - pass; - } - deliver; -} - -sub vcl_miss { - fetch; -} - -sub vcl_fetch { - if (!obj.valid) { - error obj.status; - } - if (!obj.cacheable) { - pass; - } - if (obj.http.Set-Cookie) { - pass; - } - set obj.prefetch = -30s; insert; -} - -sub vcl_deliver { - deliver; -} - -sub vcl_discard { - discard; -} - -sub vcl_timeout { - discard; -} +.so default.vcl .Ed .Pp The following example shows how to support multiple sites running on