我最近在我的机器上安装了Munin。我得到了一切工作,数据实际上是在图表上绘制的! :)
但是,出于某种原因,当我点击每个单独的图表时,它会将我带到dynazoom页面,但它都是没有图像的纯文本:(
这是我的apache.conf:
# Enable this for template generation
Alias /munin /var/cache/munin/www
# Enable this for cgi-based templates
#Alias /munin-cgi/static /var/cache/munin/www/static
#ScriptAlias /munin-cgi /usr/lib/munin/cgi/munin-cgi-html
#<Location /munin-cgi>
# Order allow,deny
# Allow from localhost 127.0.0.0/8 ::1
# AuthUserFile /etc/munin/munin-htpasswd
# AuthName "Munin"
# AuthType Basic
# require valid-user
#</Location>
<Directory /var/cache/munin/www>
Order allow,deny
# Allow from localhost 127.0.0.0/8 ::1
Allow from all
Options None
AllowOverride None
# This file can be used as a .htaccess file, or a part of your apache
# config file.
#
# For the .htaccess file option to work the munin www directory
# (/var/cache/munin/www) must have "AllowOverride all" or something
# close to that set.
#
AuthUserFile /etc/munin/munin-htpasswd
AuthName "Munin"
AuthType Basic
require valid-user
# This next part requires mod_expires to be enabled.
#
# 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>
# Enables fastcgi for munin-cgi-html if present
#<Location /munin-cgi>
# <IfModule mod_fastcgi.c>
# SetHandler fastcgi-script
# </IfModule>
#</Location>
#<Location /munin-cgi/static>
# SetHandler None
#</Location>
# Enables fastcgi for munin-cgi-graph if present
ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
<Location /munin-cgi/munin-cgi-graph>
Order allow,deny
Allow from localhost 127.0.0.0/8 ::1
# 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>
</Location>
ScriptAlias /munin-cgi/munin-cgi-html /usr/lib/munin/cgi/munin-cgi-html
<Location /munin-cgi/munin-cgi-html>
Order allow,deny
Allow from localhost 127.0.0.0/8 ::1
# 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>
</Location>
为什么这不起作用?如果我没有提供足够的信息,请告诉我。谢谢
答案 0 :(得分:12)
启用apache2 cgi(或cgid)会使dynazoom工作。
sudo a2enmod cgi; sudo service apache2 restart
答案 1 :(得分:11)
我在Ubuntu 14.04上遇到了同样的问题。
通过检查/var/log/apache2/error.log
我发现脚本抱怨缺少模块:
Can't locate CGI/Fast.pm in @INC (you may need to install the CGI::Fast module) (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl) at /usr/lib/munin/cgi/munin-cgi-graph line 36.
我确实安装了CGI :: Fast模块来解决问题:
sudo apt-get install libcgi-fast-perl
不需要任何重写规则,如另一个答案所示。 Ubuntu 14.04中的软件包正确配置了路径名。
答案 2 :(得分:6)
除ermannob的答案外;我的apache2 error.log报告了
AH01797: client denied by server configuration: /usr/lib/munin/cgi/munin-cgi-graph
这阻止了我在操作系统中弄乱文件权限并导致我查看apache配置。所需要的只是改变
<Location /munin-cgi/munin-cgi-graph>
Order allow,deny
Allow from localhost 127.0.0.0/8 ::1
...
>在/etc/apache2/conf-enabled/munin.conf中,到
<Location /munin-cgi/munin-cgi-graph>
Require all granted
Options FollowSymLinks SymLinksIfOwnerMatch
我不需要安装任何fastcgi软件包并遵循教程here。他们建议直接将配置添加到apache.conf文件中,然后放宽conf-enabled / munin.conf文件中的权限(对于/ munin,/ munin-cgi / munin-cgi-graph和/ munin-cgi / munin-cgi-html)就足够了。我省略了对apache.conf的更改。
答案 3 :(得分:5)
运行Ubuntu 14.04时,我通过将/etc/apache2/conf-available/munin.conf中的apache配置从2.2样式更新为2.4来修复我自己的服务器
示例:
<Directory /var/cache/munin/www>
Order allow,deny
Allow from localhost 127.0.0.0/8 ::1
....
</Directory>
需要更改为
<Directory /var/cache/munin/www>
# Order allow,deny
# Allow from localhost 127.0.0.0/8 ::1
Require all granted
....
</Directory>
或者你可以做到
Require host localhost
或
Require ip 127.0.0.0/8 ::8
请参阅有关更改的{apache文档here。当我意识到这一点时,我已经完成并安装了FastCGI和此线程中列出的perl模块。需要对munin.conf中看到的所有位置/目录区域进行此更改。
答案 4 :(得分:2)
我在Debian 8上遇到了同样的问题。我已经编辑了/etc/munin/apache24.conf这样的文件:
Alias /munin /var/cache/munin/www
<Directory /var/cache/munin/www>
Require all granted
Options FollowSymLinks SymLinksIfOwnerMatch
</Directory>
ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
<Location /munin-cgi/munin-cgi-graph>
Require all granted
Options FollowSymLinks SymLinksIfOwnerMatch
<IfModule mod_fcgid.c>
SetHandler fcgid-script
</IfModule>
<IfModule !mod_fcgid.c>
SetHandler cgi-script
</IfModule>
</Location>
然后我安装了前面提到的libapache2-mod-fcgid。
在munin节点重启后,它正常工作。
答案 5 :(得分:1)
我在Ubuntu 14.04 LTS中遇到过相同的行为。原因是dynazoom页面中的图像URL错误地使用了/cgi-bin/munin-cgi-graph/
而不是/munin-cgi/munin-cgi/graph/
,因此我没有在代码中搜索到修复此错误,而是使用快速重写规则解决了这个问题:
RewriteRule ^/cgi-bin/munin-cgi-graph/(.*) /$1
希望这有帮助
答案 6 :(得分:1)
您应该更改关于munin-cgi-graph的配置部分,设置与主要部分相同的权限。这是您的配置:
# Enables fastcgi for munin-cgi-graph if present
ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
<Location /munin-cgi/munin-cgi-graph>
Order allow,deny
Allow from localhost 127.0.0.0/8 ::1
# 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>
</Location>
将其更改为:
# Enables fastcgi for munin-cgi-graph if present
ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
<Location /munin-cgi/munin-cgi-graph>
Order allow,deny
# Allow from localhost 127.0.0.0/8 ::1
Allow from all
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>
</Location>
另外我必须安装libcgi-fast-perl包,这样做:
sudo apt-get install libcgi-fast-perl
检查/var/log/apache2/error.log
对我帮助很大。
答案 7 :(得分:0)
在我https://bugs.launchpad.net/ubuntu/+source/munin/+bug/1258026和http://munin-monitoring.org/wiki/MuninConfigurationMasterCGI工作的情况下。
唯一有问题的部分是放置Apache虚拟主机配置的位置,结果是将其置于/etc/apache2/sites-enabled/001-munin.conf
工作。