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
svn/tags/lighttpd-1.4.11
Jan Kneschke 2006-02-16 11:17:39 +00:00
parent cc7a8ae03a
commit 87ad66e43f
1 changed files with 39 additions and 1 deletions

View File

@ -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
=========================
==============
::