| 1 | # lighttpd configuration file |
| 2 | # |
| 3 | # use a it as 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_proxy", |
| 26 | # "mod_simple_vhost", |
| 27 | # "mod_evhost", |
| 28 | # "mod_userdir", |
| 29 | # "mod_cgi", |
| 30 | # "mod_compress", |
| 31 | # "mod_ssi", |
| 32 | # "mod_usertrack", |
| 33 | # "mod_expire", |
| 34 | # "mod_secdownload", |
| 35 | # "mod_rrdtool", |
| 36 | "mod_accesslog" ) |
| 37 | |
| 38 | ## a static document-root, for virtual-hosting take look at the |
| 39 | ## server.virtual-* options |
| 40 | server.document-root = "/Library/WebServer/Documents/" |
| 41 | |
| 42 | ## where to send error-messages to |
| 43 | server.errorlog = "%%PREFIX%%/var/log/lighttpd/error.log" |
| 44 | |
| 45 | # files to check for if .../ is requested |
| 46 | server.indexfiles = ( "index.php", "index.html", |
| 47 | "index.htm", "default.htm" ) |
| 48 | |
| 49 | ## set the event-handler (read the performance section in the manual) |
| 50 | server.event-handler = "freebsd-kqueue" # needed on OS X |
| 51 | |
| 52 | # mimetype mapping |
| 53 | mimetype.assign = ( |
| 54 | ".pdf" => "application/pdf", |
| 55 | ".sig" => "application/pgp-signature", |
| 56 | ".spl" => "application/futuresplash", |
| 57 | ".class" => "application/octet-stream", |
| 58 | ".ps" => "application/postscript", |
| 59 | ".torrent" => "application/x-bittorrent", |
| 60 | ".dvi" => "application/x-dvi", |
| 61 | ".gz" => "application/x-gzip", |
| 62 | ".pac" => "application/x-ns-proxy-autoconfig", |
| 63 | ".swf" => "application/x-shockwave-flash", |
| 64 | ".tar.gz" => "application/x-tgz", |
| 65 | ".tgz" => "application/x-tgz", |
| 66 | ".tar" => "application/x-tar", |
| 67 | ".zip" => "application/zip", |
| 68 | ".mp3" => "audio/mpeg", |
| 69 | ".m3u" => "audio/x-mpegurl", |
| 70 | ".wma" => "audio/x-ms-wma", |
| 71 | ".wax" => "audio/x-ms-wax", |
| 72 | ".ogg" => "application/ogg", |
| 73 | ".wav" => "audio/x-wav", |
| 74 | ".gif" => "image/gif", |
| 75 | ".jpg" => "image/jpeg", |
| 76 | ".jpeg" => "image/jpeg", |
| 77 | ".png" => "image/png", |
| 78 | ".xbm" => "image/x-xbitmap", |
| 79 | ".xpm" => "image/x-xpixmap", |
| 80 | ".xwd" => "image/x-xwindowdump", |
| 81 | ".css" => "text/css", |
| 82 | ".html" => "text/html", |
| 83 | ".htm" => "text/html", |
| 84 | ".js" => "text/javascript", |
| 85 | ".asc" => "text/plain", |
| 86 | ".c" => "text/plain", |
| 87 | ".cpp" => "text/plain", |
| 88 | ".log" => "text/plain", |
| 89 | ".conf" => "text/plain", |
| 90 | ".text" => "text/plain", |
| 91 | ".txt" => "text/plain", |
| 92 | ".dtd" => "text/xml", |
| 93 | ".xml" => "text/xml", |
| 94 | ".mpeg" => "video/mpeg", |
| 95 | ".mpg" => "video/mpeg", |
| 96 | ".mov" => "video/quicktime", |
| 97 | ".qt" => "video/quicktime", |
| 98 | ".avi" => "video/x-msvideo", |
| 99 | ".asf" => "video/x-ms-asf", |
| 100 | ".asx" => "video/x-ms-asf", |
| 101 | ".wmv" => "video/x-ms-wmv", |
| 102 | ".bz2" => "application/x-bzip", |
| 103 | ".tbz" => "application/x-bzip-compressed-tar", |
| 104 | ".tar.bz2" => "application/x-bzip-compressed-tar" |
| 105 | ) |
| 106 | |
| 107 | # Use the "Content-Type" extended attribute to obtain mime type if possible |
| 108 | #mimetype.use-xattr = "enable" |
| 109 | |
| 110 | |
| 111 | ## send a different Server: header |
| 112 | ## be nice and keep it at lighttpd |
| 113 | #server.tag = "lighttpd" |
| 114 | |
| 115 | #### accesslog module |
| 116 | accesslog.filename = "%%PREFIX%%/var/log/lighttpd/access.log" |
| 117 | |
| 118 | ## deny access the file-extensions |
| 119 | # |
| 120 | # ~ is for backupfiles from vi, emacs, joe, ... |
| 121 | # .inc is often used for code includes which should in general not be part |
| 122 | # of the document-root |
| 123 | url.access-deny = ( "~", ".inc" ) |
| 124 | |
| 125 | $HTTP["url"] =~ "\.pdf$" { |
| 126 | server.range-requests = "disable" |
| 127 | } |
| 128 | |
| 129 | ######### Options that are good to be but not neccesary to be changed ####### |
| 130 | |
| 131 | ## bind to port (default: 80) |
| 132 | #server.port = 81 |
| 133 | |
| 134 | ## bind to localhost (default: all interfaces) |
| 135 | #server.bind = "grisu.home.kneschke.de" |
| 136 | |
| 137 | ## error-handler for status 404 |
| 138 | #server.error-handler-404 = "/error-handler.html" |
| 139 | #server.error-handler-404 = "/error-handler.php" |
| 140 | |
| 141 | ## to help the rc.scripts |
| 142 | server.pid-file = "%%PREFIX%%/var/run/lighttpd.pid" |
| 143 | |
| 144 | |
| 145 | ###### virtual hosts |
| 146 | ## |
| 147 | ## If you want name-based virtual hosting add the next three settings and load |
| 148 | ## mod_simple_vhost |
| 149 | ## |
| 150 | ## document-root = |
| 151 | ## virtual-server-root + virtual-server-default-host + virtual-server-docroot |
| 152 | ## or |
| 153 | ## virtual-server-root + http-host + virtual-server-docroot |
| 154 | ## |
| 155 | #simple-vhost.server-root = "/home/weigon/wwwroot/servers/" |
| 156 | #simple-vhost.default-host = "grisu.home.kneschke.de" |
| 157 | #simple-vhost.document-root = "/pages/" |
| 158 | |
| 159 | |
| 160 | ## |
| 161 | ## Format: <errorfile-prefix><status-code>.html |
| 162 | ## -> ..../status-404.html for 'File not found' |
| 163 | #server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-" |
| 164 | |
| 165 | ## virtual directory listings |
| 166 | #server.dir-listing = "enable" |
| 167 | |
| 168 | ## enable debugging |
| 169 | #debug.log-request-header = "enable" |
| 170 | #debug.log-response-header = "enable" |
| 171 | #debug.log-request-handling = "enable" |
| 172 | #debug.log-file-not-found = "enable" |
| 173 | |
| 174 | ### only root can use these options |
| 175 | # |
| 176 | # chroot() to directory (default: no chroot() ) |
| 177 | #server.chroot = "/" |
| 178 | |
| 179 | ## change uid to <uid> (default: don't care) |
| 180 | #server.username = "wwwrun" |
| 181 | |
| 182 | ## change uid to <uid> (default: don't care) |
| 183 | #server.groupname = "wwwrun" |
| 184 | |
| 185 | #### compress module |
| 186 | #compress.cache-dir = "/tmp/lighttpd/cache/compress/" |
| 187 | #compress.filetype = ("text/plain", "text/html") |
| 188 | |
| 189 | #### proxy module |
| 190 | ## read proxy.txt for more info |
| 191 | #proxy.server = ( ".php" => |
| 192 | # ( "localhost" => |
| 193 | # ( |
| 194 | # "host" => "192.168.0.101", |
| 195 | # "port" => 80 |
| 196 | # ) |
| 197 | # ) |
| 198 | # ) |
| 199 | |
| 200 | #### fastcgi module |
| 201 | ## read fastcgi.txt for more info |
| 202 | #fastcgi.server = ( ".php" => |
| 203 | # ( "localhost" => |
| 204 | # ( |
| 205 | # "socket" => "/tmp/php-fastcgi.socket", |
| 206 | # "bin-path" => "/usr/local/bin/php" |
| 207 | # ) |
| 208 | # ) |
| 209 | # ) |
| 210 | |
| 211 | #### CGI module |
| 212 | #cgi.assign = ( ".pl" => "/usr/bin/perl", |
| 213 | # ".cgi" => "/usr/bin/perl" ) |
| 214 | # |
| 215 | |
| 216 | #### SSL engine |
| 217 | #ssl.engine = "enable" |
| 218 | #ssl.pemfile = "server.pem" |
| 219 | |
| 220 | #### status module |
| 221 | #status.status-url = "/server-status" |
| 222 | #status.config-url = "/server-config" |
| 223 | |
| 224 | #### auth module |
| 225 | ## read authentication.txt for more info |
| 226 | #auth.backend = "plain" |
| 227 | #auth.backend.plain.userfile = "lighttpd.user" |
| 228 | #auth.backend.plain.groupfile = "lighttpd.group" |
| 229 | |
| 230 | #auth.backend.ldap.hostname = "localhost" |
| 231 | #auth.backend.ldap.base-dn = "dc=my-domain,dc=com" |
| 232 | #auth.backend.ldap.filter = "(uid=$)" |
| 233 | |
| 234 | #auth.require = ( "/server-status" => |
| 235 | # ( |
| 236 | # "method" => "digest", |
| 237 | # "realm" => "download archiv", |
| 238 | # "require" => "user=jan" |
| 239 | # ), |
| 240 | # "/server-info" => |
| 241 | # ( |
| 242 | # "method" => "digest", |
| 243 | # "realm" => "download archiv", |
| 244 | # "require" => "valid-user" |
| 245 | # ) |
| 246 | # ) |
| 247 | |
| 248 | #### url handling modules (rewrite, redirect, access) |
| 249 | #url.rewrite = ( "^/$" => "/server-status" ) |
| 250 | #url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" ) |
| 251 | |
| 252 | # |
| 253 | # define a pattern for the host url finding |
| 254 | # %% => % sign |
| 255 | # %0 => domain name + tld |
| 256 | # %1 => tld |
| 257 | # %2 => domain name without tld |
| 258 | # %3 => subdomain 1 name |
| 259 | # %4 => subdomain 2 name |
| 260 | # |
| 261 | #evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/" |
| 262 | |
| 263 | #### expire module |
| 264 | #expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes") |
| 265 | |
| 266 | #### ssi |
| 267 | #ssi.extension = ( ".shtml" ) |
| 268 | |
| 269 | #### rrdtool |
| 270 | #rrdtool.binary = "/usr/bin/rrdtool" |
| 271 | #rrdtool.db-name = "/var/www/lighttpd.rrd" |
| 272 | |
| 273 | #### setenv |
| 274 | #setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" ) |
| 275 | #setenv.add-response-header = ( "X-Secret-Message" => "42" ) |
| 276 | |
| 277 | ## for mod_trigger_b4_dl |
| 278 | # trigger-before-download.gdbm-filename = "/home/weigon/testbase/trigger.db" |
| 279 | # trigger-before-download.memcache-hosts = ( "127.0.0.1:11211" ) |
| 280 | # trigger-before-download.trigger-url = "^/trigger/" |
| 281 | # trigger-before-download.download-url = "^/download/" |
| 282 | # trigger-before-download.deny-url = "http://127.0.0.1/index.html" |
| 283 | # trigger-before-download.trigger-timeout = 10 |
| 284 | |
| 285 | ## for mod_cml |
| 286 | ## don't forget to add index.cml to server.indexfiles |
| 287 | # cml.extension = ".cml" |
| 288 | # cml.memcache-hosts = ( "127.0.0.1:11211" ) |