############################################################################### # Default lighttpd.conf for Gentoo. ############################################################################### var.basedir = "/var/http/splash/" var.logdir = "/var/log/lighttpd" var.statedir = "/var/lib/lighttpd" server.modules = ( "mod_expire", "mod_setenv", "mod_auth", "mod_rewrite", "mod_redirect", "mod_alias", "mod_access", "mod_fastcgi", "mod_cgi", "mod_openssl", ) # fcgi and cgi are included below include "mime-types.conf" server.username = "lighttpd" server.groupname = "lighttpd" server.document-root = var.basedir server.pid-file = "/var/run/lighttpd.pid" server.errorlog = var.logdir + "/error.log" server.indexfiles = ("index.php", "index.html" ) server.follow-symlink = "enable" $HTTP["host"] == "yumi.ral.space" { server.document-root = "/var/http/yumi/" server.error-log = var.logdir + "/diary-error.log" } $HTTP["host"] == "raamen.org" { server.document-root = "/var/http/raamen.org/www" server.error-log = var.logdir + "/raamen-error.log" auth.backend = "plain" auth.backend.plain.userfile = "/var/http/raamen.org/door.users" auth.require = ( "" => ( "method" => "basic", "realm" => "Raamen", "require" => "valid-user" ), ) } $HTTP["host"] =~ "ralee.org|f22glwrndpxkacwp.onion" { server.document-root = "/var/http/hub/ral/www" server.error-log = var.logdir + "/ral-error.log" fastcgi.server = ( ".php" => (( "socket" => "/var/run/lighttpd/php-fpm-ral.sock", ))) # Effective ad campaign tracking url.redirect = ("^/ad/cyber$" => "/") # /r/cyberpunk Feb 9-10, 2018 url.rewrite-if-not-file = ( "^\/view\/([\w\s]+)\/([\d]+)\/([\d]+)\/([\d\-,]+)$" => "/view.php?continuity=$1&year=$2&topic=$3&replies=$4" ) url.rewrite-if-not-file += ( "^\/view\/([\w\s]+)\/([\d]+)\/([\d]+)$" => "/view.php?continuity=$1&year=$2&topic=$3" ) url.rewrite-if-not-file += ( "^\/view\/([\w\s]+)\/([\d]+)$" => "/view.php?continuity=$1&year=$2" ) url.rewrite-if-not-file += ( "^\/view\/([\w\s]+)$" => "/view.php?continuity=$1" ) url.rewrite-if-not-file += ( "^\/composer\/([\w\s]+)\/([\d]+)\/([\d]+)$" => "/composer.php?continuity=$1&year=$2&topic=$3" ) url.rewrite-if-not-file += ( "^\/composer\/([\w\s]+)\/([\d]+)$" => "/composer.php?continuity=$1&year=$2" ) url.rewrite-if-not-file += ( "^\/composer\/([\w\s]+)$" => "/composer.php?continuity=$1" ) url.rewrite-if-not-file += ( "^\/search\/([^\/]+)$" => "/search.php?query=$1" ) url.rewrite-if-not-file += ( "^\/search$" => "/search.php" ) url.rewrite-if-not-file += ( "^\/api(.*)$" => "/api.php?$1" ) url.rewrite-if-not-file += ( "^\/rss(.*)$" => "/rss.php?$1" ) url.rewrite-if-not-file += ( "^\/config(.*)$" => "/config.php?$1" ) url.rewrite-if-not-file += ( "^\/sitemap(.*)$" => "/sitemap.php?$1" ) url.rewrite-if-not-file += ( "^\/bbcode-help(.*)$" => "/bbcode-help.php?$1" ) url.rewrite-if-not-file += ( "^\/(\?.*)?$" => "index.php$1" ) $HTTP["url"] =~ "^/css|^/continuities|^/res" { expire.url = ( "" => "access plus 1 days" ) setenv.add-response-header += ( "Cache-Control" => "public, max-age=31536000" ) } server.stream-response-body = 1 } $HTTP["host"] == "wesleycoakley.com" { server.document-root = "/var/http/wesleycoakley.com" server.error-log = var.logdir + "/personal-error.log" } $HTTP["host"] == "www4.howler.space" { server.document-root = "/var/a/www4" server.error-log = var.logdir + "/www4-error.log" url.rewrite-if-not-file = ( "^/(~(.)[^/]+)(.*)$" => "/$2/$1$3" ) } $HTTP["host"] == "irc.ral.space" { url.rewrite-once = ( "^/$" => "/irc.cgi" ) cgi.assign = ( ".cgi" => "/usr/bin/perl" ) server.document-root = "/var/http/irc/" server.error-log = var.logdir + "/ral-irc-error.log" server.stream-response-body = 1 } $HTTP["host"] == "cdn.prettyboytellem.com" { server.document-root = "/var/a/cdn" dir-listing.activate = "enable" expire.url = ( "" => "access plus 1 days" ) setenv.add-response-header += ( "Cache-Control" => "public, max-age=31536000" ) } $HTTP["host"] =~ "cdn.raamen.org" { auth.backend = "plain" auth.backend.plain.userfile = "/var/http/raamen.org/raamen.users" auth.require = ( "" => ( "method" => "basic", "realm" => "Raamen", "require" => "valid-user" ), ) url.rewrite-if-not-file = ( "^\/(\/?.*)$" => "/?q=$1" ) server.document-root = "/mnt/world" } $HTTP["host"] == "cdn.wesleycoakley.com" { server.document-root = "/var/a/personal-cdn" expire.url = ( "" => "access plus 7 days" ) setenv.add-response-header += ( "Cache-Control" => "public, max-age=31536000" ) } $HTTP["host"] =~ "^prettyboytellem.com|wohwsqxxrctfp4ku.onion" { server.document-root = "/var/http/prettyboytellem.com" server.error-log = var.logdir + "/prettyboytellem-error.log" alias.url += ( "/git" => "/usr/lib/git-core/git-http-backend") # prevent a request to "/git" from causing a 500 error (no PATH_INFO) url.rewrite-once = ( "^/git$" => "/git/" ) $HTTP["url"] =~ "^/git" { # turn on CGI unconditionally for this URL cgi.assign = ( "" => "" ) setenv.add-environment = ( "GIT_PROJECT_ROOT" => "/var/git", "GIT_HTTP_EXPORT_ALL" => "" ) } url.rewrite-if-not-file = ( "^\/writing(\/?.*)$" => "/writing/?path=$1" ) } $HTTP["host"] == "bbdiary.prettyboytellem.com" { server.document-root = "/var/http/bbdiary" server.error-log = var.logdir + "/bbdiary-error.log" url.rewrite-if-not-file = ( "^(.*)$" => "/?path=$1" ) } $HTTP["host"] == "bigmike.space" { server.document-root = "/var/http/hub" server.error-log = var.logdir + "/bigmike-error.log" alias.url += ( "/a/" => "/var/a/http/" ) # alias.url += ( "/git" => "/usr/lib/git-core/git-http-backend") # prevent a request to "/git" from causing a 500 error (no PATH_INFO) # url.rewrite-once = ( "^/git$" => "/git/" ) # $HTTP["url"] =~ "^/git" { # # turn on CGI unconditionally for this URL # cgi.assign = ( "" => "" ) # setenv.add-environment = ( # "GIT_PROJECT_ROOT" => "/var/git", # "GIT_HTTP_EXPORT_ALL" => "" # ) # } server.max-request-size = 1048576 } $HTTP["host"] == "hooya.space" { server.document-root = "/var/http/hooya.space" server.error-log = var.logdir + "/hooya-error.log" server.max-request-size = 1048576 } # listen to ipv4 server.bind = "0.0.0.0" server.port = "80" # listen to ipv6 $SERVER["socket"] == "[::]:80" { } # which extensions should not be handled via static-file transfer static-file.exclude-extensions = (".php", ".pl", ".cgi", ".fcgi") url.access-deny = ("~", ".inc") fastcgi.server = ( ".php" => (( "socket" => "/var/run/lighttpd/php-fpm.sock", "allow-x-send-file" => "enable" )))