I’ve followed this guide for installing Munin on my nodes at Linode a few times now. Munin is a remote server monitoring tool that allows you to monitor all sort of things about the health of your servers. Servers you want to monitor are “munin-nodes” and the server where you view all of the reports from is the “munin-master”. It all makes sense but the Linode installation guide fails horrifically if your apache webroot is not the default /var/www that Munin expects it to be. So as a reminder to myself, here’s how I got Munin working on a server where the web root was /srv/www.
First, follow the install guide exactly as instructed by the good folk at Linode. Then modify /etc/munin/apache.conf to remove references to /var/www and change them to your web root of choice. My file looks something like this:
Alias /munin /srv/www/munin <Directory /srv/www/munin> Options Indexes FollowSymLinks MultiViews AllowOverride all Order allow,deny allow from all <IfModule mod_expires.c> ExpiresActive On ExpiresDefault M310 </IfModule> </Directory>
Then I restarted Munin with:
sudo /etc/init.d/munin-node restart
I happen to use my munin-master as a dumb web host so the pretty Munin web pages are just in a folder off of the web root. You could be tricky and put them on their own sub-domain but I’ve chosen not to do that. So they live in a sub-folder and I can access them using this address:
And when I did I was seeing a 403 forbidden error. And when I took at look at the apache error log saw an entry like this:
[Mon Feb 03 04:09:23 2014] [error] [client 220.127.116.11] client denied by server configuration: /var/cache/munin/
Clearly Munin is still trying to access a folder outside of my webroot. So then it was a matter of adding this new section to my /etc/apache2/sites-available/default file:
<Directory /var/cache/munin/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory>
Then restarting apache with
sudo /etc/init.d/apache2 restart
Now if I visited the Munin pages using the same address as above I can see pretty graphs telling me all about my servers! w00t!