Advertisement
Guest User

Untitled

a guest
Nov 17th, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.24 KB | None | 0 0
  1. # lighttpd configuration file
  2. #
  3. # use it as a base for lighttpd 1.0.0 and above
  4. #
  5. # $Id: lighttpd.conf 8860 2008-08-05 10:56:16Z engy $
  6.  
  7. ############ Options you really have to take care of ####################
  8.  
  9. ## modules to load
  10. # at least mod_access and mod_accesslog should be loaded
  11. # all other module should only be loaded if really neccesary
  12. # - saves some time
  13. # - saves memory
  14. server.modules = (
  15. "mod_rewrite",
  16. "mod_redirect",
  17. "mod_alias",
  18. "mod_access",
  19. # "mod_cml",
  20. # "mod_trigger_b4_dl",
  21. "mod_auth",
  22. # "mod_status",
  23. # "mod_setenv",
  24. "mod_fastcgi",
  25. # "mod_proxy",
  26. "mod_simple_vhost",
  27. # "mod_evhost",
  28. "mod_userdir",
  29. # "mod_cgi",
  30. # "mod_compress",
  31. # "mod_ssi",
  32. # "mod_usertrack",
  33. # "mod_expire",
  34. # "mod_secdownload",
  35. # "mod_rrdtool",
  36. "mod_accesslog" )
  37.  
  38. ## a static document-root, for virtual-hosting take look at the
  39. ## server.virtual-* options
  40. server.document-root = "/opt/share/www/"
  41.  
  42. ## where to send error-messages to
  43. server.errorlog = "/opt/var/log/lighttpd/error.log"
  44.  
  45. # files to check for if .../ is requested
  46. index-file.names = ( "index.php", "index.html",
  47. "index.htm", "default.htm",
  48. "owncloud/index.html" )
  49.  
  50. ## set the event-handler (read the performance section in the manual)
  51. # server.event-handler = "freebsd-kqueue" # needed on OS X
  52.  
  53. # mimetype mapping
  54. mimetype.assign = (
  55. ".pdf" => "application/pdf",
  56. ".sig" => "application/pgp-signature",
  57. ".spl" => "application/futuresplash",
  58. ".class" => "application/octet-stream",
  59. ".ps" => "application/postscript",
  60. ".torrent" => "application/x-bittorrent",
  61. ".dvi" => "application/x-dvi",
  62. ".gz" => "application/x-gzip",
  63. ".pac" => "application/x-ns-proxy-autoconfig",
  64. ".swf" => "application/x-shockwave-flash",
  65. ".tar.gz" => "application/x-tgz",
  66. ".tgz" => "application/x-tgz",
  67. ".tar" => "application/x-tar",
  68. ".zip" => "application/zip",
  69. ".mp3" => "audio/mpeg",
  70. ".m3u" => "audio/x-mpegurl",
  71. ".wma" => "audio/x-ms-wma",
  72. ".wax" => "audio/x-ms-wax",
  73. ".ogg" => "application/ogg",
  74. ".wav" => "audio/x-wav",
  75. ".gif" => "image/gif",
  76. ".jpg" => "image/jpeg",
  77. ".jpeg" => "image/jpeg",
  78. ".png" => "image/png",
  79. ".xbm" => "image/x-xbitmap",
  80. ".xpm" => "image/x-xpixmap",
  81. ".xwd" => "image/x-xwindowdump",
  82. ".css" => "text/css",
  83. ".html" => "text/html",
  84. ".htm" => "text/html",
  85. ".js" => "text/javascript",
  86. ".asc" => "text/plain",
  87. ".c" => "text/plain",
  88. ".cpp" => "text/plain",
  89. ".log" => "text/plain",
  90. ".conf" => "text/plain",
  91. ".text" => "text/plain",
  92. ".txt" => "text/plain",
  93. ".dtd" => "text/xml",
  94. ".xml" => "text/xml",
  95. ".mpeg" => "video/mpeg",
  96. ".mpg" => "video/mpeg",
  97. ".mov" => "video/quicktime",
  98. ".qt" => "video/quicktime",
  99. ".avi" => "video/x-msvideo",
  100. ".asf" => "video/x-ms-asf",
  101. ".asx" => "video/x-ms-asf",
  102. ".wmv" => "video/x-ms-wmv",
  103. ".bz2" => "application/x-bzip",
  104. ".tbz" => "application/x-bzip-compressed-tar",
  105. ".tar.bz2" => "application/x-bzip-compressed-tar"
  106. )
  107.  
  108. # Use the "Content-Type" extended attribute to obtain mime type if possible
  109. #mimetype.use-xattr = "enable"
  110.  
  111.  
  112. ## send a different Server: header
  113. ## be nice and keep it at lighttpd
  114. # server.tag = "lighttpd"
  115.  
  116. #### accesslog module
  117. accesslog.filename = "/opt/var/log/lighttpd/access.log"
  118.  
  119. ## deny access the file-extensions
  120. #
  121. # ~ is for backupfiles from vi, emacs, joe, ...
  122. # .inc is often used for code includes which should in general not be part
  123. # of the document-root
  124. #url.access-deny = ( "~", ".inc" )
  125.  
  126. $HTTP["url"] =~ "\.pdf$" {
  127. server.range-requests = "disable"
  128. }
  129.  
  130. ##
  131. # which extensions should not be handle via static-file transfer
  132. #
  133. # .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
  134. static-file.exclude-extensions = ( ".fcgi", ".php", ".pl", ".py", ".rb" )
  135.  
  136. ######### Options that are good to be but not neccesary to be changed #######
  137.  
  138. ## bind to port (default: 80)
  139. server.port = 80
  140.  
  141. ## bind to localhost (default: all interfaces)
  142. #server.bind = "grisu.home.kneschke.de"
  143.  
  144. ## error-handler for status 404
  145. #server.error-handler-404 = "/error-handler.html"
  146. #server.error-handler-404 = "/error-handler.php"
  147.  
  148. ## to help the rc.scripts
  149. server.pid-file = "/var/run/lighttpd.pid"
  150.  
  151.  
  152. ###### virtual hosts
  153. ##
  154. ## If you want name-based virtual hosting add the next three settings and load
  155. ## mod_simple_vhost
  156. ##
  157. ## document-root =
  158. ## virtual-server-root + virtual-server-default-host + virtual-server-docroot
  159. ## or
  160. ## virtual-server-root + http-host + virtual-server-docroot
  161. ##
  162.  
  163. ##2 vhost and more
  164. $HTTP["host"] !~ "^(poczta\.domena\.pl|owncloud\.domena\.pl)$" {
  165. simple-vhost.server-root = "/opt/share/www/"
  166. simple-vhost.default-host = "domena.pl"
  167. simple-vhost.document-root = "/" }
  168. $HTTP["host"] == "poczta.domena.pl" {server.document-root = "/opt/share/www/poczta/"}
  169. $HTTP["host"] == "owncloud.domena.pl" {server.document-root = "/opt/share/www/owncloud/"}
  170.  
  171. ##
  172. ## Format: <errorfile-prefix><status-code>.html
  173. ## -> ..../status-404.html for 'File not found'
  174. #server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-"
  175.  
  176. ## virtual directory listings
  177. #dir-listing.activate = "enable"
  178.  
  179. ## enable debugging
  180. #debug.log-request-header = "enable"
  181. #debug.log-response-header = "enable"
  182. #debug.log-request-handling = "enable"
  183. #debug.log-file-not-found = "enable"
  184.  
  185. ### only root can use these options
  186. #
  187. # chroot() to directory (default: no chroot() )
  188. #server.chroot = "/"
  189.  
  190. ## change uid to <uid> (default: don't care)
  191. #server.username = "nobody"
  192.  
  193. ## change uid to <uid> (default: don't care)
  194. #server.groupname = "nobody"
  195.  
  196. #### compress module
  197. #compress.cache-dir = "/tmp/lighttpd/cache/compress/"
  198. #compress.filetype = ("text/plain", "text/html")
  199.  
  200. #### proxy module
  201. ## read proxy.txt for more info
  202. #proxy.server = ( ".php" =>
  203. # ( "localhost" =>
  204. # (
  205. # "host" => "192.168.0.101",
  206. # "port" => 80
  207. # )
  208. # )
  209. # )
  210.  
  211. #### fastcgi module
  212. ## read fastcgi.txt for more info
  213. fastcgi.server = ( ".php" =>
  214. ( "localhost" =>
  215. (
  216. "socket" => "/tmp/php-fcgi.sock",
  217. "bin-path" => "/opt/bin/php-fcgi",
  218. "bin-environment" => (
  219. "PHP_FCGI_MAX_REQUESTS" => "4000"
  220. )
  221. )
  222. )
  223. )
  224.  
  225. #### CGI module
  226. #cgi.assign = ( ".pl" => "/opt/bin/perl",
  227. # ".cgi" => "/opt/bin/perl" )
  228. #
  229.  
  230. #### SSL engine
  231. #ssl.engine = "enable"
  232. #ssl.pemfile = "server.pem"
  233. #ssl.ca-file = "ca.crt"
  234. #ssl.verifyclient.activate = "enable"
  235. #ssl.verifyclient.enforce = "enable"
  236. #ssl.verifyclient.depth = 1
  237.  
  238. ##SSL Configuration
  239. #ssl.engine = "enable"
  240. #ssl.pemfile = "/jffs/ssl/server.pem"
  241.  
  242. #### status module
  243. #status.status-url = "/server-status"
  244. #status.config-url = "/server-config"
  245.  
  246. #### auth module
  247. ## read authentication.txt for more info
  248. #auth.backend = "plain"
  249. #auth.backend.plain.userfile = "lighttpd.user"
  250. #auth.backend.plain.groupfile = "lighttpd.group"
  251.  
  252. #auth.backend.ldap.hostname = "localhost"
  253. #auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
  254. #auth.backend.ldap.filter = "(uid=$)"
  255.  
  256. #auth.require = ( "/server-status" =>
  257. # (
  258. # "method" => "digest",
  259. # "realm" => "download archiv",
  260. # "require" => "user=jan"
  261. # ),
  262. # "/server-config" =>
  263. # (
  264. # "method" => "digest",
  265. # "realm" => "download archiv",
  266. # "require" => "valid-user"
  267. # )
  268. # )
  269.  
  270. #### url handling modules (rewrite, redirect, access)
  271. #url.rewrite = ( "^/$" => "/server-status" )
  272. #url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
  273. #### both rewrite/redirect support back reference to regex conditional using %n
  274. #$HTTP["host"] =~ "^www\.(.*)" {
  275. # url.redirect = ( "^/(.*)" => "http://%1/$1" )
  276. #}
  277.  
  278. ##(redirect)
  279. $HTTP["host"] =~ "^domena\.pl$" {
  280. url.redirect = ( "^/(.*)" => "http://www.domena.pl/" )
  281. }
  282.  
  283. #
  284. # define a pattern for the host url finding
  285. # %% => % sign
  286. # %0 => domain name + tld
  287. # %1 => tld
  288. # %2 => domain name without tld
  289. # %3 => subdomain 1 name
  290. # %4 => subdomain 2 name
  291. #
  292. #evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/"
  293.  
  294. #### expire module
  295. #expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
  296.  
  297. #### ssi
  298. #ssi.extension = ( ".shtml" )
  299.  
  300. #### rrdtool
  301. #rrdtool.binary = "/opt/bin/rrdtool"
  302. #rrdtool.db-name = "/var/www/lighttpd.rrd"
  303.  
  304. #### setenv
  305. #setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" )
  306. #setenv.add-response-header = ( "X-Secret-Message" => "42" )
  307.  
  308. ## for mod_trigger_b4_dl
  309. # trigger-before-download.gdbm-filename = "/home/weigon/testbase/trigger.db"
  310. # trigger-before-download.memcache-hosts = ( "127.0.0.1:11211" )
  311. # trigger-before-download.trigger-url = "^/trigger/"
  312. # trigger-before-download.download-url = "^/download/"
  313. # trigger-before-download.deny-url = "http://127.0.0.1/index.html"
  314. # trigger-before-download.trigger-timeout = 10
  315.  
  316. ## for mod_cml
  317. ## don't forget to add index.cml to server.indexfiles
  318. # cml.extension = ".cml"
  319. # cml.memcache-hosts = ( "127.0.0.1:11211" )
  320.  
  321. #### variable usage:
  322. ## variable name without "." is auto prefixed by "var." and becomes "var.bar"
  323. #bar = 1
  324. #var.mystring = "foo"
  325.  
  326. ## integer add
  327. #bar += 1
  328. ## string concat, with integer cast as string, result: "www.foo1.com"
  329. #server.name = "www." + mystring + var.bar + ".com"
  330. ## array merge
  331. #index-file.names = (foo + ".php") + index-file.names
  332. #index-file.names += (foo + ".php")
  333.  
  334. #### include
  335. #include /etc/lighttpd/lighttpd-inc.conf
  336. ## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf"
  337. #include "lighttpd-inc.conf"
  338.  
  339. #### include_shell
  340. #include_shell "echo var.a=1"
  341. ## the above is same as:
  342. #var.a=1
  343.  
  344. # Configuration from other optware packages
  345. #include_shell "cat /opt/etc/lighttpd/conf.d/*.conf"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement