fixup setup script and lighttpd config

This commit is contained in:
KemoNine 2024-04-24 20:46:32 -04:00
parent 82b39aa012
commit 959e1f67bb

View file

@ -15,8 +15,8 @@ logdir /opt/munin/log
rundir /opt/munin/run
cgitmpdir /opt/munin/cgi-tmp
graph_strategy cron
html_strategy cron
graph_strategy cgi
html_strategy cgi
timeout 15
@ -83,18 +83,19 @@ touch /opt/munin/log/munin-update.log
chown munin: /opt/munin/log/munin-update.log
fi
echo "---------- Setting up lighttpd munin config ----------"
if [ ! -d "/var/run/lighttpd" ] ; then
mkdir /var/run/lighttpd
fi
chown munin: /var/run/lighttpd
if [ ! -f "/opt/munin/lighttpd-munin.conf" ] ; then
cat > /opt/munin/lighttpd-munin.conf <<EOF
server.username = "munin"
server.groupname = "munin"
server.document-root = "/opt/munin/www"
server.port = 2813
server.errorlog = "/dev/stdout"
accesslog.filename = "/dev/stdout"
dir-listing.activate = "disable"
server.follow-symlink = "enable"
server.modules = (
"mod_auth",
"mod_authn_file",
"mod_access",
"mod_accesslog",
"mod_alias",
@ -102,23 +103,7 @@ server.modules = (
"mod_redirect",
"mod_cgi",
"mod_fastcgi",
"mod_auth",
"mod_authn_file",
)
server.pid-file = "/run/lighttpd-munin.pid"
server.follow-symlink = "enable"
index-file.names = ( "index.html", "index.htm" )
url.redirect += ( "^/*$" => "/munin/" )
\$HTTP["url"] =~ "/munin-cgi/munin-cgi-graph" {
alias.url += ( "/munin-cgi/munin-cgi-graph" => "/usr/lib/munin/cgi/munin-cgi-graph" )
cgi.assign = ( "" => "" )
}
alias.url += ( "/munin/static" => "/etc/munin/static" )
alias.url += ( "/munin" => "/opt/munin/www" )
mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
@ -130,6 +115,42 @@ mimetype.assign = (
".png" => "image/png",
"" => "application/octet-stream"
)
index-file.names = ( "index.html", "index.htm" )
server.pid-file = "/run/lighttpd-munin.pid"
server.username = "munin"
server.groupname = "munin"
server.document-root = "/opt/munin/www"
server.port = 2813
url.redirect += ( "^/$" => "/munin/index.html" )
url.redirect += ( "^/munin$" => "/munin/index.html" )
url.redirect += ( "^/munin/$" => "/munin/index.html" )
alias.url += ( "/munin/static" => "/opt/munin/www/static" )
alias.url += ( "/munin" => "/opt/munin/www" )
fastcgi.server += (
"/munin-cgi/munin-cgi-graph" =>
(( "socket" => "/var/run/lighttpd/munin-cgi-graph.sock",
"bin-path" => "/usr/lib/munin/cgi/munin-cgi-graph",
"check-local" => "disable",
)),
"/munin-cgi/munin-cgi-html" =>
(( "socket" => "/var/run/lighttpd/munin-cgi-html.sock",
"bin-path" => "/usr/lib/munin/cgi/munin-cgi-html",
"check-local" => "disable",
))
)
\$HTTP["url"] !~ "/static/.*$" {
\$HTTP["url"] !~ "/munin-cgi/.*$" {
url.rewrite-once += (
"/munin/(.*\.html)" => "/munin-cgi/munin-cgi-html/\$1",
"/munin-cgi/munin-cgi-html$" => "/munin-cgi/munin-cgi-html/",
)
}
}
EOF
fi
echo "---------- Munin node setup ----------"