【问题标题】:Munin Dynazoom not working on UbuntuMunin Dynazoom 无法在 Ubuntu 上运行
【发布时间】:2014-06-14 15:46:36
【问题描述】:

我最近在我的机器上安装了 Munin。我得到了一切工作,数据实际上是在图表上绘制的! :)

但是,由于某种原因,当我单击每个单独的图表时,它会将我带到动态缩放页面,但它都是没有图像的纯文本:(

这是我的 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>

有什么原因导致这无法正常工作?如果我没有提供足够的信息,请告诉我。谢谢

【问题讨论】:

  • 我和你有同样的问题。已将 Munin 1.4x 与 Ubunto 12.4 一起使用,而对 Ubuntu 14.04 与 Munin 2.0.19 没有任何变化。一切都很好,除了 Dynazoom。
  • @Jotne,是的,似乎很多在 Ubuntu 上使用 Munin 的人都有这个问题,希望有人能找到解决这个问题的方法。
  • 我找到了这个,但是还没来得及测试,你可以试试看是否有帮助:munin-monitoring.org/wiki/MuninConfigurationMasterCGI

标签: apache2 munin


【解决方案1】:

我在 Ubuntu 14.04 LTS 中遇到过同样的行为。原因是 dynazoom 页面中的图像 URL 错误地使用了 /cgi-bin/munin-cgi-graph/ 而不是 /munin-cgi/munin-cgi/graph/ 所以我没有在代码中寻找修复这个错误,而是通过快速重写规则解决了它:

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

希望对你有帮助

【讨论】:

    【解决方案2】:

    我在 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 中的包的路径名配置正确。

    【讨论】:

    • 对我来说,在我这样做之后它起作用了,但我还需要更改 munin.conf,如下面@Kaiser 所述
    • 在我的情况下,/var/log/apache2/error.log 中没有这样的错误,并且缩放无论如何都不起作用。
    【解决方案3】:

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

    sudo a2enmod cgi; sudo service apache2 restart
    

    【讨论】:

    • 无法让它在 Debian 8 上运行我快疯了。就这么简单。谢谢!
    • 这里也是,debian 8,只需要开启cgi模块
    【解决方案4】:

    在运行 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
    

    请参阅有关更改 here 的 apache 文档。当我意识到这一点时,我已经完成并安装了 FastCGI 和该线程中列出的 perl 模块。需要对您在 munin.conf 中看到的所有位置/目录区域进行此更改。

    【讨论】:

    • 这对我有用,但前提是我还安装了 libcgi-fast-perl,如姐妹帖子中所述
    • 我还必须安装 libapache2-mod-fcgid
    【解决方案5】:

    您应该更改有关 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对我帮助很大。

    【讨论】:

      【解决方案6】:

      我在 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-node 重启后,它工作正常。

      【讨论】:

        【解决方案7】:

        除了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 的更改。

        【讨论】:

        • 谢谢老兄!遵循相同的指南并在缩放方面遇到了一些麻烦
        • 谢谢!如果使用带有 HTML 缓存的 munin 以使图表缩放起作用(因为它是动态的),则需要这样做。然而,这在 munin 网站上的示例配置中没有解释。
        【解决方案8】:

        在我的情况下,https://bugs.launchpad.net/ubuntu/+source/munin/+bug/1258026 和 http://munin-monitoring.org/wiki/MuninConfigurationMasterCGI 工作。

        唯一有问题的部分是 Apache 虚拟主机配置的放置位置,结果证明将其放置在 /etc/apache2/sites-enabled/001-munin.conf 有效。

        【讨论】:

          猜你喜欢
          • 2014-08-04
          • 2012-09-27
          • 2019-07-18
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2013-09-09
          相关资源
          最近更新 更多