Since Munin on Ubuntu 14.04 doesn’t work out of the box, here’s a short tutorial how to make it work.
- Install Munin itself and needed modules:
1apt-get install munin libapache2-mod-fcgid libcgi-fast-perl - Enable mod_rewrite in apache:
12a2enmod rewriteservice apache2 restart - Configure /etc/munin/munin.conf and set these values:
12345678libdir /var/lib/muninhtmldir /var/cache/munin/wwwlogdir /var/log/muninrundir /var/run/muningraph_strategy cgicgiurl_graph /munin-cgi/munin-cgi-graphhtml_strategy cgi
all other settings can be left as they are. - Edit /etc/apache2/sites-enabled/munin.conf and ensure to have a config similar to this:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586<VirtualHost *:80>ServerName munin.hostname.comServerAdmin root@localhostErrorLog /var/log/apache2/munin-error.logCustomLog /var/log/apache2/munin-access.log combined# RewritesRewriteEngine OnRewriteRule ^/favicon.ico /var/cache/munin/www/static/favicon.ico [L]RewriteRule ^/static/(.*) /var/cache/munin/www/static/$1 [L]# HTMLRewriteRule ^(/.*\.html)?$ /munin-cgi/munin-cgi-html/$1 [PT]# ImagesRewriteRule ^/munin-cgi/munin-cgi-graph/(.*) /$1RewriteCond %{REQUEST_URI} !^/staticRewriteRule ^/(.*.png)$ /munin-cgi/munin-cgi-graph/$1 [L,PT]<Directory "/var/cache/munin/www">#Uncomment this to setup authentication# AuthUserFile /etc/apache/htpasswords# AuthName "admin"# AuthType Basic# require valid-userrequire all granted</Directory># Enables fastcgi for munin-cgi-graph if presentScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph<Location /munin-cgi/munin-cgi-graph>#Uncomment this to setup authentication# AuthUserFile /etc/munin/munin-htpasswd# AuthName "Munin"# AuthType Basic# require valid-user<IfModule mod_fcgid.c>SetHandler fcgid-script</IfModule><IfModule !mod_fcgid.c>SetHandler cgi-script</IfModule>Require all granted</Location>ScriptAlias /munin-cgi/munin-cgi-html /usr/lib/munin/cgi/munin-cgi-html<Location /munin-cgi/munin-cgi-html>#Uncomment to setup authentication# AuthUserFile /etc/munin/munin-htpasswd# AuthName "Munin"# AuthType Basic# require valid-user<IfModule mod_fcgid.c>SetHandler fcgid-script</IfModule><IfModule !mod_fcgid.c>SetHandler cgi-script</IfModule>Require all granted</Location><Directory "/etc/munin/static">Require all granted</Directory># Ensure we can run (fast)cgi scripts<Directory "/usr/lib/munin/cgi">Require all granted<IfModule mod_fcgid.c>SetHandler fcgid-script</IfModule><IfModule !mod_fcgid.c>SetHandler cgi-script</IfModule></Directory><IfModule !mod_rewrite.c><Location /munin-cgi/munin-cgi-html/static># this needs to be at the end to override the above sethandler directivesOptions -ExecCGISetHandler None</Location></IfModule></VirtualHost>
After saving config – reload apache with “service apache2 reload” and munin should be now accessible at munin.hostname.com
This looks pretty simple and easy to setup, I came across your post after quite a lot of google searching. Thank you.