Advertisement
Guest User

lighttpd.conf

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