Advertisement
Guest User

Untitled

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