Commit e81cb0d9 authored by José Luis  Gutiérrez's avatar José Luis Gutiérrez Committed by Alessandro Rubini

userspace: lighthttpd configuration and start script

Added file S80lighttpd.sh to init.d in order to run lighttpd
daemon at switch start-up.

Added lighttpd.config that contains the configuration file
required by lighttpd and S80lighttpd.sh to run the lighttpd
daemon on the switch.
parent 9fb15841
#!/bin/ash
#
# Starts lighttpd daemon.
#
start() {
echo -n "Starting lighttpd daemon: "
/usr/sbin/lighttpd -f /var/www/lighttpd.config
echo "OK"
}
stop() {
echo -n "Stopping lighttpd daemon: "
killall lighttpd
echo "OK"
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?
server.document-root = "/var/www"
server.port = 80
#server.username = "www"
#server.groupname = "www"
## modules to load
# at least mod_access and mod_accesslog should be loaded
# all other module should only be loaded if really neccesary
# - saves some time
# - saves memory
server.modules = (
"mod_rewrite",
"mod_redirect",
# "mod_alias",
"mod_access",
# "mod_cml",
# "mod_trigger_b4_dl",
# "mod_auth",
# "mod_status",
# "mod_setenv",
"mod_fastcgi",
# "mod_proxy",
# "mod_simple_vhost",
# "mod_evhost",
# "mod_userdir",
"mod_cgi",
# "mod_compress",
# "mod_ssi",
# "mod_usertrack",
# "mod_expire",
# "mod_secdownload",
# "mod_rrdtool",
"mod_accesslog" )
mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
".jpg" => "image/jpeg",
".png" => "image/png",
".css" => "text/css"
)
#### CGI module
cgi.assign = ( ".pl" => "/usr/bin/perl",
".cgi" => "/usr/bin/perl",
"/admin" => "",
"/admindb" => "",
"/confirm" => "",
"/create" => "",
"/edithtml" => "",
"/listinfo" => "",
"/options" => "",
"/private" => "",
"/rmlist" => "",
"/roster" => "",
"/subscribe" => "" )
#### fastcgi module
## read fastcgi.txt for more info
## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
#fastcgi.server = ( ".php" =>
# ( "localhost" =>
# (
# "socket" => "/tmp/php-fastcgi.socket",
# "bin-path" => "/usr/bin/php"
# )
# )
# )
#### url handling modules (rewrite, redirect, access)
#url.rewrite = ( "^/$" => "/server-status" )
#url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
#### both rewrite/redirect support back reference to regex conditional using %n
#$HTTP["host"] =~ "^www\.(.*)" {
# url.redirect = ( "^/(.*)" => "http://%1/$1" )
#}
static-file.exclude-extensions = ( ".cgi", ".fcgi", ".php", ".rb", "~", ".inc" )
index-file.names = ( "index.html", "index.php" )
$HTTP["host"] == "www2.example.org" {
server.document-root = "/var/www/"
$HTTP["url"] =~ "^/download/" {
dir-listing.activate = "enable"
}
}
#### accesslog module
accesslog.filename = "/var/log/access_lighttpd.log"
############# experimentos ##################
#url.rewrite = ( "^/([a-z]+)/([a-z]+)(\?*)(.*)" => "/index.html?url=$2&$4" )
url.rewrite = ("(css|files|img|js)/(.*)" => "/$1/$2")
fastcgi.server = ( ".php" => ((
"bin-path" => "/usr/bin/php-cgi",
"socket" => "/tmp/php.socket",
"max-procs" => 1,
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "16",
"PHP_FCGI_MAX_REQUESTS" => "10000"
),
"broken-scriptfilename" => "enable"
# )),
# "/cgi-bin/" =>
# ((
# "socket" => "/tmp/php.socket1",
# "bin-path" => "/var/www/test.cgi",
# "check-local" => "disable",
# "max-procs" => 1
)))
#### compress module
#compress.cache-dir = "/tmp/lighttpd_tmp/"
#compress.filetype = ("text/plain", "text/html", "text/css", "image/png")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment