Skip to content

Instantly share code, notes, and snippets.

@gakhov
Last active August 29, 2015 14:00
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save gakhov/11404531 to your computer and use it in GitHub Desktop.
munin 2.0 apache conf
Alias /munin /var/cache/munin/www
<Directory /var/cache/munin/www>
# Rewrite rules to serve traffic from the root instead of /munin-cgi
RewriteEngine On
# Static files
RewriteRule ^/favicon.ico /var/cache/munin/www/static/favicon.ico [L]
RewriteRule ^/static/(.*) /var/cache/munin/www/static/$1 [L]
# HTML
RewriteRule ^$ /munin-cgi/munin-cgi-html/index.html [PT]
RewriteCond %{REQUEST_URI} !^/munin/static
RewriteRule ^(.*.html)$ /munin-cgi/munin-cgi-html/$1 [L,PT]
# Images
RewriteRule ^/munin-cgi/munin-cgi-graph/(.*) /$1
RewriteCond %{REQUEST_URI} !^/munin/static
RewriteRule ^/(.*.png)$ /munin-cgi/munin-cgi-graph/$1 [L,PT]
</Directory>
# Ensure we can run (fast)cgi scripts
ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
<Location /munin-cgi/munin-cgi-graph>
Options +ExecCGI
<IfModule mod_fcgid.c>
SetHandler fcgid-script
</IfModule>
<IfModule mod_fastcgi.c>
SetHandler fastcgi-script
</IfModule>
<IfModule !mod_fastcgi.c>
<IfModule !mod_fcgid.c>
SetHandler cgi-script
</IfModule>
</IfModule>
Allow from all
# Replace above with "Require all granted" if running apache 2.4
</Location>
ScriptAlias /munin-cgi/munin-cgi-html /usr/lib/munin/cgi/munin-cgi-html
<Location /munin-cgi/munin-cgi-html>
Options +ExecCGI
<IfModule mod_fcgid.c>
SetHandler fcgid-script
</IfModule>
<IfModule mod_fastcgi.c>
SetHandler fastcgi-script
</IfModule>
<IfModule !mod_fastcgi.c>
<IfModule !mod_fcgid.c>
SetHandler cgi-script
</IfModule>
</IfModule>
Allow from all
# Replace above with "Require all granted" if running apache 2.4
</Location>
<IfModule !mod_rewrite.c>
<Location /munin-cgi/munin-cgi-html/static>
# this needs to be at the end to override the above sethandler directives
Options -ExecCGI
SetHandler None
</Location>
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment