summaryrefslogtreecommitdiffstats
path: root/httpd_munin-cgi.conf
blob: fed4640ad0c91c0d7555cb7f96475caab616eba5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# http://munin.readthedocs.org/en/latest/example/webserver/apache-virtualhost.html
<VirtualHost *:80>
    #ServerName munin.example.org
    #ServerAlias munin
    #ServerAdmin  info@example.org

    DocumentRoot /var/www/html/munin

    ErrorLog  /var/log/httpd/munin.example.org-error.log
    CustomLog /var/log/httpd/munin.example.org-access.log combined

    # Rewrites
    RewriteEngine On

    # Static content in /static
    RewriteRule ^/favicon.ico /var/www/html/munin/static/favicon.ico [L]
    RewriteRule ^/static/(.*) /var/www/html/munin/static/$1          [L]

    # workaround for some static content
    RewriteRule /favicon.ico /var/www/html/munin/static/favicon.ico [L]
    RewriteRule /static/(.*) /var/www/html/munin/static/$1          [L]

    # HTML
    RewriteCond %{REQUEST_URI} .html$ [or]
    RewriteCond %{REQUEST_URI} =/
    RewriteRule ^/(.*)          /var/www/cgi-bin/munin-cgi-html/$1 [L]

    # Images
    # - remove path to munin-cgi-graph, if present
    RewriteRule ^/munin-cgi/munin-cgi-graph/(.*) /$1

    RewriteCond %{REQUEST_URI} .png$
    RewriteRule ^/(.*) /var/www/cgi-bin/munin-cgi-graph/$1 [L]

    #ScriptAlias /munin-cgi/munin-cgi-graph /var/www/cgi-bin/munin-cgi-graph

    # Ensure we can run (fast)cgi scripts
    <Directory "/var/www/cgi-bin">
        Options +ExecCGI
        <IfModule mod_fcgid.c>
            SetHandler fcgid-script
        </IfModule>
        <IfModule !mod_fcgid.c>
            SetHandler cgi-script
        </IfModule>
    </Directory>
</VirtualHost>