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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
.. _example-webserver-apache:
==================================
Apache virtualhost configuration
==================================
This example describes how to set up munin on a separate apache httpd
virtual host. It uses FastCGI if this is available, and falls back to
CGI if it is not.
Munin configuration
===================
This example assumes the following configuration in
/etc/munin/munin.conf
.. index::
pair: example; munin.conf
::
graph_strategy cgi
html_strategy cgi
Virtualhost configuration
=========================
Add a new virtualhost, using the following example:
.. index::
pair: example; apache httpd configuration
::
<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
# Rewrites
RewriteEngine On
# Static content in /static
RewriteRule ^/favicon.ico /etc/munin/static/favicon.ico [L]
RewriteRule ^/static/(.*) /etc/munin/static/$1 [L]
# HTML
RewriteCond %{REQUEST_URI} .html$ [or]
RewriteCond %{REQUEST_URI} =/
RewriteRule ^/(.*) /usr/lib/munin/cgi/munin-cgi-html/$1 [L]
# Images
RewriteRule ^/munin-cgi/munin-cgi-graph/(.*) /usr/lib/munin/cgi/munin-cgi-graph/$1 [L]
# Ensure we can run (fast)cgi scripts
<Directory "/usr/lib/munin/cgi">
Options +ExecCGI
<IfModule mod_fcgid.c>
SetHandler fcgid-script
</IfModule>
<IfModule !mod_fcgid.c>
SetHandler cgi-script
</IfModule>
</Directory>
</VirtualHost>
|