简体   繁体   English

Munin Dynazoom无法在Ubuntu上运行

[英]Munin Dynazoom not working on Ubuntu

I recently installed Munin on my machines. 我最近在机器上安装了Munin。 I got everything to work and the data is actually being drawn on the graphs! 我已完成所有工作,数据实际上正在图形上绘制! :) :)

But, for some reason, when I click on each individual graph, it brings me to the dynazoom page but it's all plain text with no images :( 但是,由于某种原因,当我单击每个单独的图形时,它带我到dynazoom页面,但全都是纯文本,没有图像:(

Here is my apache.conf: 这是我的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>

Any reason why this could not be working? 有什么原因不能奏效? If I haven't given enough information, please let me know. 如果我没有提供足够的信息,请告诉我。 Thank you 谢谢

I had the same issue on Ubuntu 14.04. 我在Ubuntu 14.04上遇到了同样的问题。

By checking /var/log/apache2/error.log I found the script complaining about missing modules: 通过检查/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.

I did install the CGI::Fast module to solve the issue: 我确实安装了CGI :: Fast模块来解决此问题:

sudo apt-get install libcgi-fast-perl

There is no need for any rewrite rule as indicated in another answer. 不需要其他答案中指示的任何重写规则。 Packages in Ubuntu 14.04 have the path names configured correctly. Ubuntu 14.04中的软件包具有正确配置的路径名。

启用apache2 cgi(或cgid)使dynazoom起作用。

sudo a2enmod cgi; sudo service apache2 restart

In addition to ermannob 's answer; 除了ermannob的答案; my apache2 error.log reported 我的apache2 error.log报告

  AH01797: client denied by server configuration: /usr/lib/munin/cgi/munin-cgi-graph

which stopped me from messing around with file permissions within the OS and caused me to look at the apache config. 这阻止了我搞乱操作系统中的文件权限,并导致我查看了apache配置。 All that was required was to change 所要做的就是改变

<Location /munin-cgi/munin-cgi-graph>
    Order allow,deny
    Allow from localhost 127.0.0.0/8 ::1
    ...

in /etc/apache2/conf-enabled/munin.conf, to 在/etc/apache2/conf-enabled/munin.conf中,

<Location /munin-cgi/munin-cgi-graph>
    Require all granted
    Options FollowSymLinks SymLinksIfOwnerMatch

I did not need to install any fastcgi packages and followed the tutorial here . 我不需要安装任何fastcgi软件包,并在遵循了教程。 They suggest that configuration be added to the apache.conf file directly, however, relaxing the permissions in the conf-enabled/munin.conf file (for /munin, /munin-cgi/munin-cgi-graph and /munin-cgi/munin-cgi-html) was sufficient. 他们建议将配置直接添加到apache.conf文件中,但是放宽conf-enabled / munin.conf文件中的权限(对于/ munin,/ munin-cgi / munin-cgi-graph和/ munin-cgi / munin-cgi-html)就足够了。 I omitted the changes to apache.conf. 我省略了对apache.conf的更改。

When running Ubuntu 14.04 I fixed this on my own servers by updating the apache config in /etc/apache2/conf-available/munin.conf from 2.2 style to 2.4 在运行Ubuntu 14.04时,我通过将/etc/apache2/conf-available/munin.conf中的apache配置从2.2样式更新为2.4来修复了此问题。

Example: 例:

<Directory /var/cache/munin/www>
Order allow,deny
Allow from localhost 127.0.0.0/8 ::1
....
</Directory>

needs to be changed to 需要更改为

<Directory /var/cache/munin/www>
# Order allow,deny
# Allow from localhost 127.0.0.0/8 ::1
Require all granted
....
</Directory>

or you could do 或者你可以做

Require host localhost

or 要么

Require ip 127.0.0.0/8 ::8

see apache documentation about the changes here . 查看更改Apache文档在这里 By the time I realized this, I had already gone through and installed FastCGI and the perl module listed in this thread. 当我意识到这一点时,我已经经历并安装了FastCGI和该线程中列出的perl模块。 This change would need to be done to all the location/directory areas you see in munin.conf. 需要对munin.conf中看到的所有位置/目录区域进行此更改。

I had the same problem on Debian 8. I've edited the file /etc/munin/apache24.conf like that: 我在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>

Then I installed the libapache2-mod-fcgid as mentioned earlier. 然后,如前所述,我安装了libapache2-mod-fcgid。

After a munin-node restart, it's working correctly. munin节点重新启动后,它可以正常工作。

I had experienced the same behavior in Ubuntu 14.04 LTS. 我在Ubuntu 14.04 LTS中遇到了相同的行为。 The reason was the image URL in the dynazoom page was incorrectly using /cgi-bin/munin-cgi-graph/ instead of /munin-cgi/munin-cgi/graph/ so instead of hunting down in the code to fix this bug I worked around it with a quick rewrite rule: 原因是dynazoom页面中的图像URL错误地使用了/cgi-bin/munin-cgi-graph/而不是/munin-cgi/munin-cgi/graph/所以没有在代码中寻找解决此错误的方法解决了一个快速重写规则:

RewriteRule ^/cgi-bin/munin-cgi-graph/(.*) /$1

Hope this helps 希望这可以帮助

You should change the configuration part about the munin-cgi-graph, setting the same permissions as the main section. 您应该更改有关munin-cgi-graph的配置部分,并设置与主要部分相同的权限。 Here's your configuration: 这是您的配置:

# 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>

change it to this: 更改为此:

# 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>

Additionally I had to install the libcgi-fast-perl package, doing this: 另外,我必须安装libcgi-fast-perl软件包,这样做:

sudo apt-get install libcgi-fast-perl

Checking /var/log/apache2/error.log helped me a lot. 检查/var/log/apache2/error.log对我有很大帮助。

In my case following https://bugs.launchpad.net/ubuntu/+source/munin/+bug/1258026 and http://munin-monitoring.org/wiki/MuninConfigurationMasterCGI worked. 在我的情况下, https://bugs.launchpad.net/ubuntu/+source/munin/+bug/1258026http://munin-monitoring.org/wiki/MuninConfigurationMasterCGI可以正常工作。

The only problematic part was where to put Apache virtual host configuration, it turned out that placing it at /etc/apache2/sites-enabled/001-munin.conf worked. 唯一有问题的部分是将Apache虚拟主机配置放在何处,事实证明,将其放置在/etc/apache2/sites-enabled/001-munin.conf

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM