- cat lighttpd.conf
- var.server_root = "/usr/local/lighttpd"
- var.log_root = "/data/html/logs"
- compress.filetype = ("text/plain", "text/html")
- server.modules = (
- "mod_access",
- "mod_accesslog",
- "mod_rewrite",
- "mod_redirect",
- "mod_alias",
- "mod_fastcgi",
- "mod_simple_vhost",
- "mod_evhost",
- "mod_expire",
- "mod_compress",
- "mod_cgi",
- "mod_auth",
- )
- server.port = 80
- server.use-ipv6 = "disable"
- server.username = "nobody"
- server.groupname = "nobody"
- server.document-root = server_root + "/htdocs"
- server.pid-file = server_root + "/var/lighttpd.pid"
- server.errorlog = log_root + "/error.log"
- accesslog.filename = log_root + "/access.log"
- server.event-handler = "linux-sysepoll"
- server.network-backend = "linux-sendfile"
- server.max-fds = 2048
- server.max-worker = 5
- server.stat-cache-engine = "fam"
- server.max-connections = 1024
- server.max-request-size = 20000000
- server.follow-symlink = "enable"
- server.upload-dirs = ( server_root + "/var/upload-dirs" )
- index-file.names += (
- "index.php","index.xhtml", "index.html", "index.htm", "default.htm"
- )
- url.access-deny = ( "~", ".inc" )
- $HTTP["url"] =~ "\.pdf$" {
- server.range-requests = "disable"
- }
- $HTTP["url"] =~ "(\.png|\.css|\.js|\.jpg|\.gif)$"{
- expire.url = ( "" => "access 2 days" )
- }
- static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".scgi" )
- fastcgi.server = ( ".php" =>
- ( "local" =>
- ( "socket" => server_root + "/var/sockets/fastcgi.socket",
- "bin-path" => "/usr/local/php/bin/php-cgi",
- "max-procs" => 5,
- "broken-scriptfilename" => "enable",
- )
- )
- )
- include "conf.d/mime.conf"
- include "conf.d/dirlisting.conf"
- include "vhosts.d/example.com.conf"
- include "vdir.conf"
- cat example.com.conf
- $HTTP["host"] == "www.example.com" {
- server_name = "www.example.com"
- server.name = server_name
- server.document-root = "/data/html/example"
- accesslog.filename = "/data/html/logs/example-access.log"
- server.errorlog = "/data/html/logs/example-error.log"
- }
- cat vdir.conf
- alias.url += ( "/cacti" => "/data/html/cacti/",
- "/pureftpd" => "/data/html/pureftpd",
- "/ping" => "/usr/local/smokeping/htdocs",
- "/nagios/cgi-bin" => "/usr/local/nagios/sbin",
- "/nagios" => "/data/html/nagios",
- )
- $HTTP["url"] =~ "^\/cacti\/"{
- accesslog.filename = log_root + "/cacti-access.log"
- server.errorlog = log_root + "/cacti-error.log"
- auth.debug = 0
- auth.backend = "htpasswd"
- auth.backend.htpasswd.userfile = "/data/html/.htpasswd/cacti.htpasswd"
- auth.require = ( "" =>
- ( "method" => "basic",
- "realm" => "cacti",
- "require" => "valid-user"
- )
- )
- }
- $HTTP["url"] =~ "^\/pureftpd\/"{
- accesslog.filename = log_root + "/pureftpd-access.log"
- server.errorlog = log_root + "/pureftpd-error.log"
- auth.debug = 0
- auth.backend = "htpasswd"
- auth.backend.htpasswd.userfile = "/data/html/.htpasswd/pureftpd.htpasswd"
- auth.require = ( "" =>
- ( "method" => "basic",
- "realm" => "pureftpd",
- "require" => "valid-user"
- )
- )
- }
- $HTTP["url"] =~ "^\/ping\/"{
- accesslog.filename = log_root + "/smokeping-access.log"
- server.errorlog = log_root + "/smokeping-error.log"
- cgi.assign = ( ".cgi" => "/usr/bin/speedy" )
- index-file.names = ( "index.html", "smokeping.cgi" )
- $HTTP["request-method"] != "POST" {
- auth.debug = 0
- auth.backend = "htpasswd"
- auth.backend.htpasswd.userfile = "/data/html/.htpasswd/smokeping.htpasswd"
- auth.require = ( "" =>
- ( "method" => "basic",
- "realm" => "smokeping",
- "require" => "valid-user"
- )
- )
- }
- }
- $HTTP["url"] =~ "^\/nagios\/"{
- accesslog.filename = log_root + "/nagios-access.log"
- server.errorlog = log_root + "/nagios-error.log"
- $HTTP["url"] =~ "^\/nagios\/cgi-bin\/" {
- cgi.assign = ( ".cgi" => "" )
- }
- auth.debug = 0
- auth.backend = "htpasswd"
- auth.backend.htpasswd.userfile = "/data/html/.htpasswd/nagios.htpasswd"
- auth.require = ( "" =>
- ( "method" => "basic",
- "realm" => "nagios",
- "require" => "valid-user"
- )
- )
- }