2012-04-14 16:22:27 +02:00
|
|
|
## Configuration for Piratebox
|
|
|
|
|
|
|
|
server.modules = (
|
|
|
|
# "mod_access", not needed!
|
2014-07-06 19:54:21 +02:00
|
|
|
"mod_alias",
|
2012-04-14 16:22:27 +02:00
|
|
|
"mod_redirect",
|
2017-03-20 22:21:08 +01:00
|
|
|
"mod_setenv",
|
|
|
|
"mod_cgi",
|
2016-04-26 21:05:20 +02:00
|
|
|
"mod_fastcgi"
|
2012-04-14 16:22:27 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
server.document-root = "/opt/piratebox/www"
|
2015-01-28 12:32:50 +01:00
|
|
|
|
|
|
|
## Locate the tmp storage into tmp. It is in most cases the ram
|
2016-04-26 21:17:14 +02:00
|
|
|
## Limit the uploads to 5MB to save - especially on small devices
|
2015-01-28 12:32:50 +01:00
|
|
|
## the device from dieing because OUT-OF-RAM exceptions
|
2016-04-26 21:17:14 +02:00
|
|
|
## in KB => 5MB
|
2015-01-28 12:32:50 +01:00
|
|
|
server.upload-dirs = ( "/tmp" )
|
2016-04-26 21:17:14 +02:00
|
|
|
server.max-request-size = 5120
|
2015-01-28 12:32:50 +01:00
|
|
|
|
2012-04-14 16:22:27 +02:00
|
|
|
server.errorlog = "/opt/piratebox/tmp/error.log"
|
2012-04-14 17:24:55 +02:00
|
|
|
server.breakagelog = "/opt/piratebox/tmp/break.log"
|
2012-04-14 16:22:27 +02:00
|
|
|
server.pid-file = "/opt/piratebox/tmp/lighttpd.pid"
|
|
|
|
|
2017-03-20 22:21:08 +01:00
|
|
|
server.username = "nobody"
|
|
|
|
server.groupname = "nogroup"
|
2012-04-14 16:22:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
index-file.names = ( "index.php", "index.html",
|
|
|
|
"index.htm", "default.htm",
|
|
|
|
" index.lighttpd.html" )
|
|
|
|
|
|
|
|
url.access-deny = ( "~", ".inc" )
|
|
|
|
|
|
|
|
# added .cgi .py
|
2014-06-27 16:39:07 +02:00
|
|
|
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" , ".cgi" , ".py" )
|
2012-04-14 16:22:27 +02:00
|
|
|
|
2013-10-09 12:17:07 +02:00
|
|
|
|
|
|
|
# Enable lighttpd on ipv6
|
|
|
|
$SERVER["socket"] == "[::]:80" { }
|
2012-04-14 16:22:27 +02:00
|
|
|
|
2013-08-21 07:57:53 +02:00
|
|
|
|
2017-03-20 22:21:08 +01:00
|
|
|
# Enable default directory listing
|
|
|
|
include "/opt/piratebox/conf/lighttpd/dirlisting-html.conf"
|
2012-04-14 16:22:27 +02:00
|
|
|
|
|
|
|
#n.a. on router include_shell "/usr/share/lighttpd/create-mime.assign.pl"
|
2012-04-27 07:15:03 +02:00
|
|
|
include "/opt/piratebox/conf/lighttpd/mime.types"
|
2012-04-14 16:22:27 +02:00
|
|
|
|
2012-11-09 08:01:00 +01:00
|
|
|
#----------- ShoutBox-Env --------------
|
|
|
|
include "/opt/piratebox/conf/lighttpd/env"
|
2012-04-14 16:22:27 +02:00
|
|
|
|
|
|
|
#----------- cgi.conf --------------
|
|
|
|
$HTTP["url"] =~ "^/cgi-bin/" {
|
2012-04-14 17:24:55 +02:00
|
|
|
cgi.assign = ( ".py" => "/usr/bin/python" )
|
2012-04-14 16:22:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
## 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/python",
|
|
|
|
#)
|
|
|
|
|
|
|
|
$HTTP["url"] =~ "^/board/" {
|
|
|
|
cgi.assign = ( ".pl" => "/usr/bin/perl" , )
|
|
|
|
}
|
|
|
|
#-------------------------------------
|
|
|
|
|
2017-03-20 22:21:08 +01:00
|
|
|
# Avoid lazy browser caching
|
2017-03-18 17:24:44 +01:00
|
|
|
setenv.add-response-header += ( "Cache-Control" => "max-age=60, must-revalidate, no-store, no-cache, public" )
|
2012-04-14 16:22:27 +02:00
|
|
|
|
|
|
|
# 404 Error Page with redirect
|
2017-03-20 22:21:08 +01:00
|
|
|
include "/opt/piratebox/conf/lighttpd/all-redirect.conf"
|
2012-04-14 16:22:27 +02:00
|
|
|
|
|
|
|
## for better debugging
|
|
|
|
#server.modules += ( "mod_accesslog" )
|
|
|
|
#accesslog.filename = "/opt/piratebox/tmp/access.log"
|
|
|
|
|
|
|
|
|
2013-09-27 15:29:56 +02:00
|
|
|
# Fix for iOS7
|
2017-03-20 22:21:08 +01:00
|
|
|
include "/opt/piratebox/conf/lighttpd/iOS7-fix.conf"
|
2016-04-26 21:05:20 +02:00
|
|
|
|
|
|
|
include "/opt/piratebox/conf/lighttpd/fastcgi-php-generate203.conf"
|
|
|
|
|
|
|
|
## Uncommenting the following line enables PHP for the
|
|
|
|
## complete PirateBox
|
|
|
|
#include "/opt/piratebox/conf/lighttpd/fastcgi-php.conf"
|