PirateBoxScripts_Webserver/piratebox/piratebox/conf/lighttpd/lighttpd.conf

91 lines
2.5 KiB
Plaintext

## Configuration for Piratebox
server.modules = (
# "mod_access", not needed!
"mod_alias",
"mod_redirect",
"mod_setenv",
"mod_cgi",
"mod_fastcgi"
)
server.document-root = "/opt/piratebox/www"
## Locate the tmp storage into tmp. It is in most cases the ram
## Limit the uploads to 5MB to save - especially on small devices
## the device from dieing because OUT-OF-RAM exceptions
## in KB => 5MB
server.upload-dirs = ( "/tmp" )
server.max-request-size = 3221225472
server.stream-request-body = 2
server.errorlog = "/opt/piratebox/tmp/error.log"
server.breakagelog = "/opt/piratebox/tmp/break.log"
server.pid-file = "/opt/piratebox/tmp/lighttpd.pid"
server.username = "nobody"
server.groupname = "nogroup"
index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm",
" index.lighttpd.html" )
url.access-deny = ( "~", ".inc" )
# added .cgi .py
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" , ".cgi" , ".py" )
# Enable lighttpd on ipv6
$SERVER["socket"] == "[::]:80" { }
# Enable default directory listing
include "/opt/piratebox/conf/lighttpd/dirlisting-html.conf"
#n.a. on router include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include "/opt/piratebox/conf/lighttpd/mime.types"
#----------- ShoutBox-Env --------------
include "/opt/piratebox/conf/lighttpd/env"
#----------- cgi.conf --------------
$HTTP["url"] =~ "^/cgi-bin/" {
cgi.assign = ( ".py" => "/usr/bin/python2" )
}
## Warning this represents a security risk, as it allow to execute any file
## with a .pl/.py even outside of /usr/lib/cgi-bin.
#
#cgi.assign = (
# ".pl" => "/usr/bin/perl",
# ".py" => "/usr/bin/python2",
#)
$HTTP["url"] =~ "^/board/" {
cgi.assign = ( ".pl" => "/usr/bin/perl" , )
}
#-------------------------------------
# Avoid lazy browser caching
setenv.add-response-header += ( "Cache-Control" => "max-age=60, must-revalidate, no-store, no-cache, public" )
# 404 Error Page with redirect
include "/opt/piratebox/conf/lighttpd/all-redirect.conf"
## for better debugging
#server.modules += ( "mod_accesslog" )
#accesslog.filename = "/opt/piratebox/tmp/access.log"
# Captive Portal fake answers
include "/opt/piratebox/conf/lighttpd/captive_portal.conf"
# New Upload-Feature
include "/opt/piratebox/conf/lighttpd/php-upload.conf"
## Uncommenting the following line enables PHP for the
## complete PirateBox
#include "/opt/piratebox/conf/lighttpd/fastcgi-php.conf"