Skip to content

Instantly share code, notes, and snippets.

@alghanmi
Last active March 2, 2022 19:21
Show Gist options
  • Select an option

  • Save alghanmi/3045812 to your computer and use it in GitHub Desktop.

Select an option

Save alghanmi/3045812 to your computer and use it in GitHub Desktop.
Lighttpd Default Configuration File
server.port = 80
#server.bind = ""
server.tag ="lighttpd"
server.modules = (
"mod_access",
"mod_alias",
"mod_accesslog",
"mod_compress",
"mod_expire",
"mod_redirect",
"mod_rewrite"
)
server.document-root = "/var/www/"
index-file.names = ( "index.php", "index.py", "index.html" )
accesslog.filename = "/var/log/lighttpd/access.log"
server.errorlog = "/var/log/lighttpd/error.log"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.username = "www-data"
server.groupname = "www-data"
server.pid-file = "/var/run/lighttpd.pid"
## Deny access to the source code of these files:
static-file.exclude-extensions = ( ".php", ".pl", ".py", ".fcgi" )
## Deny access the file-extensions
url.access-deny = ( "~", ".inc" )
## Enable/Disable Directory Listings
dir-listing.encoding = "utf-8"
dir-listing.activate = "disable"
dir-listing.hide-dotfiles = "enable"
## eTags
etag.use-inode = "enable"
etag.use-mtime = "enable"
etag.use-size = "enable"
static-file.etags = "enable"
## Compress module
compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ( "text/plain", "text/html", "text/css", "text/xml", "text/x-js", "text/javascript", "application/x-javascript", "application/javascript" )
## Expire Models
$HTTP["url"] =~ "(css|js|png|jpg|ico|gif)$" {
expire.url = ( "" => "access 7 days" )
}
#expire.url = (
# "/images/" => "access plus 7 days",
# "/jquery/" => "access plus 2 weeks",
# "/js/" => "access plus 2 months",
# "/misc" => "access plus 1 days",
# "/themes/" => "access plus 7 days",
# "/modules/" => "access plus 24 hours"
#)
## Enable PHP
fastcgi.server = ( ".php" => ((
"bin-path" => "/usr/bin/php-cgi",
"socket" => "/tmp/php.socket"
)))
## Load enabled configuration files
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
include_shell "/usr/local/share/lighttpd/include-sites-enabled.pl"
@OliveIT
Copy link
Copy Markdown

OliveIT commented Nov 27, 2018

How to enable HTTPS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment