Advertisement
rebecabarros

lighttpd.conf

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