Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 340 lines (285 sloc) 12.215 kb
d8704fc @wangmh first commit
authored
1 # lighttpd configurtion file
2 #
3 # use it as a base for lighttpd 1.0.0 and above
4 #
5 # $Id: lighttpd.conf,v 1.7 2004/11/03 22:26:05 weigon Exp $
6
7 ############ Options you really have to take care of ####################
8
9 ## modules to load
10 # at least mod_access and mod_accesslog should be loaded
11 # all other module should only be loaded if really neccesary
12 # - saves some time
13 # - saves memory
14 server.modules = (
15 "mod_rewrite",
16 "mod_redirect",
17 # "mod_alias",
18 "mod_access",
19 # "mod_cml",
20 # "mod_trigger_b4_dl",
21 # "mod_auth",
22 "mod_status",
23 # "mod_setenv",
24 # "mod_fastcgi",
25 "mod_fastdfs",
26 "mod_proxy",
27 # "mod_simple_vhost",
28 # "mod_evhost",
29 # "mod_userdir",
30 # "mod_cgi",
31 # "mod_compress",
32
33 "mod_ssi",
34 # "mod_usertrack",
35 # "mod_expire",
36 # "mod_secdownload",
37 # "mod_rrdtool",
38 "mod_accesslog" )
39
40 ## a static document-root, for virtual-hosting take look at the
41 ## server.virtual-* options
42 server.document-root = "/home/saint/lighttpd1/www"
43
44 ## where to send error-messages to
45 server.errorlog = "/home/saint/lighttpd1/log/error.log"
46
47 # files to check for if .../ is requested
48 index-file.names = ( "index.php", "index.html",
49 "index.htm", "default.htm" )
50
51 ## set the event-handler (read the performance section in the manual)
52 # server.event-handler = "freebsd-kqueue" # needed on OS X
53
54 # mimetype mapping
55 mimetype.assign = (
56 ".pdf" => "application/pdf",
57 ".sig" => "application/pgp-signature",
58 ".spl" => "application/futuresplash",
59 ".class" => "application/octet-stream",
60 ".ps" => "application/postscript",
61 ".torrent" => "application/x-bittorrent",
62 ".dvi" => "application/x-dvi",
63 ".gz" => "application/x-gzip",
64 ".pac" => "application/x-ns-proxy-autoconfig",
65 ".swf" => "application/x-shockwave-flash",
66 ".tar.gz" => "application/x-tgz",
67 ".tgz" => "application/x-tgz",
68 ".tar" => "application/x-tar",
69 ".zip" => "application/zip",
70 ".mp3" => "audio/mpeg",
71 ".m3u" => "audio/x-mpegurl",
72 ".wma" => "audio/x-ms-wma",
73 ".wax" => "audio/x-ms-wax",
74 ".ogg" => "application/ogg",
75 ".wav" => "audio/x-wav",
76 ".gif" => "image/gif",
77 ".jar" => "application/x-java-archive",
78 ".jpg" => "image/jpeg",
79 ".jpeg" => "image/jpg",
80 ".png" => "image/png",
81 ".xbm" => "image/x-xbitmap",
82 ".xpm" => "image/x-xpixmap",
83 ".xwd" => "image/x-xwindowdump",
84 ".css" => "text/css",
85 ".html" => "text/html",
86 ".htm" => "text/html",
87 ".js" => "text/javascript",
88 ".asc" => "text/plain",
89 ".c" => "text/plain",
90 ".cpp" => "text/plain",
91 ".log" => "text/plain",
92 ".conf" => "text/plain",
93 ".text" => "text/plain",
94 ".txt" => "text/plain",
95 ".dtd" => "text/xml",
96 ".xml" => "text/xml",
97 ".mpeg" => "video/mpeg",
98 ".mpg" => "video/mpeg",
99 ".mov" => "video/quicktime",
100 ".qt" => "video/quicktime",
101 ".avi" => "video/x-msvideo",
102 ".asf" => "video/x-ms-asf",
103 ".asx" => "video/x-ms-asf",
104 ".wmv" => "video/x-ms-wmv",
105 ".bz2" => "application/x-bzip",
106 ".tbz" => "application/x-bzip-compressed-tar",
107 ".tar.bz2" => "application/x-bzip-compressed-tar",
108 # default mime type
109 "" => "application/octet-stream",
110 )
111
112
113 fastdfs.covert-filetypes = (".gif", ".jpeg", ".jpg" ,".png")
114
115 fastdfs.conf = "/etc/fdfs/client.conf"
116 # filesize * any size.
117 fastdfs.covert-filesize = ("*", "_100_100", "_105_105")
118 fastdfs.covert-enable = "enable"
119
120 # Use the "Content-Type" extended attribute to obtain mime type if possible
121 #mimetype.use-xattr = "enable"
122
123
124 ## send a different Server: header
125 ## be nice and keep it at lighttpd
126 # server.tag = "lighttpd"
127
128 #### accesslog module
129 accesslog.filename = "/home/saint/lighttpd1/log/access.log"
130
131 ## deny access the file-extensions
132 #
133 # ~ is for backupfiles from vi, emacs, joe, ...
134 # .inc is often used for code includes which should in general not be part
135 # of the document-root
136 url.access-deny = ( "~", ".inc" )
137
138 $HTTP["url"] =~ "\.pdf$" {
139 server.range-requests = "disable"
140 }
141
142
143 ##
144 # which extensions should not be handle via static-file transfer
145 #
146 # .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
147 static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
148
149 ######### Options that are good to be but not neccesary to be changed #######
150
151 ## bind to port (default: 80)
152 server.port = 8000
153
154 ## bind to localhost (default: all interfaces)
155 #server.bind = "192.168.2.163"
156
157 ## error-handler for status 404
158 #server.error-handler-404 = "/error-handler.html"
159 #server.error-handler-404 = "/error-handler.php"
160
161 ## to help the rc.scripts
162 #server.pid-file = "/var/run/lighttpd.pid"
163
164
165 ###### virtual hosts
166 ##
167 ## If you want name-based virtual hosting add the next three settings and load
168 ## mod_simple_vhost
169 ##
170 ## document-root =
171 ## virtual-server-root + virtual-server-default-host + virtual-server-docroot
172 ## or
173 ## virtual-server-root + http-host + virtual-server-docroot
174 ##
175 #simple-vhost.server-root = "/srv/www/vhosts/"
176 #simple-vhost.default-host = "www.example.org"
177 #simple-vhost.document-root = "/htdocs/"
178
179
180 ##
181 ## Format: <errorfile-prefix><status-code>.html
182 ## -> ..../status-404.html for 'File not found'
183 #server.errorfile-prefix = "/usr/share/lighttpd/errors/status-"
184 #server.errorfile-prefix = "/srv/www/errors/status-"
185
186 ## virtual directory listings
187 #dir-listing.activate = "enable"
188 ## select encoding for directory listings
189 #dir-listing.encoding = "utf-8"
190
191 ## enable debugging
192 debug.log-request-header = "enable"
193 debug.log-response-header = "enable"
194 debug.log-request-handling = "enable"
195 debug.log-file-not-found = "enable"
196
197 ### only root can use these options
198 #
199 # chroot() to directory (default: no chroot() )
200 #server.chroot = "/"
201
202 ## change uid to <uid> (default: don't care)
203 #server.username = "wwwrun"
204
205 ## change uid to <uid> (default: don't care)
206 #server.groupname = "wwwrun"
207
208 #### compress module
209 #compress.cache-dir = "/var/cache/lighttpd/compress/"
210 #compress.filetype = ("text/plain", "text/html")
211
212 #### proxy module
213 ## read proxy.txt for more info
214 #proxy.server = ( ".php" =>
215 # ( "localhost" =>
216 # (
217 # "host" => "192.168.0.101",
218 # "port" => 80
219 # )
220 # )
221 # )
222
223 #### fastcgi module
224 ## read fastcgi.txt for more info
225 ## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
226 #fastcgi.server = ( ".php" =>
227 # ( "localhost" =>
228 # (
229 # "socket" => "/var/run/lighttpd/php-fastcgi.socket",
230 # "bin-path" => "/usr/local/bin/php-cgi"
231 # )
232 # )
233 # )
234
235 #### CGI module
236 #cgi.assign = ( ".pl" => "/usr/bin/perl",
237 # ".cgi" => "/usr/bin/perl" )
238 #
239
240 #### SSL engine
241 #ssl.engine = "enable"
242 #ssl.pemfile = "/etc/ssl/private/lighttpd.pem"
243
244 #### status module
245 status.status-url = "/server-status"
246 status.config-url = "/server-config"
247
248 #### auth module
249 ## read authentication.txt for more info
250 #auth.backend = "plain"
251 #auth.backend.plain.userfile = "lighttpd.user"
252 #auth.backend.plain.groupfile = "lighttpd.group"
253
254 #auth.backend.ldap.hostname = "localhost"
255 #auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
256 #auth.backend.ldap.filter = "(uid=$)"
257
258 #auth.require = ( "/server-status" =>
259 # (
260 # "method" => "digest",
261 # "realm" => "download archiv",
262 # "require" => "user=jan"
263 # ),
264 # "/server-config" =>
265 # (
266 # "method" => "digest",
267 # "realm" => "download archiv",
268 # "require" => "valid-user"
269 # )
270 # )
271
272 #### url handling modules (rewrite, redirect, access)
273 #url.rewrite = ( "^/$" => "/server-status" )
274 #url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
275 #### both rewrite/redirect support back reference to regex conditional using %n
276 #$HTTP["host"] =~ "^www\.(.*)" {
277 # url.redirect = ( "^/(.*)" => "http://%1/$1" )
278 #}
279
280 #
281 # define a pattern for the host url finding
282 # %% => % sign
283 # %0 => domain name + tld
284 # %1 => tld
285 # %2 => domain name without tld
286 # %3 => subdomain 1 name
287 # %4 => subdomain 2 name
288 #
289 #evhost.path-pattern = "/srv/www/vhosts/%3/htdocs/"
290
291 #### expire module
292 #expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
293
294 #### ssi
295 #ssi.extension = ( ".shtml" )
296
297 #### rrdtool
298 #rrdtool.binary = "/usr/bin/rrdtool"
299 #rrdtool.db-name = "/var/lib/lighttpd/lighttpd.rrd"
300
301 #### setenv
302 #setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" )
303 #setenv.add-response-header = ( "X-Secret-Message" => "42" )
304
305 ## for mod_trigger_b4_dl
306 # trigger-before-download.gdbm-filename = "/var/lib/lighttpd/trigger.db"
307 # trigger-before-download.memcache-hosts = ( "127.0.0.1:11211" )
308 # trigger-before-download.trigger-url = "^/trigger/"
309 # trigger-before-download.download-url = "^/download/"
310 # trigger-before-download.deny-url = "http://127.0.0.1/index.html"
311 # trigger-before-download.trigger-timeout = 10
312
313 ## for mod_cml
314 ## don't forget to add index.cml to server.indexfiles
315 # cml.extension = ".cml"
316 # cml.memcache-hosts = ( "127.0.0.1:11211" )
317
318 #### variable usage:
319 ## variable name without "." is auto prefixed by "var." and becomes "var.bar"
320 #bar = 1
321 #var.mystring = "foo"
322
323 ## integer add
324 #bar += 1
325 ## string concat, with integer cast as string, result: "www.foo1.com"
326 #server.name = "www." + mystring + var.bar + ".com"
327 ## array merge
328 #index-file.names = (foo + ".php") + index-file.names
329 #index-file.names += (foo + ".php")
330
331 #### include
332 #include /etc/lighttpd/lighttpd-inc.conf
333 ## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf"
334 #include "lighttpd-inc.conf"
335
336 #### include_shell
337 #include_shell "echo var.a=1"
338 ## the above is same as:
339 #var.a=1
Something went wrong with that request. Please try again.