Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ############ Options you really have to take care of ####################
- ## modules to load
- # mod_access, mod_accesslog and mod_alias are loaded by default
- # all other module should only be loaded if neccesary
- # - saves some time
- # - saves memory
- server.modules = (
- "mod_access",
- "mod_alias",
- "mod_accesslog",
- "mod_compress",
- "mod_rewrite",
- "mod_redirect",
- "mod_expire",
- "mod_uploadprogress",
- "mod_proxy_core",
- "mod_cgi",
- "mod_proxy_backend_fastcgi"
- )
- $HTTP["url"] !~ "^/upload/uploaded/" {
- $HTTP["url"] =~ "\.php$" {
- proxy-core.balancer = "round-robin"
- proxy-core.allow-x-sendfile = "enable"
- proxy-core.protocol = "fastcgi"
- proxy-core.backends = ( "unix:/tmp/php-fastcgi.sock" )
- proxy-core.max-pool-size = 16
- }
- }
- ##connection.kbytes-per-second=50
- server.kbytes-per-second = 9001
- server.max-worker = 50
- server.modules += ( "mod_rrdtool" )
- ### RRDTOOL Config
- # path to the rrdtool binary
- rrdtool.binary = "/usr/bin/rrdtool"
- # rrd database file
- rrdtool.db-name = "/var/lib/rrd/lighttpd.rrd"
- ## a static document-root, for virtual-hosting take look at the
- ## server.virtual-* options
- server.document-root = "/var/www/"
- ## where to upload files to, purged daily.
- server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
- ## where to send error-messages to
- server.errorlog = "/var/log/lighttpd/error.log"
- ## files to check for if .../ is requested
- index-file.names = ( "index.php", "index.html",
- "index.htm", "default.htm",
- "index.lighttpd.html" )
- #### accesslog module
- accesslog.filename = "/var/log/lighttpd/access.log"
- accesslog.format = "%h %V %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"
- "
- upload-progress.progress-url = "/progress"
- upload-progress.remove-timeout = 30
- upload-progress.debug = "disable"
- ##deny access the file-extensions
- # ~ is for backupfiles from vi, emacs, joe, ...
- # .inc is often used for code includes which should in general not be part of the document-root
- url.access-deny = ("~", ".inc", ".db", ".tpl.php", ".cls.php",)
- mimetype.assign = (
- ".pdf" => "application/pdf",
- ".sig" => "application/pgp-signature",
- ".spl" => "application/futuresplash",
- ".class" => "application/octet-stream",
- ".ps" => "application/postscript",
- ".torrent" => "application/x-bittorrent",
- ".dvi" => "application/x-dvi",
- ".gz" => "application/x-gzip",
- ".pac" => "application/x-ns-proxy-autoconfig",
- ".swf" => "application/x-shockwave-flash",
- ".tar.gz" => "application/x-tgz",
- ".tgz" => "application/x-tgz",
- ".tar" => "application/x-tar",
- ".zip" => "application/zip",
- ".mp3" => "audio/mpeg",
- ".m3u" => "audio/x-mpegurl",
- ".wma" => "audio/x-ms-wma",
- ".wax" => "audio/x-ms-wax",
- ".ogg" => "application/ogg",
- ".wav" => "audio/x-wav",
- ".gif" => "image/gif",
- ".jpg" => "image/jpeg",
- ".jpeg" => "image/jpeg",
- ".png" => "image/png",
- ".xbm" => "image/x-xbitmap",
- ".xpm" => "image/x-xpixmap",
- ".xwd" => "image/x-xwindowdump",
- ".css" => "text/css",
- ".html" => "text/html",
- ".htm" => "text/html",
- ".js" => "text/javascript",
- ".asc" => "text/plain",
- ".c" => "text/plain",
- ".cpp" => "text/plain",
- ".log" => "text/plain",
- ".conf" => "text/plain",
- ".text" => "text/plain",
- ".txt" => "text/plain",
- ".spec" => "text/plain",
- ".dtd" => "text/xml",
- ".xml" => "text/xml",
- ".mpeg" => "video/mpeg",
- ".mpg" => "video/mpeg",
- ".mov" => "video/quicktime",
- ".qt" => "video/quicktime",
- ".avi" => "video/x-msvideo",
- ".asf" => "video/x-ms-asf",
- ".asx" => "video/x-ms-asf",
- ".wmv" => "video/x-ms-wmv",
- ".bz2" => "application/x-bzip",
- ".tbz" => "application/x-bzip-compressed-tar",
- ".tar.bz2" => "application/x-bzip-compressed-tar",
- ".odt" => "application/vnd.oasis.opendocument.text",
- ".ods" => "application/vnd.oasis.opendocument.spreadsheet",
- ".odp" => "application/vnd.oasis.opendocument.presentation",
- ".odg" => "application/vnd.oasis.opendocument.graphics",
- ".odc" => "application/vnd.oasis.opendocument.chart",
- ".odf" => "application/vnd.oasis.opendocument.formula",
- ".odi" => "application/vnd.oasis.opendocument.image",
- ".odm" => "application/vnd.oasis.opendocument.text-master",
- ".ott" => "application/vnd.oasis.opendocument.text-template",
- ".ots" => "application/vnd.oasis.opendocument.spreadsheet-template",
- ".otp" => "application/vnd.oasis.opendocument.presentation-template",
- ".otg" => "application/vnd.oasis.opendocument.graphics-template",
- ".otc" => "application/vnd.oasis.opendocument.chart-template",
- ".otf" => "application/vnd.oasis.opendocument.formula-template",
- ".oti" => "application/vnd.oasis.opendocument.image-template",
- ".oth" => "application/vnd.oasis.opendocument.text-web",
- )
- # which extensions should not be handle via static-file transfer
- # .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
- static-file.exclude-extensions = ( ".php", ".fcgi" )
- ## bind to port (default: 80)
- #server.port = 80
- ##server.use-ipv6 = "enable"
- $SERVER["socket"] == ":80" {
- accesslog.filename = "/var/log/lighttpd/access.log"
- }
- $SERVER["socket"] == "[::]:80" {
- accesslog.filename = "/var/log/lighttpd/accessipv6.log"
- }
- ## bind to localhost only (default: all interfaces)
- ##server.bind = "eth0"
- ## error-handler for status 404
- #server.error-handler-404 = "/error-handler.html"
- #server.error-handler-404 = "/error-handler.php"
- ## to help the rc.scripts
- server.pid-file = "/var/run/lighttpd.pid"
- ## Format: <errorfile-prefix><status>.html
- ## -> ..../status-404.html for 'File not found'
- #server.errorfile-prefix = "/var/www/"
- ## virtual directory listings
- dir-listing.encoding = "utf-8"
- server.dir-listing = "enable"
- dir-listing.show-header = "enable"
- dir-listing.hide-header-file = "enable"
- dir-listing.external-css = "/dir-listing.css"
- dir-listing.show-readme = "enable"
- dir-listing.hide-readme-file = "enable"
- dir-listing.hide-dotfiles = "enable"
- ## change uid to <uid> (default: don't care)
- server.username = "www-data"
- ## change uid to <uid> (default: don't care)
- server.groupname = "www-data"
- #### compress module
- compress.cache-dir = "/var/cache/lighttpd/compress/"
- compress.filetype = ("text/plain", "text/html", "application/x-javascript", "text/css")
- #### external configuration files
- ## mimetype mapping
- #include_shell "/usr/share/lighttpd/create-mime.assign.pl"
- ## load enabled configuration files,
- ## read /etc/lighttpd/conf-available/README first
- #include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
- server.tag = "lighttpd" ## added, required .... can change to anything
- ## no-www Class-B complaint
- $HTTP["host"] =~ "^www\.(.*)$" {
- url.redirect = ( "^/(.*)" => "http://%1/$1" )
- }
- #### handle Debian Policy Manual, Section 11.5. urls
- ## by default allow them only from localhost
- ## (This must come last due to #445459)
- ## Note: =~ "127.0.0.1" works with ipv6 enabled, whereas == "127.0.0.1" doesn't
- $HTTP["remoteip"] =~ "127.0.0.1" {
- alias.url += (
- "/doc/" => "/usr/share/doc/",
- "/images/" => "/usr/share/images/"
- )
- $HTTP["url"] =~ "^/doc/|^/images/" {
- dir-listing.activate = "enable"
- }
- }
- ##Expire mod for caching files.
- $HTTP["url"] =~ "(css|js|png|jpg|ico|gif)$" {
- expire.url = ( "" => "access 7 days" )
- }
- etag.use-inode = "enable"
- etag.use-mtime = "enable"
- etag.use-size = "enable"
- ##static-file.etags = "enable"
- $HTTP["host"] =~ "(^|\.)harryy\.us$" {
- server.document-root = "/var/www/harryy.us"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement