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.
 
 
 
 
 
 

485 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 = "/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. ## (ancient; should no longer be needed)
  308. ##
  309. #$HTTP["url"] =~ "\.pdf$" {
  310. # server.range-requests = "disable"
  311. #}
  312. ##
  313. ## url handling modules (rewrite, redirect)
  314. ##
  315. #url.rewrite = ( "^/$" => "/server-status" )
  316. #url.redirect = ( "^/wishlist/(.+)" => "http://www.example.com/$1" )
  317. ##
  318. ## both rewrite/redirect support back reference to regex conditional using %n
  319. ##
  320. #$HTTP["host"] =~ "^www\.(.*)" {
  321. # url.redirect = ( "^/(.*)" => "http://%1/$1" )
  322. #}
  323. ##
  324. ## which extensions should not be handle via static-file transfer
  325. ##
  326. ## .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
  327. ##
  328. static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".scgi" )
  329. ##
  330. ## error-handler for all status 400-599
  331. ##
  332. #server.error-handler = "/error-handler.html"
  333. #server.error-handler = "/error-handler.php"
  334. ##
  335. ## error-handler for status 404
  336. ##
  337. #server.error-handler-404 = "/error-handler.html"
  338. #server.error-handler-404 = "/error-handler.php"
  339. ##
  340. ## Format: <errorfile-prefix><status-code>.html
  341. ## -> ..../status-404.html for 'File not found'
  342. ##
  343. #server.errorfile-prefix = "/srv/www/htdocs/errors/status-"
  344. ##
  345. ## mimetype mapping
  346. ##
  347. include "conf.d/mime.conf"
  348. ##
  349. ## directory listing configuration
  350. ##
  351. include "conf.d/dirlisting.conf"
  352. ##
  353. ## Should lighttpd follow symlinks?
  354. ## default: "enable"
  355. #server.follow-symlink = "enable"
  356. ##
  357. ## force all filenames to be lowercase?
  358. ##
  359. #server.force-lowercase-filenames = "disable"
  360. ##
  361. ## defaults to /var/tmp as we assume it is a local harddisk
  362. ## default: "/var/tmp"
  363. #server.upload-dirs = ( "/var/tmp" )
  364. ##
  365. #######################################################################
  366. #######################################################################
  367. ##
  368. ## SSL Support
  369. ## -------------
  370. ##
  371. ## To enable SSL for the whole server you have to provide a valid
  372. ## certificate and have to enable the SSL engine.::
  373. ##
  374. ## ssl.engine = "enable"
  375. ## ssl.pemfile = "/path/to/server.pem"
  376. ##
  377. ## $SERVER["socket"] == "10.0.0.1:443" {
  378. ## ssl.engine = "enable"
  379. ## ssl.pemfile = "/etc/ssl/private/www.example.com.pem"
  380. ##
  381. ## # Check your cipher list with: openssl ciphers -v '...'
  382. ## # (use single quotes as your shell won't like ! in double quotes)
  383. ## #ssl.cipher-list = "HIGH" # default
  384. ##
  385. ## # (recommended to accept only TLSv1.2 and TLSv1.3)
  386. ## #ssl.openssl.ssl-conf-cmd = ("MinProtocol" => "TLSv1.2")
  387. ##
  388. ## server.name = "www.example.com"
  389. ##
  390. ## server.document-root = "/srv/www/vhosts/example.com/www/"
  391. ## }
  392. ##
  393. ## If you have a .crt and a .key file, specify both ssl.pemfile and ssl.privkey,
  394. ## or cat them together into a single PEM file:
  395. ## $ cat /etc/ssl/private/lighttpd.key /etc/ssl/certs/lighttpd.crt \
  396. ## > /etc/ssl/private/lighttpd.pem
  397. ##
  398. #ssl.pemfile = "/etc/ssl/private/lighttpd.pem"
  399. #
  400. # or
  401. #
  402. #ssl.privkey = "/etc/ssl/private/privkey.pem"
  403. #ssl.pemfile = "/etc/ssl/private/cert.pem"
  404. ##
  405. ## optionally pass the CA certificate here.
  406. ##
  407. ##
  408. #ssl.ca-file = ""
  409. ##
  410. ## and the CRL revocation list here.
  411. ##
  412. ##
  413. #ssl.ca-crl-file = ""
  414. ##
  415. #######################################################################
  416. #######################################################################
  417. ##
  418. ## custom includes like vhosts.
  419. ##
  420. #include "conf.d/config.conf"
  421. #include "/etc/lighttpd/vhosts.d/*.conf"
  422. ##
  423. #######################################################################