1
0

lighttpd.conf 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. # lighttpd configuration file
  2. #
  3. ## modules to load
  4. # all other module should only be loaded if really neccesary
  5. # - saves some time
  6. # - saves memory
  7. #server.modules = (
  8. # "mod_rewrite",
  9. # "mod_redirect",
  10. # "mod_alias",
  11. # "mod_auth",
  12. # "mod_status",
  13. # "mod_setenv",
  14. # "mod_fastcgi",
  15. # "mod_proxy",
  16. # "mod_simple_vhost",
  17. # "mod_cgi",
  18. # "mod_ssi",
  19. # "mod_usertrack",
  20. # "mod_expire"
  21. #)
  22. ## a static document-root, for virtual-hosting take look at the
  23. ## server.virtual-* options
  24. server.document-root = "/tmp/"
  25. ## where to send error-messages to
  26. #server.errorlog = "/var/log/lighttpd/error.log"
  27. ## files to check for if .../ is requested
  28. index-file.names = ( "index.html", "default.html", "index.htm", "default.htm" )
  29. ## mimetype mapping
  30. mimetype.assign = (
  31. ".pdf" => "application/pdf",
  32. ".class" => "application/octet-stream",
  33. ".pac" => "application/x-ns-proxy-autoconfig",
  34. ".swf" => "application/x-shockwave-flash",
  35. ".wav" => "audio/x-wav",
  36. ".gif" => "image/gif",
  37. ".jpg" => "image/jpeg",
  38. ".jpeg" => "image/jpeg",
  39. ".png" => "image/png",
  40. ".css" => "text/css",
  41. ".html" => "text/html",
  42. ".htm" => "text/html",
  43. ".js" => "text/javascript",
  44. ".txt" => "text/plain",
  45. ".dtd" => "text/xml",
  46. ".xml" => "text/xml"
  47. )
  48. ## Use the "Content-Type" extended attribute to obtain mime type if possible
  49. #mimetypes.use-xattr = "enable"
  50. ## send a different Server: header
  51. ## be nice and keep it at lighttpd
  52. #server.tag = "lighttpd"
  53. $HTTP["url"] =~ "\.pdf$" {
  54. server.range-requests = "disable"
  55. }
  56. ##
  57. # which extensions should not be handle via static-file transfer
  58. #
  59. # .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
  60. static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
  61. ######### Options that are good to be but not neccesary to be changed #######
  62. ## bind to port (default: 80)
  63. #server.port = 81
  64. ## bind to localhost (default: all interfaces)
  65. #server.bind = "localhost"
  66. ## error-handler for status 404
  67. #server.error-handler-404 = "/error-handler.html"
  68. #server.error-handler-404 = "/error-handler.php"
  69. ## to help the rc.scripts
  70. server.pid-file = "/var/run/lighttpd.pid"
  71. ###### virtual hosts
  72. ##
  73. ## If you want name-based virtual hosting add the next three settings and load
  74. ## mod_simple_vhost
  75. ##
  76. ## document-root =
  77. ## virtual-server-root + virtual-server-default-host + virtual-server-docroot or
  78. ## virtual-server-root + http-host + virtual-server-docroot
  79. ##
  80. #simple-vhost.server-root = "/home/weigon/wwwroot/servers/"
  81. #simple-vhost.default-host = "grisu.home.kneschke.de"
  82. #simple-vhost.document-root = "/pages/"
  83. ##
  84. ## Format: <errorfile-prefix><status>.html
  85. ## -> ..../status-404.html for 'File not found'
  86. #server.errorfile-prefix = "/www/error-"
  87. ## virtual directory listings
  88. #server.dir-listing = "enable"
  89. ## send unhandled HTTP-header headers to error-log
  90. #debug.dump-unknown-headers = "enable"
  91. ### only root can use these options
  92. #
  93. # chroot() to directory (default: no chroot() )
  94. #server.chroot = "/"
  95. ## change uid to <uid> (default: don't care)
  96. #server.username = "nobody"
  97. ## change uid to <uid> (default: don't care)
  98. #server.groupname = "nobody"
  99. #### compress module
  100. #compress.cache-dir = "/dev/null/"
  101. #compress.filetype = ("text/plain", "text/html")
  102. #### proxy module
  103. ## read proxy.txt for more info
  104. #proxy.server = (
  105. # ".php" => (
  106. # "localhost" => (
  107. # "host" => "192.168.0.101",
  108. # "port" => 80
  109. # )
  110. # )
  111. #)
  112. #### fastcgi module
  113. ## read fastcgi.txt for more info
  114. #fastcgi.server = (
  115. # ".php" => (
  116. # "localhost" => (
  117. # "socket" => "/tmp/php-fastcgi.socket",
  118. # "bin-path" => "/usr/local/bin/php"
  119. # )
  120. # )
  121. #)
  122. #### CGI module
  123. #cgi.assign = ( ".pl" => "/usr/bin/perl", ".cgi" => "/usr/bin/perl" )
  124. #### SSL engine
  125. #ssl.engine = "enable"
  126. #ssl.pemfile = "server.pem"
  127. #### status module
  128. #status.status-url = "/server-status"
  129. #status.config-url = "/server-config"
  130. #### auth module
  131. ## read authentification.txt for more info
  132. #auth.backend = "plain"
  133. #auth.backend.plain.userfile = "lighttpd.user"
  134. #auth.backend.plain.groupfile = "lighttpd.group"
  135. #auth.require = (
  136. # "/server-status" => (
  137. # "method" => "digest",
  138. # "realm" => "download archiv",
  139. # "require" => "group=www|user=jan|host=192.168.2.10"
  140. # ),
  141. # "/server-info" => (
  142. # "method" => "digest",
  143. # "realm" => "download archiv",
  144. # "require" => "group=www|user=jan|host=192.168.2.10"
  145. # )
  146. #)
  147. #### url handling modules (rewrite, redirect, access)
  148. #url.rewrite = ( "^/$" => "/server-status" )
  149. #url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
  150. #### both rewrite/redirect support back reference to regex conditional using %n
  151. #$HTTP["host"] =~ "^www\.(.*)" {
  152. # url.redirect = ( "^/(.*)" => "http://%1/$1" )
  153. #}
  154. #### expire module
  155. #expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
  156. #### ssi
  157. #ssi.extension = ( ".shtml" )
  158. #### setenv
  159. #setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" )
  160. #setenv.add-response-header = ( "X-Secret-Message" => "42" )
  161. #### variable usage:
  162. ## variable name without "." is auto prefixed by "var." and becomes "var.bar"
  163. #bar = 1
  164. #var.mystring = "foo"
  165. ## integer add
  166. #bar += 1
  167. ## string concat, with integer cast as string, result: "www.foo1.com"
  168. #server.name = "www." + mystring + var.bar + ".com"
  169. ## array merge
  170. #index-file.names = (foo + ".php") + index-file.names
  171. #index-file.names += (foo + ".php")
  172. #### include
  173. #include /etc/lighttpd/lighttpd-inc.conf
  174. ## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf"
  175. #include "lighttpd-inc.conf"
  176. #### include_shell
  177. #include_shell "echo var.a=1"
  178. ## the above is same as:
  179. #var.a=1