Advertisement
dcbeelinekz

Untitled

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