Guest User

lighttpd.conf

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