munin: fix cgi graph generation #163

Merged
mg merged 47 commits from mchmod into master 2024-08-21 20:54:49 +02:00
Showing only changes of commit af75248af6 - Show all commits

View file

@ -1,24 +1,41 @@
<VirtualHost *:80> <VirtualHost *:80>
ServerName {{ munin_servername }} ServerName {{ munin_servername }}
ServerAlias munin
# Redirect requests without /munin to /munin ServerAdmin info@example.org
RedirectMatch ^/$ /munin/
# Existing configuration for serving /munin DocumentRoot /var/www
Alias /munin /var/cache/munin/www
<Directory /var/cache/munin/www> # Rewrite rules to serve traffic from the root instead of /munin-cgi
Require all granted RewriteEngine On
Options None # Static files
</Directory> RewriteRule ^/favicon.ico /var/cache/munin/www/static/favicon.ico [L]
RewriteRule ^/static/(.*) /var/cache/munin/www/static/$1 [L]
# HTML
RewriteRule ^(/.*\.html)?$ /munin-cgi/munin-cgi-html/$1 [PT]
# Images
RewriteRule ^/munin-cgi/munin-cgi-graph/(.*) /$1
RewriteCond %{REQUEST_URI} !^/static
RewriteRule ^/(.*.png)$ /munin-cgi/munin-cgi-graph/$1 [L,PT]
ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
<Location /munin-cgi/munin-cgi-graph> ScriptAlias /munin-cgi/munin-cgi-html /usr/lib/munin/cgi/munin-cgi-html
Require all granted
<IfModule mod_fcgid.c> <Directory /etc/munin/static>
SetHandler fcgid-script Require all granted
</IfModule> </Directory>
<IfModule !mod_fcgid.c>
SetHandler cgi-script <Directory /usr/lib/munin/cgi>
</IfModule> Require all granted
</Location> <IfModule mod_fcgid.c>
SetHandler fcgid-script
</IfModule>
<IfModule !mod_fcgid.c>
SetHandler cgi-script
</IfModule>
</Directory>
CustomLog /var/log/apache2/munin.example.org-access.log combined
ErrorLog /var/log/apache2/munin.example.org-error.log
</VirtualHost> </VirtualHost>
# http://guide.munin-monitoring.org/en/latest/example/webserver/apache-cgi.html