| 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_access", |
|---|
| 18 | # "mod_auth", |
|---|
| 19 | # "mod_status", |
|---|
| 20 | # "mod_proxy_core", |
|---|
| 21 | # "mod_proxy_backend_fastcgi", |
|---|
| 22 | # "mod_simple_vhost", |
|---|
| 23 | # "mod_evhost", |
|---|
| 24 | # "mod_cgi", |
|---|
| 25 | # "mod_compress", |
|---|
| 26 | # "mod_ssi", |
|---|
| 27 | # "mod_usertrack", |
|---|
| 28 | # "mod_rrdtool", |
|---|
| 29 | "mod_accesslog" ) |
|---|
| 30 | |
|---|
| 31 | ## a static document-root, for virtual-hosting take look at the |
|---|
| 32 | ## server.virtual-* options |
|---|
| 33 | server.document-root = "/var/www/" |
|---|
| 34 | |
|---|
| 35 | ## where to send error-messages to |
|---|
| 36 | server.errorlog = "/var/log/lighttpd/error.log" |
|---|
| 37 | |
|---|
| 38 | # files to check for if .../ is requested |
|---|
| 39 | server.indexfiles = ( "index.php", "index.html", |
|---|
| 40 | "index.htm", "default.htm" ) |
|---|
| 41 | |
|---|
| 42 | # mimetype mapping |
|---|
| 43 | mimetype.assign = ( |
|---|
| 44 | ".pdf" => "application/pdf", |
|---|
| 45 | ".sig" => "application/pgp-signature", |
|---|
| 46 | ".spl" => "application/futuresplash", |
|---|
| 47 | ".class" => "application/octet-stream", |
|---|
| 48 | ".ps" => "application/postscript", |
|---|
| 49 | ".torrent" => "application/x-bittorrent", |
|---|
| 50 | ".dvi" => "application/x-dvi", |
|---|
| 51 | ".gz" => "application/x-gzip", |
|---|
| 52 | ".pac" => "application/x-ns-proxy-autoconfig", |
|---|
| 53 | ".swf" => "application/x-shockwave-flash", |
|---|
| 54 | ".tar.gz" => "application/x-tgz", |
|---|
| 55 | ".tgz" => "application/x-tgz", |
|---|
| 56 | ".tar" => "application/x-tar", |
|---|
| 57 | ".zip" => "application/zip", |
|---|
| 58 | ".mp3" => "audio/mpeg", |
|---|
| 59 | ".m3u" => "audio/x-mpegurl", |
|---|
| 60 | ".wma" => "audio/x-ms-wma", |
|---|
| 61 | ".wax" => "audio/x-ms-wax", |
|---|
| 62 | ".ogg" => "audio/x-wav", |
|---|
| 63 | ".wav" => "audio/x-wav", |
|---|
| 64 | ".gif" => "image/gif", |
|---|
| 65 | ".jpg" => "image/jpeg", |
|---|
| 66 | ".jpeg" => "image/jpeg", |
|---|
| 67 | ".png" => "image/png", |
|---|
| 68 | ".xbm" => "image/x-xbitmap", |
|---|
| 69 | ".xpm" => "image/x-xpixmap", |
|---|
| 70 | ".xwd" => "image/x-xwindowdump", |
|---|
| 71 | ".css" => "text/css", |
|---|
| 72 | ".html" => "text/html", |
|---|
| 73 | ".htm" => "text/html", |
|---|
| 74 | ".js" => "text/javascript", |
|---|
| 75 | ".asc" => "text/plain", |
|---|
| 76 | ".c" => "text/plain", |
|---|
| 77 | ".conf" => "text/plain", |
|---|
| 78 | ".text" => "text/plain", |
|---|
| 79 | ".txt" => "text/plain", |
|---|
| 80 | ".dtd" => "text/xml", |
|---|
| 81 | ".xml" => "text/xml", |
|---|
| 82 | ".mpeg" => "video/mpeg", |
|---|
| 83 | ".mpg" => "video/mpeg", |
|---|
| 84 | ".mov" => "video/quicktime", |
|---|
| 85 | ".qt" => "video/quicktime", |
|---|
| 86 | ".avi" => "video/x-msvideo", |
|---|
| 87 | ".asf" => "video/x-ms-asf", |
|---|
| 88 | ".asx" => "video/x-ms-asf", |
|---|
| 89 | ".wmv" => "video/x-ms-wmv" |
|---|
| 90 | ) |
|---|
| 91 | |
|---|
| 92 | # Use the "Content-Type" extended attribute to obtain mime type if possible |
|---|
| 93 | # mimetype.use-xattr = "enable" |
|---|
| 94 | |
|---|
| 95 | #### accesslog module |
|---|
| 96 | accesslog.filename = "/var/log/lighttpd/access.log" |
|---|
| 97 | |
|---|
| 98 | ## deny access the file-extensions |
|---|
| 99 | # |
|---|
| 100 | # ~ is for backupfiles from vi, emacs, joe, ... |
|---|
| 101 | # .inc is often used for code includes which should in general not be part |
|---|
| 102 | # of the document-root |
|---|
| 103 | url.access-deny = ( "~", ".inc" ) |
|---|
| 104 | |
|---|
| 105 | |
|---|
| 106 | |
|---|
| 107 | ######### Options that are good to be but not neccesary to be changed ####### |
|---|
| 108 | |
|---|
| 109 | ## bind to port (default: 80) |
|---|
| 110 | #server.port = 81 |
|---|
| 111 | |
|---|
| 112 | ## bind to localhost (default: all interfaces) |
|---|
| 113 | #server.bind = "grisu.home.kneschke.de" |
|---|
| 114 | |
|---|
| 115 | ## error-handler for status 404 |
|---|
| 116 | #server.error-handler-404 = "/error-handler.html" |
|---|
| 117 | #server.error-handler-404 = "/error-handler.php" |
|---|
| 118 | |
|---|
| 119 | ## to help the rc.scripts |
|---|
| 120 | server.pid-file = "/var/run/lighttpd.pid" |
|---|
| 121 | |
|---|
| 122 | |
|---|
| 123 | ###### virtual hosts |
|---|
| 124 | ## |
|---|
| 125 | ## If you want name-based virtual hosting add the next three settings and load |
|---|
| 126 | ## mod_simple_vhost |
|---|
| 127 | ## |
|---|
| 128 | ## document-root = |
|---|
| 129 | ## virtual-server-root + virtual-server-default-host + virtual-server-docroot or |
|---|
| 130 | ## virtual-server-root + http-host + virtual-server-docroot |
|---|
| 131 | ## |
|---|
| 132 | #simple-vhost.server-root = "/home/weigon/wwwroot/servers/" |
|---|
| 133 | #simple-vhost.default-host = "grisu.home.kneschke.de" |
|---|
| 134 | #simple-vhost.document-root = "/pages/" |
|---|
| 135 | |
|---|
| 136 | |
|---|
| 137 | ## |
|---|
| 138 | ## Format: <errorfile-prefix><status>.html |
|---|
| 139 | ## -> ..../status-404.html for 'File not found' |
|---|
| 140 | #server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-" |
|---|
| 141 | |
|---|
| 142 | ## virtual directory listings |
|---|
| 143 | #server.dir-listing = "enable" |
|---|
| 144 | |
|---|
| 145 | ## send unhandled HTTP-header headers to error-log |
|---|
| 146 | #debug.dump-unknown-headers = "enable" |
|---|
| 147 | |
|---|
| 148 | ### only root can use these options |
|---|
| 149 | # |
|---|
| 150 | # chroot() to directory (default: no chroot() ) |
|---|
| 151 | #server.chroot = "/" |
|---|
| 152 | |
|---|
| 153 | ## change uid to <uid> (default: don't care) |
|---|
| 154 | server.username = "www-data" |
|---|
| 155 | |
|---|
| 156 | ## change uid to <uid> (default: don't care) |
|---|
| 157 | server.groupname = "www-data" |
|---|
| 158 | |
|---|
| 159 | #### compress module |
|---|
| 160 | #compress.cache-dir = "/var/tmp/lighttpd/cache/compress/" |
|---|
| 161 | #compress.filetype = ("text/plain", "text/html") |
|---|
| 162 | |
|---|
| 163 | #### fastcgi module |
|---|
| 164 | ## read fastcgi.txt for more info |
|---|
| 165 | #$HTTP["url"] =~ "\.php$" { |
|---|
| 166 | # proxy-core.balancer = "round-robin" |
|---|
| 167 | # proxy-core.allow-x-sendfile = "enable" |
|---|
| 168 | # proxy-core.check-local = "enable" |
|---|
| 169 | # proxy-core.protocol = "fastcgi" |
|---|
| 170 | # proxy-core.backends = ( "unix:/tmp/php-fastcgi.sock" ) |
|---|
| 171 | # proxy-core.max-pool-size = 16 |
|---|
| 172 | #} |
|---|
| 173 | |
|---|
| 174 | |
|---|
| 175 | #### CGI module |
|---|
| 176 | #cgi.assign = ( ".pl" => "/usr/bin/perl", |
|---|
| 177 | # ".cgi" => "/usr/bin/perl" ) |
|---|
| 178 | |
|---|
| 179 | #### SSL engine |
|---|
| 180 | #ssl.engine = "enable" |
|---|
| 181 | #ssl.pemfile = "server.pem" |
|---|
| 182 | |
|---|
| 183 | #### status module |
|---|
| 184 | # status.status-url = "/server-status" |
|---|
| 185 | # status.config-url = "/server-config" |
|---|
| 186 | |
|---|
| 187 | #### auth module |
|---|
| 188 | ## read authentification.txt for more info |
|---|
| 189 | # auth.backend = "plain" |
|---|
| 190 | # auth.backend.plain.userfile = "lighttpd.user" |
|---|
| 191 | # auth.backend.plain.groupfile = "lighttpd.group" |
|---|
| 192 | |
|---|
| 193 | # auth.backend.ldap.hostname = "localhost" |
|---|
| 194 | # auth.backend.ldap.base-dn = "dc=my-domain,dc=com" |
|---|
| 195 | # auth.backend.ldap.filter = "(uid=$)" |
|---|
| 196 | |
|---|
| 197 | # auth.require = ( "/server-status" => |
|---|
| 198 | # ( |
|---|
| 199 | # "method" => "digest", |
|---|
| 200 | # "realm" => "download archiv", |
|---|
| 201 | # "require" => "group=www|user=jan|host=192.168.2.10" |
|---|
| 202 | # ), |
|---|
| 203 | # "/server-info" => |
|---|
| 204 | # ( |
|---|
| 205 | # "method" => "digest", |
|---|
| 206 | # "realm" => "download archiv", |
|---|
| 207 | # "require" => "group=www|user=jan|host=192.168.2.10" |
|---|
| 208 | # ) |
|---|
| 209 | # ) |
|---|
| 210 | |
|---|
| 211 | #### url handling modules (rewrite, redirect, access) |
|---|
| 212 | # url.rewrite = ( "^/$" => "/server-status" ) |
|---|
| 213 | # url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" ) |
|---|
| 214 | |
|---|
| 215 | # |
|---|
| 216 | # define a pattern for the host url finding |
|---|
| 217 | # %% => % sign |
|---|
| 218 | # %0 => domain name + tld |
|---|
| 219 | # %1 => tld |
|---|
| 220 | # %2 => domain name without tld |
|---|
| 221 | # %3 => subdomain 1 name |
|---|
| 222 | # %4 => subdomain 2 name |
|---|
| 223 | # |
|---|
| 224 | # evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/" |
|---|
| 225 | |
|---|
| 226 | #### expire module |
|---|
| 227 | # expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes") |
|---|
| 228 | |
|---|
| 229 | #### ssi |
|---|
| 230 | # ssi.extension = ( ".shtml" ) |
|---|
| 231 | |
|---|
| 232 | #### rrdtool |
|---|
| 233 | # rrdtool.binary = "/usr/bin/rrdtool" |
|---|
| 234 | # rrdtool.db-name = "/var/www/lighttpd.rrd" |
|---|