-
Notifications
You must be signed in to change notification settings - Fork 2
/
lighttpd.conf
262 lines (193 loc) · 6.95 KB
/
lighttpd.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# Debian lighttpd configuration file
#
############ Options you really have to take care of ####################
## modules to load
# mod_access, mod_accesslog and mod_alias are loaded by default
# all other module should only be loaded if neccesary
# - saves some time
# - saves memory
server.modules = (
"mod_access",
"mod_alias",
"mod_accesslog",
"mod_compress",
"mod_cgi",
"mod_fastcgi",
"mod_rewrite",
# "mod_redirect",
# "mod_evhost",
# "mod_usertrack",
# "mod_rrdtool",
# "mod_webdav",
# "mod_expire",
# "mod_flv_streaming",
# "mod_evasive"
)
## a static document-root, for virtual-hosting take look at the
## server.virtual-* options
server.document-root = "/var/www/handler"
## where to upload files to, purged daily.
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
## where to send error-messages to
server.errorlog = "/var/log/lighttpd/error.log"
## files to check for if .../ is requested
index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm",
"index.lighttpd.html" )
## Use the "Content-Type" extended attribute to obtain mime type if possible
# mimetype.use-xattr = "enable"
#### accesslog module
accesslog.filename = "/var/log/lighttpd/access.log"
## deny access the file-extensions
#
# ~ is for backupfiles from vi, emacs, joe, ...
# .inc is often used for code includes which should in general not be part
# of the document-root
url.access-deny = ( "~", ".inc" )
##
# which extensions should not be handle via static-file transfer
#
# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
static-file.exclude-extensions = ( ".php", ".cgi", ".pl", ".fcgi" )
######### Options that are good to be but not neccesary to be changed #######
## Use ipv6 only if available.
include_shell "/usr/share/lighttpd/use-ipv6.pl"
## bind to port (default: 80)
# server.port = 81
## bind to localhost only (default: all interfaces)
## server.bind = "localhost"
## error-handler for status 404
#server.error-handler-404 = "/error-handler.html"
#server.error-handler-404 = "/error-handler.php"
## to help the rc.scripts
server.pid-file = "/var/run/lighttpd.pid"
##
## Format: <errorfile-prefix><status>.html
## -> ..../status-404.html for 'File not found'
#server.errorfile-prefix = "/var/www/"
## virtual directory listings
dir-listing.encoding = "utf-8"
server.dir-listing = "enable"
## send unhandled HTTP-header headers to error-log
#debug.dump-unknown-headers = "enable"
### only root can use these options
#
# chroot() to directory (default: no chroot() )
#server.chroot = "/"
## change uid to <uid> (default: don't care)
server.username = "www-data"
## change uid to <uid> (default: don't care)
server.groupname = "www-data"
#### compress module
compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ("text/plain", "text/html", "application/x-javascript", "text/css")
#### url handling modules (rewrite, redirect, access)
# url.rewrite = ( "^/$" => "/server-status" )
# url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
#
# define a pattern for the host url finding
# %% => % sign
# %0 => domain name + tld
# %1 => tld
# %2 => domain name without tld
# %3 => subdomain 1 name
# %4 => subdomain 2 name
#
# evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/"
#### expire module
# expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
#### rrdtool
# rrdtool.binary = "/usr/bin/rrdtool"
# rrdtool.db-name = "/var/www/lighttpd.rrd"
#### variable usage:
## variable name without "." is auto prefixed by "var." and becomes "var.bar"
#bar = 1
#var.mystring = "foo"
## integer add
#bar += 1
## string concat, with integer cast as string, result: "www.foo1.com"
#server.name = "www." + mystring + var.bar + ".com"
## array merge
#index-file.names = (foo + ".php") + index-file.names
#index-file.names += (foo + ".php")
#### external configuration files
## mimetype mapping
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
## load enabled configuration files,
## read /etc/lighttpd/conf-available/README first
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
#### handle Debian Policy Manual, Section 11.5. urls
## by default allow them only from localhost
## (This must come last due to #445459)
## Note: =~ "127.0.0.1" works with ipv6 enabled, whereas == "127.0.0.1" doesn't
$HTTP["remoteip"] =~ "127.0.0.1" {
alias.url += (
"/doc/" => "/usr/share/doc/",
"/images/" => "/usr/share/images/"
)
$HTTP["url"] =~ "^/doc/|^/images/" {
dir-listing.activate = "enable"
}
}
$HTTP["host"] =~ "^js\.eve-profits\.com" {
server.document-root = "/var/www/js"
}
$HTTP["host"] =~ "^img\.eve-profits\.com" {
server.document-root = "/var/www/img"
}
$HTTP["host"] =~ "^munin\.eve-profits\.com" {
server.document-root = "/var/www/munin"
index-file.names = ( "index.php", "index.html", "index.htm", "default.htm", "index.lighttpd.html" )
}
$HTTP["host"] =~ "^prices\.eve-profits\.com" {
url.rewrite = (
"^(.*)$" => "/market.fcgi$1"
)
var.root = "/var/www/"
fastcgi.server = (
"market.fcgi" => (
(
"bin-path" => var.root + "handler/market.fcgi",
"bin-environment" => (
"PERL5LIB" => var.root,
"CGIAPP_CONFIG_FILE" => var.root + "market_config.ini"
),
"socket" => "/tmp/perl_market.socket",
"check-local" => "disable",
"min-procs" => 2,
"max-procs" => 3,
"idle-timeout" => 20
)
)
)
}
$HTTP["host"] =~ "^eve-profits\.com" {
url.rewrite = (
"^$" => "/assets.fcgi/",
"^/$" => "/assets.fcgi/",
"^/([a-zA-Z_]+)$" => "/assets.fcgi/$1",
"^/([a-zA-Z_]+\?.+)$" => "/assets.fcgi/$1"
)
var.root = "/var/www/"
fastcgi.server = (
"assets.fcgi" => (
(
"bin-path" => var.root + "handler/assets.fcgi",
"bin-environment" => (
"PERL5LIB" => var.root,
"CGIAPP_CONFIG_FILE" => var.root + "config.ini"
),
"socket" => "/tmp/perl_assets.socket",
"check-local" => "disable",
"min-procs" => 2,
"max-procs" => 3,
"idle-timeout" => 20
)
)
)
}
CGI.assign = (
# ".php" => "PHP/php-cgi.exe",
".pl" => "/usr/bin/perl",
".cgi" => "/usr/bin/perl"
)