使用新版本的Munin 2.0!
創建和編輯/etc/apt/sources.list.d/backports.list並添加:
deb http://backports.debian.org/debian-backports squeeze-backports main
更新的資料庫,然後再安裝穆寧
# apt-get update
# apt-get install munin -t squeeze-backports
這個版本穆寧違約使用CGI生成HTML和GRAPH。所以一定配置虛擬主機之前要做到這一點:
# apt-get install libapache2-mod-fcgid
# a2enmod fcgid
配置您的虛擬主機:
<VirtualHost *:80>
DocumentRoot /var/cache/munin/www
ServerName munin.example.com
Alias /static /etc/munin/static
# Rewrites
RewriteEngine On
# HTML
RewriteCond %{REQUEST_URI} !^/static
RewriteCond %{REQUEST_URI} .html$ [or]
RewriteCond %{REQUEST_URI} =/
RewriteRule ^/(.*) /usr/lib/munin/cgi/munin-cgi-html/$1 [L]
# Images
# - remove path to munin-cgi-graph, if present
RewriteRule ^/munin-cgi/munin-cgi-graph/(.*) /$1
RewriteCond %{REQUEST_URI} !^/static
RewriteCond %{REQUEST_URI} .png$
RewriteRule ^/(.*) /usr/lib/munin/cgi/munin-cgi-graph/$1 [L]
# Ensure we can run (fast)cgi scripts
ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
<Location /munin-cgi/munin-cgi-graph>
Options +ExecCGI
<IfModule mod_fcgid.c>
SetHandler fcgid-script
</IfModule>
<IfModule !mod_fcgid.c>
SetHandler cgi-script
</IfModule>
Allow from all
</Location>
ScriptAlias /munin-cgi/munin-cgi-html /usr/lib/munin/cgi/munin-cgi-html
<Location /munin-cgi/munin-cgi-html>
Options +ExecCGI
<IfModule mod_fcgid.c>
SetHandler fcgid-script
</IfModule>
<IfModule !mod_fcgid.c>
SetHandler cgi-script
</IfModule>
Allow from all
</Location>
<Location />
Options +ExecCGI
<IfModule mod_fcgid.c>
SetHandler fcgid-script
</IfModule>
<IfModule !mod_fcgid.c>
SetHandler cgi-script
</IfModule>
Allow from all
</Location>
<Location /static/>
SetHandler None
Allow from all
</Location>
<Directory /var/cache/munin/www>
Order allow,deny
#Allow from localhost 127.0.0.0/8 ::1
Allow from all
Options None
# Set the default expiration time for files to 5 minutes 10 seconds from
# their creation (modification) time. There are probably new files by
# that time.
#
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault M310
</IfModule>
</Directory>
</VirtualHost>
最後,開始享受穆寧
新版
# a2ensite munin
# /etc/init.d/apache2 reload
現在幾分鐘後,您可以在http://munin.example.com訪問munin。讓munin先收集一些數據。
我已經在Ubuntu 16.04上使用這個vhost配置來獲得fast-cgi的工作,但它太複雜了。另外官方文檔提到了munin-httpd,但是這個http守護進程似乎並沒有出現在版本中(2.0.25)在16.04中可用。我寧願在這個瘋狂的配置中使用由munin提供的http守護進程。 – kacee 2018-01-23 22:01:29