Advertisement
Guest User

Untitled

a guest
Oct 5th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.58 KB | None | 0 0
  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_access",
  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 = "/opt/www"
  31.  
  32. ## where to send error-messages to
  33. server.errorlog = "/opt/www/log/error.log"
  34.  
  35. ## files to check for if .../ is requested
  36. index-file.names = ( "index.html", "index.htm", "index.php" )
  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. #server.username = "user"
  78. #server.groupname = "web"
  79.  
  80. ## bind to port (default: 80)
  81. server.port = 81
  82. ## bind to localhost (default: all interfaces)
  83. #server.bind = "localhost"
  84.  
  85. ## error-handler for status 404
  86. #server.error-handler-404 = "/error-handler.html"
  87. #server.error-handler-404 = "/error-handler.php"
  88. server.event-handler = "poll"
  89.  
  90. ## to help the rc.scripts
  91. server.pid-file = "/var/run/lighttpd.pid"
  92.  
  93.  
  94. ###### virtual hosts
  95. ##
  96. ## If you want name-based virtual hosting add the next three settings and load
  97. ## mod_simple_vhost
  98. ##
  99. ## document-root =
  100. ## virtual-server-root + virtual-server-default-host + virtual-server-docroot or
  101. ## virtual-server-root + http-host + virtual-server-docroot
  102. ##
  103. #simple-vhost.server-root = "/home/weigon/wwwroot/servers/"
  104. #simple-vhost.default-host = "grisu.home.kneschke.de"
  105. #simple-vhost.document-root = "/pages/"
  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 = "user"
  124. #
  125. server.upload-dirs = ( "/tmp" )
  126.  
  127. ## change uid to <uid> (default: don't care)
  128. #server.groupname = "web"
  129.  
  130. #### compress module
  131. #compress.cache-dir = "/dev/null/"
  132. #compress.filetype = ("text/plain", "text/html")
  133. #### proxy module
  134. ## read proxy.txt for more info
  135. #proxy.server = (
  136. # ".php" => (
  137. # "localhost" => (
  138. # "host" => "192.168.0.101",
  139. # "port" => 80
  140. # )
  141. # )
  142. #)
  143.  
  144. #### fastcgi module
  145. ## read fastcgi.txt for more info
  146. #fastcgi.server = (
  147. # ".php" => (
  148. # "localhost" => (
  149. # "socket" => "/tmp/php-fastcgi.socket",
  150. # "bin-path" => "/usr/local/bin/php"
  151. # )
  152. # )
  153. #)
  154.  
  155. #### CGI module
  156. cgi.assign = ( ".pl" => "/usr/bin/perl", ".cgi" => "/usr/bin/perl", ".php" => "/usr/bin/php-cgi" )
  157.  
  158.  
  159. #### SSL engine
  160. #ssl.engine = "enable"
  161. #ssl.pemfile = "server.pem"
  162. #### status module
  163. #status.status-url = "/server-status"
  164. #status.config-url = "/server-config"
  165.  
  166. #### auth module
  167. ## read authentification.txt for more info
  168. #auth.backend = "plain"
  169. #auth.backend.plain.userfile = "lighttpd.user"
  170. #auth.backend.plain.groupfile = "lighttpd.group"
  171. #auth.require = (
  172. # "/server-status" => (
  173. # "method" => "digest",
  174. # "realm" => "download archiv",
  175. # "require" => "group=www|user=jan|host=192.168.2.10"
  176. # ),
  177. # "/server-info" => (
  178. # "method" => "digest",
  179. # "realm" => "download archiv",
  180. # "require" => "group=www|user=jan|host=192.168.2.10"
  181. # )
  182. #)
  183.  
  184. #### url handling modules (rewrite, redirect, access)
  185. #url.rewrite = ( "^/$" => "/server-status" )
  186. #url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
  187. #### both rewrite/redirect support back reference to regex conditional using %n
  188. #$HTTP["host"] =~ "^www\.(.*)" {
  189. # url.redirect = ( "^/(.*)" => "http://%1/$1" )
  190. #}
  191.  
  192. #### expire module
  193. #expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
  194.  
  195. #### ssi
  196. #ssi.extension = ( ".shtml" )
  197.  
  198. #### setenv
  199. #setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" )
  200. #setenv.add-response-header = ( "X-Secret-Message" => "42" )
  201.  
  202. #### variable usage:
  203. ## variable name without "." is auto prefixed by "var." and becomes "var.bar"
  204. #bar = 1
  205. #var.mystring = "foo"
  206.  
  207. ## integer add
  208. #bar += 1
  209. ## string concat, with integer cast as string, result: "www.foo1.com"
  210. #server.name = "www." + mystring + var.bar + ".com"
  211. ## array merge
  212. #index-file.names = (foo + ".php") + index-file.names
  213. #index-file.names += (foo + ".php")
  214. #### include
  215. #include /etc/lighttpd/lighttpd-inc.conf
  216. ## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf"
  217. #include "lighttpd-inc.conf"
  218.  
  219. #### include_shell
  220. #include_shell "echo var.a=1"
  221. ## the above is same as:
  222. #var.a=1
  223.  
  224. #### webdav
  225. #$HTTP["url"] =~ "^/webdav($|/)" {
  226. # webdav.activate = "enable"
  227. # webdav.is-readonly = "enable"
  228. # webdav.sqlite-db-name = "/var/run/lighttpd-webdav-lock.db"
  229. #}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement