summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJan Kneschke <jan@kneschke.de>2006-02-16 11:17:39 +0000
committerJan Kneschke <jan@kneschke.de>2006-02-16 11:17:39 +0000
commit87ad66e43f35336ff5d1aee0d8f14642a987cf68 (patch)
tree883a25addedbaefcdf1c060ecbd3076569fafc9a /doc
parentcc7a8ae03a359717a86fb78d7ccc83c51a1c5520 (diff)
downloadlighttpd-git-87ad66e43f35336ff5d1aee0d8f14642a987cf68.tar.gz
added docs about var. and env.
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@1002 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'doc')
-rw-r--r--doc/configuration.txt40
1 files changed, 39 insertions, 1 deletions
diff --git a/doc/configuration.txt b/doc/configuration.txt
index b165817e..b6122f1b 100644
--- a/doc/configuration.txt
+++ b/doc/configuration.txt
@@ -162,8 +162,46 @@ Example
}
}
+Using variables
+===============
+
+You can set your own variables in the configuration to simplify your config.
+::
+
+ var.basedir = "/home/www/servers/"
+ $HTTP["host"] == "www.example.org" {
+ server.name = "www.example.org"
+ include "incl-base.conf"
+ }
+
+ in incl-base.conf:
+ server.document-root = basedir + server.name + "/pages/"
+ accesslog.filename = basedir + server.name + "/logs/access.log"
+
+You can also use environement variables or the default variables var.PID and
+var.CWD: ::
+
+ var.basedir = env.LIGHTTPDBASE
+
+ $HTTP["host"] == "www.example.org" {
+ server.name = "www.example.org"
+ include "incl-base.conf"
+ include "incl-fastcgi.conf"
+ }
+
+ in incl-fastcgi.conf:
+ fastcgi.server = ( ... => ((
+ "socket" => basedir + server.name + "/tmp/fastcgi-" + PID + ".sock"
+ )) )
+
+Or like the lighttpd script for rails does:
+
+ var.basedir = var.CWD
+
+ server.document-root = basedir + "/public/"
+
Global context
-=========================
+==============
::