Advertisement
emcek

lighttpd.conf

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