Skip to content

Instantly share code, notes, and snippets.

@ssm
Created May 13, 2012 15:55
Show Gist options
  • Save ssm/2689025 to your computer and use it in GitHub Desktop.
Save ssm/2689025 to your computer and use it in GitHub Desktop.
<VirtualHost *:80>
ServerName munin.example.org
ServerAlias munin
ServerAdmin info@example.org
DocumentRoot /srv/www/munin.example.org
ErrorLog /var/log/apache2/munin.example.org-error.log
CustomLog /var/log/apache2/munin.example.org-access.log combined
ServerSignature Off
Alias /static /etc/munin/static
# Rewrites
RewriteEngine On
# HTML
RewriteCond %{REQUEST_URI} !^/static
RewriteCond %{REQUEST_URI} .html$ [or]
RewriteCond %{REQUEST_URI} =/
RewriteRule ^/(.*) /usr/lib/cgi-bin/munin-cgi-html/$1 [L]
# Images
# - compat rewrite (until old templates are fixed)
RewriteRule ^/cgi-bin/munin-cgi-graph/(.*) /$1
RewriteCond %{REQUEST_URI} !^/static
RewriteCond %{REQUEST_URI} .png$
RewriteRule ^/(.*) /usr/lib/cgi-bin/munin-cgi-graph/$1 [L]
# Ensure we can run (fast)cgi scripts
<Directory "/usr/lib/cgi-bin">
Options +ExecCGI
<IfModule mod_fcgid.c>
SetHandler fcgid-script
</IfModule>
<IfModule !mod_fcgid.c>
SetHandler cgi-script
</IfModule>
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment