lighttpd.conf 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. #######################################################################
  2. ##
  3. ## /etc/lighttpd/lighttpd.conf
  4. ##
  5. ## check /etc/lighttpd/conf.d/*.conf for the configuration of modules.
  6. ##
  7. #######################################################################
  8. #######################################################################
  9. ##
  10. ## Some Variable definition which will make chrooting easier.
  11. ##
  12. ## if you add a variable here. Add the corresponding variable in the
  13. ## chroot example aswell.
  14. ##
  15. var.log_root = "/var/log/lighttpd"
  16. var.server_root = "/srv/www"
  17. var.state_dir = "/var/run"
  18. var.home_dir = "/var/lib/lighttpd"
  19. var.conf_dir = "/etc/lighttpd"
  20. ##
  21. ## run the server chrooted.
  22. ##
  23. ## This requires root permissions during startup.
  24. ##
  25. ## If you run Chrooted set the the variables to directories relative to
  26. ## the chroot dir.
  27. ##
  28. ## example chroot configuration:
  29. ##
  30. #var.log_root = "/logs"
  31. #var.server_root = "/"
  32. #var.state_dir = "/run"
  33. #var.home_dir = "/lib/lighttpd"
  34. #var.vhosts_dir = "/vhosts"
  35. #var.conf_dir = "/etc"
  36. #
  37. #server.chroot = "/srv/www"
  38. ##
  39. ## Some additional variables to make the configuration easier
  40. ##
  41. ##
  42. ## Base directory for all virtual hosts
  43. ##
  44. ## used in:
  45. ## conf.d/evhost.conf
  46. ## conf.d/simple_vhost.conf
  47. ## vhosts.d/vhosts.template
  48. ##
  49. var.vhosts_dir = server_root + "/vhosts"
  50. ##
  51. ## Cache for mod_compress
  52. ##
  53. ## used in:
  54. ## conf.d/compress.conf
  55. ##
  56. var.cache_dir = "/var/cache/lighttpd"
  57. ##
  58. ## Base directory for sockets.
  59. ##
  60. ## used in:
  61. ## conf.d/fastcgi.conf
  62. ## conf.d/scgi.conf
  63. ##
  64. var.socket_dir = home_dir + "/sockets"
  65. ##
  66. #######################################################################
  67. #######################################################################
  68. ##
  69. ## Load the modules.
  70. include "modules.conf"
  71. ##
  72. #######################################################################
  73. #######################################################################
  74. ##
  75. ## Basic Configuration
  76. ## ---------------------
  77. ##
  78. server.port = 80
  79. ##
  80. ## Use IPv6?
  81. ##
  82. server.use-ipv6 = "disable"
  83. ##
  84. ## bind to a specific IP
  85. ##
  86. #server.bind = "localhost"
  87. ##
  88. ## Run as a different username/groupname.
  89. ## This requires root permissions during startup.
  90. ##
  91. server.username = "lighttpd"
  92. server.groupname = "lighttpd"
  93. ##
  94. ## enable core files.
  95. ##
  96. #server.core-files = "disable"
  97. ##
  98. ## Document root
  99. ##
  100. server.document-root = server_root + "/htdocs"
  101. ##
  102. ## The value for the "Server:" response field.
  103. ##
  104. ## It would be nice to keep it at "lighttpd".
  105. ##
  106. #server.tag = "lighttpd"
  107. ##
  108. ## store a pid file
  109. ##
  110. server.pid-file = state_dir + "/lighttpd.pid"
  111. ##
  112. #######################################################################
  113. #######################################################################
  114. ##
  115. ## Logging Options
  116. ## ------------------
  117. ##
  118. ## all logging options can be overwritten per vhost.
  119. ##
  120. ## Path to the error log file
  121. ##
  122. server.errorlog = log_root + "/error.log"
  123. ##
  124. ## If you want to log to syslog you have to unset the
  125. ## server.errorlog setting and uncomment the next line.
  126. ##
  127. #server.errorlog-use-syslog = "enable"
  128. ##
  129. ## Access log config
  130. ##
  131. include "conf.d/access_log.conf"
  132. ##
  133. ## The debug options are moved into their own file.
  134. ## see conf.d/debug.conf for various options for request debugging.
  135. ##
  136. include "conf.d/debug.conf"
  137. ##
  138. #######################################################################
  139. #######################################################################
  140. ##
  141. ## Tuning/Performance
  142. ## --------------------
  143. ##
  144. ## corresponding documentation:
  145. ## http://www.lighttpd.net/documentation/performance.html
  146. ##
  147. ## set the event-handler (read the performance section in the manual)
  148. ##
  149. ## possible options on linux are:
  150. ##
  151. ## select
  152. ## poll
  153. ## linux-sysepoll
  154. ##
  155. ## linux-sysepoll is recommended on kernel 2.6.
  156. ##
  157. server.event-handler = "linux-sysepoll"
  158. ##
  159. ## The basic network interface for all platforms at the syscalls read()
  160. ## and write(). Every modern OS provides its own syscall to help network
  161. ## servers transfer files as fast as possible
  162. ##
  163. ## linux-sendfile - is recommended for small files.
  164. ## writev - is recommended for sending many large files
  165. ##
  166. #server.network-backend = "linux-sendfile"
  167. ##
  168. ## As lighttpd is a single-threaded server, its main resource limit is
  169. ## the number of file descriptors, which is set to 1024 by default (on
  170. ## most systems).
  171. ##
  172. ## If you are running a high-traffic site you might want to increase this
  173. ## limit by setting server.max-fds.
  174. ##
  175. ## Changing this setting requires root permissions on startup. see
  176. ## server.username/server.groupname.
  177. ##
  178. ## By default lighttpd would not change the operation system default.
  179. ## But setting it to 2048 is a better default for busy servers.
  180. ##
  181. server.max-fds = 2048
  182. ##
  183. ## Stat() call caching.
  184. ##
  185. ## lighttpd can utilize FAM/Gamin to cache stat call.
  186. ##
  187. ## possible values are:
  188. ## disable, simple or fam.
  189. ##
  190. server.stat-cache-engine = "simple"
  191. ##
  192. ## Fine tuning for the request handling
  193. ##
  194. ## max-connections == max-fds/2 (maybe /3)
  195. ## means the other file handles are used for fastcgi/files
  196. ##
  197. server.max-connections = 1024
  198. ##
  199. ## How many seconds to keep a keep-alive connection open,
  200. ## until we consider it idle.
  201. ##
  202. ## Default: 5
  203. ##
  204. #server.max-keep-alive-idle = 5
  205. ##
  206. ## How many keep-alive requests until closing the connection.
  207. ##
  208. ## Default: 16
  209. ##
  210. #server.max-keep-alive-requests = 16
  211. ##
  212. ## Maximum size of a request in kilobytes.
  213. ## By default it is unlimited (0).
  214. ##
  215. ## Uploads to your server cant be larger than this value.
  216. ##
  217. #server.max-request-size = 0
  218. ##
  219. ## Time to read from a socket before we consider it idle.
  220. ##
  221. ## Default: 60
  222. ##
  223. #server.max-read-idle = 60
  224. ##
  225. ## Time to write to a socket before we consider it idle.
  226. ##
  227. ## Default: 360
  228. ##
  229. #server.max-write-idle = 360
  230. ##
  231. ## Traffic Shaping
  232. ## -----------------
  233. ##
  234. ## see /usr/share/doc/lighttpd/traffic-shaping.txt
  235. ##
  236. ## Values are in kilobyte per second.
  237. ##
  238. ## Keep in mind that a limit below 32kB/s might actually limit the
  239. ## traffic to 32kB/s. This is caused by the size of the TCP send
  240. ## buffer.
  241. ##
  242. ## per server:
  243. ##
  244. #server.kbytes-per-second = 128
  245. ##
  246. ## per connection:
  247. ##
  248. #connection.kbytes-per-second = 32
  249. ##
  250. #######################################################################
  251. #######################################################################
  252. ##
  253. ## Filename/File handling
  254. ## ------------------------
  255. ##
  256. ## files to check for if .../ is requested
  257. ## index-file.names = ( "index.php", "index.rb", "index.html",
  258. ## "index.htm", "default.htm" )
  259. ##
  260. index-file.names += (
  261. "index.xhtml", "index.html", "index.htm", "default.htm", "index.php"
  262. )
  263. ##
  264. ## deny access the file-extensions
  265. ##
  266. ## ~ is for backupfiles from vi, emacs, joe, ...
  267. ## .inc is often used for code includes which should in general not be part
  268. ## of the document-root
  269. #url.access-deny = ( "~", ".inc" )
  270. ##
  271. ## disable range requests for pdf files
  272. ## workaround for a bug in the Acrobat Reader plugin.
  273. ##
  274. $HTTP["url"] =~ "\.pdf$" {
  275. server.range-requests = "disable"
  276. }
  277. ##
  278. ## url handling modules (rewrite, redirect)
  279. ##
  280. #url.rewrite = ( "^/$" => "/server-status" )
  281. #url.redirect = ( "^/wishlist/(.+)" => "http://www.example.com/$1" )
  282. ##
  283. ## both rewrite/redirect support back reference to regex conditional using %n
  284. ##
  285. #$HTTP["host"] =~ "^www\.(.*)" {
  286. # url.redirect = ( "^/(.*)" => "http://%1/$1" )
  287. #}
  288. ##
  289. ## which extensions should not be handle via static-file transfer
  290. ##
  291. ## .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
  292. ##
  293. static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".scgi" )
  294. ##
  295. ## error-handler for status 404
  296. ##
  297. #server.error-handler-404 = "/error-handler.html"
  298. #server.error-handler-404 = "/error-handler.php"
  299. ##
  300. ## Format: <errorfile-prefix><status-code>.html
  301. ## -> ..../status-404.html for 'File not found'
  302. ##
  303. #server.errorfile-prefix = "/srv/www/htdocs/errors/status-"
  304. ##
  305. ## mimetype mapping
  306. ##
  307. include "conf.d/mime.conf"
  308. ##
  309. ## directory listing configuration
  310. ##
  311. include "conf.d/dirlisting.conf"
  312. ##
  313. ## Should lighttpd follow symlinks?
  314. ##
  315. server.follow-symlink = "enable"
  316. ##
  317. ## force all filenames to be lowercase?
  318. ##
  319. #server.force-lowercase-filenames = "disable"
  320. ##
  321. ## defaults to /var/tmp as we assume it is a local harddisk
  322. ##
  323. server.upload-dirs = ( "/var/tmp" )
  324. ##
  325. #######################################################################
  326. #######################################################################
  327. ##
  328. ## SSL Support
  329. ## -------------
  330. ##
  331. ## To enable SSL for the whole server you have to provide a valid
  332. ## certificate and have to enable the SSL engine.::
  333. ##
  334. ## ssl.engine = "enable"
  335. ## ssl.pemfile = "/path/to/server.pem"
  336. ##
  337. ## The HTTPS protocol does not allow you to use name-based virtual
  338. ## hosting with SSL. If you want to run multiple SSL servers with
  339. ## one lighttpd instance you must use IP-based virtual hosting: ::
  340. ##
  341. ## $SERVER["socket"] == "10.0.0.1:443" {
  342. ## ssl.engine = "enable"
  343. ## ssl.pemfile = "/etc/ssl/private/www.example.com.pem"
  344. ## server.name = "www.example.com"
  345. ##
  346. ## server.document-root = "/srv/www/vhosts/example.com/www/"
  347. ## }
  348. ##
  349. ## If you have a .crt and a .key file, cat them together into a
  350. ## single PEM file:
  351. ## $ cat /etc/ssl/private/lighttpd.key /etc/ssl/certs/lighttpd.crt \
  352. ## > /etc/ssl/private/lighttpd.pem
  353. ##
  354. #ssl.pemfile = "/etc/ssl/private/lighttpd.pem"
  355. ##
  356. ## optionally pass the CA certificate here.
  357. ##
  358. ##
  359. #ssl.ca-file = ""
  360. ##
  361. #######################################################################
  362. #######################################################################
  363. ##
  364. ## custom includes like vhosts.
  365. ##
  366. #include "conf.d/config.conf"
  367. #include_shell "cat /etc/lighttpd/vhosts.d/*.conf"
  368. ##
  369. #######################################################################