Advertisement
Guest User

Untitled

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