Advertisement
Guest User

Untitled

a guest
Mar 18th, 2010
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.69 KB | None | 0 0
  1. ############ Options you really have to take care of ####################
  2.  
  3. ## modules to load
  4. # mod_access, mod_accesslog and mod_alias are loaded by default
  5. # all other module should only be loaded if neccesary
  6. # - saves some time
  7. # - saves memory
  8.  
  9. server.modules = (
  10. "mod_access",
  11. "mod_alias",
  12. "mod_accesslog",
  13. "mod_compress",
  14. "mod_rewrite",
  15. "mod_redirect",
  16. "mod_expire",
  17. "mod_uploadprogress",
  18. "mod_proxy_core",
  19. "mod_cgi",
  20. "mod_proxy_backend_fastcgi"
  21. )
  22.  
  23.  
  24. $HTTP["url"] !~ "^/upload/uploaded/" {
  25. $HTTP["url"] =~ "\.php$" {
  26. proxy-core.balancer = "round-robin"
  27. proxy-core.allow-x-sendfile = "enable"
  28. proxy-core.protocol = "fastcgi"
  29. proxy-core.backends = ( "unix:/tmp/php-fastcgi.sock" )
  30. proxy-core.max-pool-size = 16
  31. }
  32. }
  33.  
  34. ##connection.kbytes-per-second=50
  35.  
  36. server.kbytes-per-second = 9001
  37.  
  38. server.max-worker = 50
  39.  
  40.  
  41.  
  42.  
  43. server.modules += ( "mod_rrdtool" )
  44. ### RRDTOOL Config
  45. # path to the rrdtool binary
  46. rrdtool.binary = "/usr/bin/rrdtool"
  47. # rrd database file
  48. rrdtool.db-name = "/var/lib/rrd/lighttpd.rrd"
  49.  
  50.  
  51.  
  52. ## a static document-root, for virtual-hosting take look at the
  53. ## server.virtual-* options
  54. server.document-root = "/var/www/"
  55.  
  56. ## where to upload files to, purged daily.
  57. server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
  58.  
  59. ## where to send error-messages to
  60. server.errorlog = "/var/log/lighttpd/error.log"
  61.  
  62. ## files to check for if .../ is requested
  63. index-file.names = ( "index.php", "index.html",
  64. "index.htm", "default.htm",
  65. "index.lighttpd.html" )
  66.  
  67.  
  68. #### accesslog module
  69. accesslog.filename = "/var/log/lighttpd/access.log"
  70.  
  71. accesslog.format = "%h %V %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"
  72. "
  73.  
  74.  
  75. upload-progress.progress-url = "/progress"
  76. upload-progress.remove-timeout = 30
  77. upload-progress.debug = "disable"
  78.  
  79.  
  80. ##deny access the file-extensions
  81. # ~ is for backupfiles from vi, emacs, joe, ...
  82. # .inc is often used for code includes which should in general not be part of the document-root
  83. url.access-deny = ("~", ".inc", ".db", ".tpl.php", ".cls.php",)
  84.  
  85.  
  86. mimetype.assign = (
  87. ".pdf" => "application/pdf",
  88. ".sig" => "application/pgp-signature",
  89. ".spl" => "application/futuresplash",
  90. ".class" => "application/octet-stream",
  91. ".ps" => "application/postscript",
  92. ".torrent" => "application/x-bittorrent",
  93. ".dvi" => "application/x-dvi",
  94. ".gz" => "application/x-gzip",
  95. ".pac" => "application/x-ns-proxy-autoconfig",
  96. ".swf" => "application/x-shockwave-flash",
  97. ".tar.gz" => "application/x-tgz",
  98. ".tgz" => "application/x-tgz",
  99. ".tar" => "application/x-tar",
  100. ".zip" => "application/zip",
  101. ".mp3" => "audio/mpeg",
  102. ".m3u" => "audio/x-mpegurl",
  103. ".wma" => "audio/x-ms-wma",
  104. ".wax" => "audio/x-ms-wax",
  105. ".ogg" => "application/ogg",
  106. ".wav" => "audio/x-wav",
  107. ".gif" => "image/gif",
  108. ".jpg" => "image/jpeg",
  109. ".jpeg" => "image/jpeg",
  110. ".png" => "image/png",
  111. ".xbm" => "image/x-xbitmap",
  112. ".xpm" => "image/x-xpixmap",
  113. ".xwd" => "image/x-xwindowdump",
  114. ".css" => "text/css",
  115. ".html" => "text/html",
  116. ".htm" => "text/html",
  117. ".js" => "text/javascript",
  118. ".asc" => "text/plain",
  119. ".c" => "text/plain",
  120. ".cpp" => "text/plain",
  121. ".log" => "text/plain",
  122. ".conf" => "text/plain",
  123. ".text" => "text/plain",
  124. ".txt" => "text/plain",
  125. ".spec" => "text/plain",
  126. ".dtd" => "text/xml",
  127. ".xml" => "text/xml",
  128. ".mpeg" => "video/mpeg",
  129. ".mpg" => "video/mpeg",
  130. ".mov" => "video/quicktime",
  131. ".qt" => "video/quicktime",
  132. ".avi" => "video/x-msvideo",
  133. ".asf" => "video/x-ms-asf",
  134. ".asx" => "video/x-ms-asf",
  135. ".wmv" => "video/x-ms-wmv",
  136. ".bz2" => "application/x-bzip",
  137. ".tbz" => "application/x-bzip-compressed-tar",
  138. ".tar.bz2" => "application/x-bzip-compressed-tar",
  139. ".odt" => "application/vnd.oasis.opendocument.text",
  140. ".ods" => "application/vnd.oasis.opendocument.spreadsheet",
  141. ".odp" => "application/vnd.oasis.opendocument.presentation",
  142. ".odg" => "application/vnd.oasis.opendocument.graphics",
  143. ".odc" => "application/vnd.oasis.opendocument.chart",
  144. ".odf" => "application/vnd.oasis.opendocument.formula",
  145. ".odi" => "application/vnd.oasis.opendocument.image",
  146. ".odm" => "application/vnd.oasis.opendocument.text-master",
  147. ".ott" => "application/vnd.oasis.opendocument.text-template",
  148. ".ots" => "application/vnd.oasis.opendocument.spreadsheet-template",
  149. ".otp" => "application/vnd.oasis.opendocument.presentation-template",
  150. ".otg" => "application/vnd.oasis.opendocument.graphics-template",
  151. ".otc" => "application/vnd.oasis.opendocument.chart-template",
  152. ".otf" => "application/vnd.oasis.opendocument.formula-template",
  153. ".oti" => "application/vnd.oasis.opendocument.image-template",
  154. ".oth" => "application/vnd.oasis.opendocument.text-web",
  155.  
  156. )
  157.  
  158. # which extensions should not be handle via static-file transfer
  159. # .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
  160. static-file.exclude-extensions = ( ".php", ".fcgi" )
  161.  
  162.  
  163. ## bind to port (default: 80)
  164. #server.port = 80
  165. ##server.use-ipv6 = "enable"
  166.  
  167. $SERVER["socket"] == ":80" {
  168. accesslog.filename = "/var/log/lighttpd/access.log"
  169. }
  170.  
  171.  
  172. $SERVER["socket"] == "[::]:80" {
  173. accesslog.filename = "/var/log/lighttpd/accessipv6.log"
  174. }
  175.  
  176.  
  177.  
  178. ## bind to localhost only (default: all interfaces)
  179. ##server.bind = "eth0"
  180.  
  181. ## error-handler for status 404
  182. #server.error-handler-404 = "/error-handler.html"
  183. #server.error-handler-404 = "/error-handler.php"
  184.  
  185. ## to help the rc.scripts
  186. server.pid-file = "/var/run/lighttpd.pid"
  187.  
  188. ## Format: <errorfile-prefix><status>.html
  189. ## -> ..../status-404.html for 'File not found'
  190. #server.errorfile-prefix = "/var/www/"
  191.  
  192. ## virtual directory listings
  193. dir-listing.encoding = "utf-8"
  194. server.dir-listing = "enable"
  195. dir-listing.show-header = "enable"
  196. dir-listing.hide-header-file = "enable"
  197. dir-listing.external-css = "/dir-listing.css"
  198. dir-listing.show-readme = "enable"
  199. dir-listing.hide-readme-file = "enable"
  200. dir-listing.hide-dotfiles = "enable"
  201.  
  202.  
  203. ## change uid to <uid> (default: don't care)
  204. server.username = "www-data"
  205.  
  206. ## change uid to <uid> (default: don't care)
  207. server.groupname = "www-data"
  208.  
  209. #### compress module
  210. compress.cache-dir = "/var/cache/lighttpd/compress/"
  211. compress.filetype = ("text/plain", "text/html", "application/x-javascript", "text/css")
  212.  
  213.  
  214.  
  215.  
  216. #### external configuration files
  217. ## mimetype mapping
  218. #include_shell "/usr/share/lighttpd/create-mime.assign.pl"
  219.  
  220. ## load enabled configuration files,
  221. ## read /etc/lighttpd/conf-available/README first
  222. #include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
  223.  
  224. server.tag = "lighttpd" ## added, required .... can change to anything
  225.  
  226.  
  227. ## no-www Class-B complaint
  228. $HTTP["host"] =~ "^www\.(.*)$" {
  229. url.redirect = ( "^/(.*)" => "http://%1/$1" )
  230. }
  231.  
  232.  
  233.  
  234.  
  235. #### handle Debian Policy Manual, Section 11.5. urls
  236. ## by default allow them only from localhost
  237. ## (This must come last due to #445459)
  238. ## Note: =~ "127.0.0.1" works with ipv6 enabled, whereas == "127.0.0.1" doesn't
  239. $HTTP["remoteip"] =~ "127.0.0.1" {
  240. alias.url += (
  241. "/doc/" => "/usr/share/doc/",
  242. "/images/" => "/usr/share/images/"
  243. )
  244. $HTTP["url"] =~ "^/doc/|^/images/" {
  245. dir-listing.activate = "enable"
  246. }
  247. }
  248.  
  249.  
  250.  
  251. ##Expire mod for caching files.
  252. $HTTP["url"] =~ "(css|js|png|jpg|ico|gif)$" {
  253. expire.url = ( "" => "access 7 days" )
  254. }
  255.  
  256. etag.use-inode = "enable"
  257. etag.use-mtime = "enable"
  258. etag.use-size = "enable"
  259. ##static-file.etags = "enable"
  260.  
  261.  
  262.  
  263. $HTTP["host"] =~ "(^|\.)harryy\.us$" {
  264. server.document-root = "/var/www/harryy.us"
  265. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement