lighttpd 1.4.x https://www.lighttpd.net/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

484 lines
12 KiB

  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_deflate
  52. ##
  53. ## used in:
  54. ## conf.d/deflate.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 = "enable"
  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 lighttpd to serve requests on sockets received from systemd
  95. ## https://www.freedesktop.org/software/systemd/man/systemd.socket.html
  96. ##
  97. #server.systemd-socket-activation = "enable"
  98. ##
  99. ## enable core files.
  100. ##
  101. #server.core-files = "disable"
  102. ##
  103. ## Document root
  104. ##
  105. server.document-root = server_root + "/htdocs"
  106. ##
  107. ## The value for the "Server:" response field.
  108. ##
  109. ## It would be nice to keep it at "lighttpd".
  110. ##
  111. #server.tag = "lighttpd"
  112. ##
  113. ## store a pid file
  114. ##
  115. server.pid-file = state_dir + "/lighttpd.pid"
  116. ##
  117. #######################################################################
  118. #######################################################################
  119. ##
  120. ## Logging Options
  121. ## ------------------
  122. ##
  123. ## all logging options can be overwritten per vhost.
  124. ##
  125. ## Path to the error log file
  126. ##
  127. server.errorlog = log_root + "/error.log"
  128. ##
  129. ## If you want to log to syslog you have to unset the
  130. ## server.errorlog setting and uncomment the next line.
  131. ##
  132. #server.errorlog-use-syslog = "enable"
  133. ##
  134. ## Access log config
  135. ##
  136. include "conf.d/access_log.conf"
  137. ##
  138. ## The debug options are moved into their own file.
  139. ## see conf.d/debug.conf for various options for request debugging.
  140. ##
  141. include "conf.d/debug.conf"
  142. ##
  143. #######################################################################
  144. #######################################################################
  145. ##
  146. ## Tuning/Performance
  147. ## --------------------
  148. ##
  149. ## corresponding documentation:
  150. ## https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_Performance
  151. ##
  152. ## set the event-handler (read the performance section in the manual)
  153. ##
  154. ## The recommended server.event-handler is chosen for each OS, if available.
  155. ##
  156. ## epoll (recommended on Linux)
  157. ## kqueue (recommended on *BSD and MacOS X)
  158. ## solaris-devpoll (recommended on Solaris)
  159. ## poll (recommended if none of above are available)
  160. ## select (not recommended)
  161. ## libev (not recommended)
  162. ##
  163. #server.event-handler = "linux-sysepoll"
  164. ##
  165. ## The basic network interface for all platforms at the syscalls read()
  166. ## and write(). Every modern OS provides its own syscall to help network
  167. ## servers transfer files as fast as possible
  168. ##
  169. ## sendfile - is recommended for small files.
  170. ## writev - is recommended for sending many large files
  171. ##
  172. server.network-backend = "sendfile"
  173. ##
  174. ## As lighttpd is a single-threaded server, its main resource limit is
  175. ## the number of file descriptors, which is set to 1024 by default (on
  176. ## most systems).
  177. ##
  178. ## If you are running a high-traffic site you might want to increase this
  179. ## limit by setting server.max-fds.
  180. ##
  181. ## Changing this setting requires root permissions on startup. see
  182. ## server.username/server.groupname.
  183. ##
  184. ## By default lighttpd would not change the operation system default.
  185. ## But setting it to 2048 is a better default for busy servers.
  186. ##
  187. server.max-fds = 2048
  188. ##
  189. ## listen-backlog is the size of the listen() backlog queue requested when
  190. ## the lighttpd server ask the kernel to listen() on the provided network
  191. ## address. Clients attempting to connect() to the server enter the listen()
  192. ## backlog queue and wait for the lighttpd server to accept() the connection.
  193. ##
  194. ## The out-of-box default on many operating systems is 128 and is identified
  195. ## as SOMAXCONN. This can be tuned on many operating systems. (On Linux,
  196. ## cat /proc/sys/net/core/somaxconn) Requesting a size larger than operating
  197. ## system limit will be silently reduced to the limit by the operating system.
  198. ##
  199. ## When there are too many connection attempts waiting for the server to
  200. ## accept() new connections, the listen backlog queue fills and the kernel
  201. ## rejects additional connection attempts. This can be useful as an
  202. ## indication to an upstream load balancer that the server is busy, and
  203. ## possibly overloaded. In that case, configure a smaller limit for
  204. ## server.listen-backlog. On the other hand, configure a larger limit to be
  205. ## able to handle bursts of new connections, but only do so up to an amount
  206. ## that the server can keep up with responding in a reasonable amount of
  207. ## time. Otherwise, clients may abandon the connection attempts and the
  208. ## server will waste resources servicing abandoned connections.
  209. ##
  210. ## It is best to leave this setting at its default unless you have modelled
  211. ## your traffic and tested that changing this benefits your traffic patterns.
  212. ##
  213. ## Default: 1024
  214. ##
  215. #server.listen-backlog = 128
  216. ##
  217. ## Stat() call caching.
  218. ##
  219. ## lighttpd can utilize FAM/Gamin to cache stat call.
  220. ##
  221. ## possible values are:
  222. ## disable, simple or fam.
  223. ##
  224. server.stat-cache-engine = "simple"
  225. ##
  226. ## Fine tuning for the request handling
  227. ##
  228. ## max-connections == max-fds/2 (maybe /3)
  229. ## means the other file handles are used for fastcgi/files
  230. ##
  231. server.max-connections = 1024
  232. ##
  233. ## How many seconds to keep a keep-alive connection open,
  234. ## until we consider it idle.
  235. ##
  236. ## Default: 5
  237. ##
  238. #server.max-keep-alive-idle = 5
  239. ##
  240. ## How many keep-alive requests until closing the connection.
  241. ##
  242. ## Default: 16
  243. ##
  244. #server.max-keep-alive-requests = 16
  245. ##
  246. ## Maximum size of a request in kilobytes.
  247. ## By default it is unlimited (0).
  248. ##
  249. ## Uploads to your server cant be larger than this value.
  250. ##
  251. #server.max-request-size = 0
  252. ##
  253. ## Time to read from a socket before we consider it idle.
  254. ##
  255. ## Default: 60
  256. ##
  257. #server.max-read-idle = 60
  258. ##
  259. ## Time to write to a socket before we consider it idle.
  260. ##
  261. ## Default: 360
  262. ##
  263. #server.max-write-idle = 360
  264. ##
  265. ## Traffic Shaping
  266. ## -----------------
  267. ##
  268. ## see /usr/share/doc/lighttpd/traffic-shaping.txt
  269. ##
  270. ## Values are in kilobyte per second.
  271. ##
  272. ## Keep in mind that a limit below 32kB/s might actually limit the
  273. ## traffic to 32kB/s. This is caused by the size of the TCP send
  274. ## buffer.
  275. ##
  276. ## per server:
  277. ##
  278. #server.kbytes-per-second = 128
  279. ##
  280. ## per connection:
  281. ##
  282. #connection.kbytes-per-second = 32
  283. ##
  284. #######################################################################
  285. #######################################################################
  286. ##
  287. ## Filename/File handling
  288. ## ------------------------
  289. ##
  290. ## files to check for if .../ is requested
  291. ## index-file.names = ( "index.php", "index.rb", "index.html",
  292. ## "index.htm", "default.htm" )
  293. ##
  294. index-file.names += (
  295. "index.xhtml", "index.html", "index.htm", "default.htm", "index.php"
  296. )
  297. ##
  298. ## deny access the file-extensions
  299. ##
  300. ## ~ is for backupfiles from vi, emacs, joe, ...
  301. ## .inc is often used for code includes which should in general not be part
  302. ## of the document-root
  303. url.access-deny = ( "~", ".inc" )
  304. ##
  305. ## disable range requests for pdf files
  306. ## workaround for a bug in the Acrobat Reader plugin.
  307. ##
  308. $HTTP["url"] =~ "\.pdf$" {
  309. server.range-requests = "disable"
  310. }
  311. ##
  312. ## url handling modules (rewrite, redirect)
  313. ##
  314. #url.rewrite = ( "^/$" => "/server-status" )
  315. #url.redirect = ( "^/wishlist/(.+)" => "http://www.example.com/$1" )
  316. ##
  317. ## both rewrite/redirect support back reference to regex conditional using %n
  318. ##
  319. #$HTTP["host"] =~ "^www\.(.*)" {
  320. # url.redirect = ( "^/(.*)" => "http://%1/$1" )
  321. #}
  322. ##
  323. ## which extensions should not be handle via static-file transfer
  324. ##
  325. ## .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
  326. ##
  327. static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".scgi" )
  328. ##
  329. ## error-handler for all status 400-599
  330. ##
  331. #server.error-handler = "/error-handler.html"
  332. #server.error-handler = "/error-handler.php"
  333. ##
  334. ## error-handler for status 404
  335. ##
  336. #server.error-handler-404 = "/error-handler.html"
  337. #server.error-handler-404 = "/error-handler.php"
  338. ##
  339. ## Format: <errorfile-prefix><status-code>.html
  340. ## -> ..../status-404.html for 'File not found'
  341. ##
  342. #server.errorfile-prefix = "/srv/www/htdocs/errors/status-"
  343. ##
  344. ## mimetype mapping
  345. ##
  346. include "conf.d/mime.conf"
  347. ##
  348. ## directory listing configuration
  349. ##
  350. include "conf.d/dirlisting.conf"
  351. ##
  352. ## Should lighttpd follow symlinks?
  353. ##
  354. server.follow-symlink = "enable"
  355. ##
  356. ## force all filenames to be lowercase?
  357. ##
  358. #server.force-lowercase-filenames = "disable"
  359. ##
  360. ## defaults to /var/tmp as we assume it is a local harddisk
  361. ##
  362. server.upload-dirs = ( "/var/tmp" )
  363. ##
  364. #######################################################################
  365. #######################################################################
  366. ##
  367. ## SSL Support
  368. ## -------------
  369. ##
  370. ## To enable SSL for the whole server you have to provide a valid
  371. ## certificate and have to enable the SSL engine.::
  372. ##
  373. ## ssl.engine = "enable"
  374. ## ssl.pemfile = "/path/to/server.pem"
  375. ##
  376. ## $SERVER["socket"] == "10.0.0.1:443" {
  377. ## ssl.engine = "enable"
  378. ## ssl.pemfile = "/etc/ssl/private/www.example.com.pem"
  379. ##
  380. ## # Check your cipher list with: openssl ciphers -v '...'
  381. ## # (use single quotes as your shell won't like ! in double quotes)
  382. ## #ssl.cipher-list = "HIGH" # default
  383. ##
  384. ## # (recommended to accept only TLSv1.2 and TLSv1.3)
  385. ## #ssl.openssl.ssl-conf-cmd = ("Protocol" => "-ALL, TLSv1.2, TLSv1.3")
  386. ##
  387. ## server.name = "www.example.com"
  388. ##
  389. ## server.document-root = "/srv/www/vhosts/example.com/www/"
  390. ## }
  391. ##
  392. ## If you have a .crt and a .key file, specify both ssl.pemfile and ssl.privkey,
  393. ## or cat them together into a single PEM file:
  394. ## $ cat /etc/ssl/private/lighttpd.key /etc/ssl/certs/lighttpd.crt \
  395. ## > /etc/ssl/private/lighttpd.pem
  396. ##
  397. #ssl.pemfile = "/etc/ssl/private/lighttpd.pem"
  398. #
  399. # or
  400. #
  401. #ssl.privkey = "/etc/ssl/private/privkey.pem"
  402. #ssl.pemfile = "/etc/ssl/private/cert.pem"
  403. ##
  404. ## optionally pass the CA certificate here.
  405. ##
  406. ##
  407. #ssl.ca-file = ""
  408. ##
  409. ## and the CRL revocation list here.
  410. ##
  411. ##
  412. #ssl.ca-crl-file = ""
  413. ##
  414. #######################################################################
  415. #######################################################################
  416. ##
  417. ## custom includes like vhosts.
  418. ##
  419. #include "conf.d/config.conf"
  420. #include "/etc/lighttpd/vhosts.d/*.conf"
  421. ##
  422. #######################################################################