我最近在我的机器上安装了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>
Run Code Online (Sandbox Code Playgroud)
有什么理由不能这样做?如果我没有提供足够的信息,请告诉我.谢谢
use*_*505 12
我在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.
Run Code Online (Sandbox Code Playgroud)
我确实安装了CGI :: Fast模块来解决问题:
sudo apt-get install libcgi-fast-perl
Run Code Online (Sandbox Code Playgroud)
如另一个答案所示,不需要任何重写规则.Ubuntu 14.04中的软件包正确配置了路径名.
小智 12
启用apache2 cgi(或cgid)会使dynazoom工作.
sudo a2enmod cgi; sudo service apache2 restart
Run Code Online (Sandbox Code Playgroud)
除了ermannob的回答; 我的apache2 error.log报告了
AH01797: client denied by server configuration: /usr/lib/munin/cgi/munin-cgi-graph
Run Code Online (Sandbox Code Playgroud)
这阻止了我在操作系统中弄乱文件权限并导致我查看apache配置.所需要的只是改变
<Location /munin-cgi/munin-cgi-graph>
Order allow,deny
Allow from localhost 127.0.0.0/8 ::1
...
Run Code Online (Sandbox Code Playgroud)
在/etc/apache2/conf-enabled/munin.conf中,到
<Location /munin-cgi/munin-cgi-graph>
Require all granted
Options FollowSymLinks SymLinksIfOwnerMatch
Run Code Online (Sandbox Code Playgroud)
我不需要安装任何fastcgi包并按照这里的教程.他们建议直接将配置添加到apache.conf文件中,然后放宽conf-enabled/munin.conf文件中的权限(对于/ munin,/ munin-cgi/munin-cgi-graph和/ munin-cgi/munin-cgi-html)就足够了.我省略了对apache.conf的更改.
小智 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>
Run Code Online (Sandbox Code Playgroud)
需要改为
<Directory /var/cache/munin/www>
# Order allow,deny
# Allow from localhost 127.0.0.0/8 ::1
Require all granted
....
</Directory>
Run Code Online (Sandbox Code Playgroud)
或者你可以做到
Require host localhost
Run Code Online (Sandbox Code Playgroud)
要么
Require ip 127.0.0.0/8 ::8
Run Code Online (Sandbox Code Playgroud)
请参阅这里有关更改的apache文档.当我意识到这一点时,我已经完成并安装了FastCGI和此线程中列出的perl模块.需要对munin.conf中看到的所有位置/目录区域进行此更改.
小智 1
我在 Ubuntu 14.04 LTS 中也经历过同样的行为。原因是 dynazoom 页面中的图像 URL 被错误地使用,/cgi-bin/munin-cgi-graph/而不是/munin-cgi/munin-cgi/graph/在代码中寻找来修复此错误,我通过快速重写规则解决了这个问题:
RewriteRule ^/cgi-bin/munin-cgi-graph/(.*) /$1
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助
| 归档时间: |
|
| 查看次数: |
15788 次 |
| 最近记录: |