Project

General

Profile

Bug #1394 ยป lighttpd.conf

j0t, 2007-10-01 15:41

 
1
server.modules          = (
2
                "mod_alias",
3
                "mod_access",
4
                "mod_auth",
5
                "mod_fastcgi",
6
                "mod_cgi",
7
                "mod_accesslog",
8
                "mod_deflate",
9
                "mod_proxy_core",
10
                "mod_proxy_backend_fastcgi",
11
                "mod_evasive",
12
                "mod_rrdtool",
13
                "mod_redirect"
14
)
15

    
16
server.document-root    = "/usr/local/apache2/htdocs"
17
server.errorlog         = "/usr/local/apache2/logs/lighttpd.error.log"
18
index-file.names        = ( "index.php", "index.html", "index.htm", "default.htm" )
19
mimetype.assign         = (
20
  ".pdf"      =>      "application/pdf",
21
  ".sig"      =>      "application/pgp-signature",
22
  ".spl"      =>      "application/futuresplash",
23
  ".class"    =>      "application/octet-stream",
24
  ".ps"       =>      "application/postscript",
25
  ".torrent"  =>      "application/x-bittorrent",
26
  ".dvi"      =>      "application/x-dvi",
27
  ".gz"       =>      "application/x-gzip",
28
  ".pac"      =>      "application/x-ns-proxy-autoconfig",
29
  ".swf"      =>      "application/x-shockwave-flash",
30
  ".tar.gz"   =>      "application/x-tgz",
31
  ".tgz"      =>      "application/x-tgz",
32
  ".tar"      =>      "application/x-tar",
33
  ".zip"      =>      "application/zip",
34
  ".mp3"      =>      "audio/mpeg",
35
  ".m3u"      =>      "audio/x-mpegurl",
36
  ".wma"      =>      "audio/x-ms-wma",
37
  ".wax"      =>      "audio/x-ms-wax",
38
  ".ogg"      =>      "application/ogg",
39
  ".wav"      =>      "audio/x-wav",
40
  ".gif"      =>      "image/gif",
41
  ".jpg"      =>      "image/jpeg",
42
  ".jpeg"     =>      "image/jpeg",
43
  ".png"      =>      "image/png",
44
  ".xbm"      =>      "image/x-xbitmap",
45
  ".xpm"      =>      "image/x-xpixmap",
46
  ".xwd"      =>      "image/x-xwindowdump",
47
  ".css"      =>      "text/css",
48
  ".html"     =>      "text/html",
49
  ".htm"      =>      "text/html",
50
  ".js"       =>      "text/javascript",
51
  ".asc"      =>      "text/plain",
52
  ".c"        =>      "text/plain",
53
  ".cpp"      =>      "text/plain",
54
  ".log"      =>      "text/plain",
55
  ".conf"     =>      "text/plain",
56
  ".text"     =>      "text/plain",
57
  ".txt"      =>      "text/plain",
58
  ".dtd"      =>      "text/xml",
59
  ".xml"      =>      "text/xml",
60
  ".mpeg"     =>      "video/mpeg",
61
  ".mpg"      =>      "video/mpeg",
62
  ".mov"      =>      "video/quicktime",
63
  ".qt"       =>      "video/quicktime",
64
  ".avi"      =>      "video/x-msvideo",
65
  ".asf"      =>      "video/x-ms-asf",
66
  ".asx"      =>      "video/x-ms-asf",
67
  ".wmv"      =>      "video/x-ms-wmv",
68
  ".bz2"      =>      "application/x-bzip",
69
  ".tbz"      =>      "application/x-bzip-compressed-tar",
70
  ".tar.bz2"  =>      "application/x-bzip-compressed-tar"
71
 )
72

    
73
mimetype.use-xattr    = "enable"
74

    
75
accesslog.filename      = "/usr/local/apache2/logs/lighttpd.log"
76
accesslog.format = "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
77

    
78
url.access-deny         = ( "~", ".inc", ".ht*" )
79

    
80
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
81
server.port        = 80
82
server.pid-file        = "/var/run/lighttpd.pid"
83
server.username        = "httpd"
84
server.groupname       = "httpd"
85

    
86
rrdtool.binary = "/usr/bin/rrdtool"
87
rrdtool.db-name = "/usr/local/apache2/logs/global.rrd"
88

    
89
$HTTP["url"] =~ "\.pdf$" {
90
  server.range-requests = "disable"
91
}
92

    
93
$PHYSICAL["existing-path"] =~ "\.php$" {
94
  proxy-core.balancer = "round-robin"
95
  proxy-core.protocol = "fastcgi"
96
  proxy-core.allow-x-sendfile = "enable"
97
  proxy-core.backends = ( "127.0.0.1:8001" )
98
  proxy-core.max-pool-size = 16
99
  proxy-core.rewrite-request = (
100
    "_pathinfo" => ( "\.php(/.*)" => "$1" )
101
  )
102
}
103

    
104
$HTTP["host"] == "dl.gotnaruto.com" {
105
        server.document-root = "/home/gotnaruto/sito/anonftp"
106
        server.max-connections = 50
107
        evasive.max-conns-per-ip = 2
108
        deflate.enabled = "disable"
109
        dir-listing.activate = "disable"
110
        rrdtool.db-name = "/home/gotnaruto/sito/logs/dlstat.rrd"
111
#       $HTTP["useragent"] =~ "MSIE" { server.max-keep-alive-requests = 0 }
112
        server.network-backend = "linux-aio-sendfile"
113
}
114

    
115
$HTTP["host"] == "dltst.gotnaruto.com" {
116
        server.document-root = "/home/gotnaruto/sito/anonftp"
117
        server.max-connections = 50
118
        evasive.max-conns-per-ip = 2
119
        dir-listing.activate = "disable"
120
        rrdtool.db-name = "/home/gotnaruto/sito/logs/dlstat.rrd"
121
#       $HTTP["useragent"] =~ "MSIE" { server.max-keep-alive-requests = 0 }
122
        server.network-backend = "linux-aio-sendfile"
123
}
124

    
125
$HTTP["host"] =~ "^webmail\." {
126
  server.document-root = "/usr/local/apache2/webmail"
127
  deflate.enabled = "enable"
128
        deflate.compression-level = 9
129
        deflate.mem-level = 9
130
        deflate.window-size = 15
131
        deflate.allowed_encodings = ( "bzip2", "gzip", "deflate" )
132
        deflate.min-compress-size = 200
133
        deflate.sync-flush = "enable"
134
        deflate.output-buffer-size = 8192
135
        deflate.work-block-size = 512
136
        deflate.mimetypes = ("text/html", "text/plain", "text/css", "text/javascript", "text/xml")
137
  $HTTP["url"] =~ "(\.inc|\~)$|^_" {
138
    url.access-deny = ("")
139
  }
140
}
141

    
142
$HTTP["host"] =~ "(^|^www\.)forum\.gotnaruto\.com$" {
143
    server.document-root = "/home/gotnaruto/forum/public_html"
144
    server.errorlog = "/home/gotnaruto/forum/logs/lighttpd.error.log"
145
    accesslog.filename = "|/usr/bin/cronolog --symlink=/home/gotnaruto/forum/logs/lighttpd.log /home/gotnaruto/forum/logs/lighttpd.log.%y-%m-%d"
146
    rrdtool.db-name = "/home/gotnaruto/forum/logs/stat.rrd"
147
    deflate.enabled = "enable"
148
        deflate.compression-level = 9
149
        deflate.mem-level = 9
150
        deflate.window-size = 15
151
        deflate.allowed_encodings = ( "bzip2", "gzip", "deflate" )
152
        deflate.min-compress-size = 200
153
        deflate.sync-flush = "enable"
154
        deflate.output-buffer-size = 8192
155
        deflate.work-block-size = 512
156
        deflate.mimetypes = ("text/html", "text/plain", "text/css", "text/javascript", "text/xml")
157
    $HTTP["url"] =~ "^/admincp/" {
158
        auth.backend = "htpasswd"
159
        auth.backend.htpasswd.userfile = "/home/gotnaruto/forum/htpw/adminpw"
160
        auth.require = ("/admincp" => (
161
            "method"  => "basic",
162
            "realm"   => "GN FORUM ADMIN PANEL",
163
            "require" => "valid-user"
164
        ))
165
    }
166
}
167

    
168
$HTTP["host"] =~ "(^|^www\.)gotnaruto\.com$" {
169
    server.document-root = "/home/gotnaruto/sito/public_html"
170
    server.errorlog = "/home/gotnaruto/sito/logs/lighttpd.error.log"
171
    accesslog.filename = "|/usr/bin/cronolog --symlink=/home/gotnaruto/sito/logs/lighttpd.log /home/gotnaruto/sito/logs/lighttpd.log.%y-%m-%d"
172
    rrdtool.db-name = "/home/gotnaruto/sito/logs/stat.rrd"
173
    deflate.enabled = "enable"
174
        deflate.compression-level = 9
175
        deflate.mem-level = 9
176
        deflate.window-size = 15
177
        deflate.allowed_encodings = ( "bzip2", "gzip", "deflate" )
178
        deflate.min-compress-size = 200
179
        deflate.sync-flush = "enable"
180
        deflate.output-buffer-size = 8192
181
        deflate.work-block-size = 512
182
        deflate.mimetypes = ("text/html", "text/plain", "text/css", "text/javascript", "text/xml")
183

    
184
}
185

    
186
$HTTP["host"] =~ "(^|^www\.)boondocksitalia\.com$" {
187
    server.document-root = "/home/painto/boondocksitalia/public_html"
188
    server.errorlog = "/home/painto/boondocksitalia/logs/lighttpd.error.log"
189
    accesslog.filename = "|/usr/bin/cronolog --symlink=/home/painto/boondocksitalia/logs/lighttpd.log /home/painto/boondocksitalia/logs/lighttpd.log.%y-%m-%d"
190
    deflate.enabled = "enable"
191
        deflate.compression-level = 9
192
        deflate.mem-level = 9
193
        deflate.window-size = 15
194
        deflate.allowed_encodings = ( "bzip2", "gzip", "deflate" )
195
        deflate.min-compress-size = 200
196
        deflate.sync-flush = "enable"
197
        deflate.output-buffer-size = 8192
198
        deflate.work-block-size = 512
199
        deflate.mimetypes = ("text/html", "text/plain", "text/css", "text/javascript", "text/xml")
200
}
201

    
202
$HTTP["host"] =~ "(^|^www\.)lattetokyo\.com$" {
203
    server.document-root = "/home/painto/lattetokyo/public_html"
204
    server.errorlog = "/home/painto/lattetokyo/logs/lighttpd.error.log"
205
    accesslog.filename = "|/usr/bin/cronolog --symlink=/home/painto/lattetokyo/logs/lighttpd.log /home/painto/lattetokyo/logs/lighttpd.log.%y-%m-%d"
206
    deflate.enabled = "enable"
207
        deflate.compression-level = 9
208
        deflate.mem-level = 9
209
        deflate.window-size = 15
210
        deflate.allowed_encodings = ( "bzip2", "gzip", "deflate" )
211
        deflate.min-compress-size = 200
212
        deflate.sync-flush = "enable"
213
        deflate.output-buffer-size = 8192
214
        deflate.work-block-size = 512
215
        deflate.mimetypes = ("text/html", "text/plain", "text/css", "text/javascript", "text/xml")
216
}
217

    
218
$HTTP["host"] == "enterprise.j0t.it" {
219
        alias.url += ( "/cgi-bin" => "/usr/local/apache2/cgi-bin" )
220
        alias.url += ( "/icons" => "/usr/local/apache2/icons" )
221
        $HTTP["url"] =~ "/cgi-bin/.*$" {
222
            cgi.assign = ("" => "")
223
            server.follow-symlink = "enable"
224
        }
225
        alias.url +=("/mysqlstat" => "/usr/local/mysqlstat/cgi-bin")
226
        $HTTP["url"] =~ "/mysqlstat/.*\.cgi$" {
227
            cgi.assign = ("" => "")
228
            server.follow-symlink = "enable"
229
        }
230
}
231

    
232
$HTTP["host"] =~ "(^|^www\.)gotnaruto\.(net|org|it)$" {
233
  url.redirect = ( "^/(.*)" => "http://www.gotnaruto.com/$1" )
234
}
    (1-1/1)