Ticket #800: lighttpd.conf

File lighttpd.conf, 4.9 kB (added by Le Roux Bodenstein, 2 years ago)

lighttpd configuration file

Line 
1# Debian lighttpd configuration file
2#
3
4############ Options you really have to take care of ####################
5
6## modules to load
7# mod_access, mod_accesslog and mod_alias are loaded by default
8# all other module should only be loaded if neccesary
9# - saves some time
10# - saves memory
11
12server.modules              = (
13            "mod_access",
14            "mod_alias",
15            "mod_accesslog",
16            "mod_rewrite",
17            "mod_redirect",
18            "mod_fastcgi",
19#           "mod_status",
20#           "mod_evhost",
21#           "mod_compress",
22#           "mod_usertrack",
23#           "mod_rrdtool",
24#           "mod_webdav",
25#           "mod_expire",
26#           "mod_flv_streaming",
27#           "mod_evasive"
28 )
29
30## a static document-root, for virtual-hosting take look at the
31## server.virtual-* options
32server.document-root       = "/source/dynamo/webroot/"
33
34## where to send error-messages to
35server.errorlog            = "/var/log/lighttpd/error.log"
36
37## files to check for if .../ is requested
38index-file.names           = ( "index.php", "index.html",
39                               "index.htm", "default.htm" )
40
41
42## Use the "Content-Type" extended attribute to obtain mime type if possible
43# mimetype.use-xattr = "enable"
44
45#### accesslog module
46accesslog.filename         = "/var/log/lighttpd/access.log"
47
48## deny access the file-extensions
49#
50# ~    is for backupfiles from vi, emacs, joe, ...
51# .inc is often used for code includes which should in general not be part
52#      of the document-root
53url.access-deny            = ( "~", ".inc" )
54
55
56
57######### Options that are good to be but not neccesary to be changed #######
58
59## bind to port (default: 80)
60#server.port               = 81
61
62## bind to localhost only (default: all interfaces)
63#server.bind                = "localhost"
64
65## error-handler for status 404
66#server.error-handler-404  = "/error-handler.html"
67#server.error-handler-404  = "/error-handler.php"
68
69## to help the rc.scripts
70server.pid-file            = "/var/run/lighttpd.pid"
71
72##
73## Format: <errorfile-prefix><status>.html
74## -> ..../status-404.html for 'File not found'
75#server.errorfile-prefix    = "/var/www/"
76
77## virtual directory listings
78dir-listing.encoding        = "utf-8"
79server.dir-listing          = "disable"
80
81## send unhandled HTTP-header headers to error-log
82#debug.dump-unknown-headers  = "enable"
83
84### only root can use these options
85#
86# chroot() to directory (default: no chroot() )
87#server.chroot            = "/"
88
89## change uid to <uid> (default: don't care)
90server.username            = "www-data"
91
92## change uid to <uid> (default: don't care)
93server.groupname           = "www-data"
94
95#### compress module
96#compress.cache-dir          = "/var/tmp/lighttpd/cache/compress/"
97#compress.filetype           = ("text/plain", "text/html")
98
99#### status module
100# status.status-url = "/server-status"
101# status.config-url = "/server-config"
102
103#### url handling modules (rewrite, redirect, access)
104# url.rewrite                 = ( "^/$"             => "/server-status" )
105# url.redirect                = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
106
107#
108# define a pattern for the host url finding
109# %% => % sign
110# %0 => domain name + tld
111# %1 => tld
112# %2 => domain name without tld
113# %3 => subdomain 1 name
114# %4 => subdomain 2 name
115#
116# evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/"
117
118#### expire module
119# expire.url                  = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
120
121#### rrdtool
122# rrdtool.binary = "/usr/bin/rrdtool"
123# rrdtool.db-name = "/var/www/lighttpd.rrd"
124
125## this is a hack
126alias.url = ("___invalid___" => "___invalid___")
127
128#### handle Debian Policy Manual, Section 11.5. urls
129#### and by default allow them only from localhost
130
131#$HTTP["host"] == "localhost" {
132#       global {
133#               alias.url += (
134#                       "/doc/" => "/usr/share/doc/",
135#                       "/images/" => "/usr/share/images/"
136#               )
137#       }
138#       dir-listing.activate = "enable"
139#}
140
141fastcgi.server = (
142  "/main.fcgi" => (
143    "main" => (
144      "socket" => "/tmp/dynamo.socket",
145      "check-local" => "disable",
146    )
147  )
148)
149
150url.rewrite-once = (
151    #"^(/files/.*)$" => "/media/%0$1",
152    "^/(css/.*)$" => "/media/%0/$1",
153    #"^(/images/.*)$" => "/media/%0$1",
154    #"^(/js/.*)$" => "/media/%0$1",
155    #"^(/flash/.*)$" => "/media/%0$1",
156    #"^(/cache/.*)$" => "/media/%0$1",
157    #"^(.*)$" => "/main.fcgi$1",
158)
159#server.error-handler-404 = "/main.fcgi"
160
161#### variable usage:
162## variable name without "." is auto prefixed by "var." and becomes "var.bar"
163#bar = 1
164#var.mystring = "foo"
165
166## integer add
167#bar += 1
168## string concat, with integer cast as string, result: "www.foo1.com"
169#server.name = "www." + mystring + var.bar + ".com"
170## array merge
171#index-file.names = (foo + ".php") + index-file.names
172#index-file.names += (foo + ".php")
173
174
175#### external configuration files
176## mimetype mapping
177include_shell "/usr/share/lighttpd/create-mime.assign.pl"
178
179## load enabled configuration files,
180## read /etc/lighttpd/conf-available/README first
181#include_shell "/usr/share/lighttpd/include-conf-enabled.pl"