我在服务器上安装了 Munin 和 munin-node,并且 httpd 已经安装。但是安装后,当我运行 munin-node 时,浏览器给我这个错误。
Not Found
The requested URL /munin was not found on this server.
Apache/2.2.3 (Red Hat) Server at 192.168.5.1 Port 80
我检查了 /etc/munin.conf 文件,Html 目录的路径是正确的。
# Example configuration file for Munin, generated by 'make build'
# The next three variables specifies where the location of the RRD
# databases, the HTML output, and the logs, severally. They all
# must be writable by the user running munin-cron.
dbdir /var/lib/munin
htmldir /var/www/munin
logdir /var/log/munin
rundir /var/run/munin
/var/www/munin/ 的权限设置为 munin:munin
/etc/httpd/conf.d/munin.conf
# For SSL-servers
ScriptAlias /munin/cgi/ /var/www/munin/cgi/
#<Directory /var/www/munin/cgi/>
# Options ExecCGI
# SSLRequireSSL
# order deny,allow
# deny from all
# AuthType Basic
# AuthUserFile /site/cfg/passwd
# AuthGroupFile /site/cfg/group
# AuthName "munin"
# require group munin
# Satisfy Any
#</Directory>
#
Alias /munin/ /var/www/munin/
#<Directory /var/www/munin/>
# Options None
# SSLRequireSSL
# order deny,allow
# deny from all
# AuthType Basic
# AuthUserFile /site/cfg/passwd
# AuthGroupFile /site/cfg/group
# AuthName "munin"
# require group munin
# Satisfy Any
#</Directory>
阿帕奇日志
[Sun Sep 01 04:03:12 2013] [notice] Digest: generating secret for digest authentication ...
[Sun Sep 01 04:03:12 2013] [notice] Digest: done
[Sun Sep 01 04:03:12 2013] [notice] Apache/2.2.3 (Red Hat) configured -- resuming normal operations
[Sun Sep 01 11:34:47 2013] [notice] caught SIGTERM, shutting down
[Sun Sep 01 14:50:15 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Sep 01 14:50:15 2013] [notice] Digest: generating secret for digest authentication ...
[Sun Sep 01 14:50:15 2013] [notice] Digest: done
[Sun Sep 01 14:50:16 2013] [notice] Apache/2.2.3 (Red Hat) configured -- resuming normal operations
[Sun Sep 01 14:50:18 2013] [notice] caught SIGTERM, shutting down
[Sun Sep 01 14:50:18 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sun Sep 01 14:50:18 2013] [notice] Digest: generating secret for digest authentication ...
[Sun Sep 01 14:50:18 2013] [notice] Digest: done
[Sun Sep 01 14:50:18 2013] [notice] Apache/2.2.3 (Red Hat) configured -- resuming normal operations
[Sun Sep 01 14:50:41 2013] [error] [client 10.20.20.147] File does not exist: /var/www/html/munin
[Sun Sep 01 14:50:41 2013] [error] [client 10.20.20.147] File does not exist: /var/www/html/favicon.ico
取消注释 /etc/httpd/conf.d/munin.conf 中的一些文件后
# For SSL-servers
ScriptAlias /munin/cgi/ /var/www/munin/cgi/
<Directory /var/www/munin/cgi/>
Options ExecCGI
#SSLRequireSSL
order deny,allow
# deny from all
#deny from none
allow from all
AuthType Basic
AuthUserFile /site/cfg/passwd
AuthGroupFile /site/cfg/group
AuthName "munin"
require group munin
Satisfy Any
</Directory>
#
Alias /munin/ /var/www/munin/
<Directory /var/www/munin/>
Options None
#SSLRequireSSL
order deny,allow
# deny from all
#deny from none
allow from all
AuthType Basic
AuthUserFile /site/cfg/passwd
AuthGroupFile /site/cfg/group
AuthName "munin"
require group munin
Satisfy Any
</Directory>
答案1
实际上创建了 HTML 和 PNG 文件,但文件上设置的权限是 640 而不是 644,无法apache
读取。所以有一个解决方法。你应该运行 munin 作为
su - munin --shell=/bin/bash munin-cron
这将以 644 权限更新图表,并且apache
能够读取它。
答案2
请在中添加以下行 /etc/httpd/conf/httpd.conf
Alias /munin /var/www/munin
<Directory /var/www/munin>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
保存文件,删除整个 munin 配置文件并重新启动 apache 和 munin-node。
/etc/init.d/httpd restart
chkconfig --levels 235 munin-node on
/etc/init.d/munin-node restart