2013-03-26 90 views
1

我在我的服務器上安裝了Munin,但是當我嘗試訪問mypage.com/munin時,出現403錯誤:禁止,您沒有權限訪問/ munin/on這臺服務器。在Debian 6上安裝Munin並獲取403

我的配置如下:

  • 節點和主安裝在相同的服務器。
  • 文件/etc/munin/apache.conf具有以下配置

    Alias /munin /var/cache/munin/www 
    <Directory /var/cache/munin/www> 
        Order allow,deny 
        Allow from all 
        Options FollowSymLinks SymLinksIfOwnerMatch 
        <IfModule mod_expires.c> 
         ExpiresActive On 
         ExpiresDefault M310 
        </IfModule> 
    </Directory> 
    
  • 的穆寧CONF是/etc/munin/munin.conf

    dbdir /var/lib/munin 
    htmldir /var/cache/munin/www 
    logdir /var/log/munin 
    rundir /var/run/munin 
    .... 
    [myserver] 
        address 127.0.0.1 
        use_node_name yes 
    
  • 而節點配置(/etc/munin/munin-node.conf)是默認的。

在不被生成的圖,因爲這個文件夾是空的,而且日誌不會產生,我不明白爲什麼該文件夾的/ var /緩存/穆寧/ WWW。

回答

1

使用新版本的Munin 2.0!

創建和編輯/etc/apt/sources.list.d/backports.list並添加:

deb http://backports.debian.org/debian-backports squeeze-backports main 

更新的資料庫,然後再安裝穆寧

# apt-get update 
# apt-get install munin -t squeeze-backports 

這個版本穆寧違約使用CGI生成HTML和GRAPH。所以一定配置虛擬主機之前要做到這一點:

# apt-get install libapache2-mod-fcgid 
# a2enmod fcgid 

配置您的虛擬主機:

<VirtualHost *:80> 
     DocumentRoot /var/cache/munin/www 
     ServerName munin.example.com 
     Alias /static /etc/munin/static 
     # Rewrites 
     RewriteEngine On 
     # HTML 
     RewriteCond %{REQUEST_URI} !^/static 
     RewriteCond %{REQUEST_URI} .html$ [or] 
     RewriteCond %{REQUEST_URI} =/ 
     RewriteRule ^/(.*)   /usr/lib/munin/cgi/munin-cgi-html/$1 [L] 
     # Images 
     # - remove path to munin-cgi-graph, if present 
     RewriteRule ^/munin-cgi/munin-cgi-graph/(.*) /$1 
     RewriteCond %{REQUEST_URI}     !^/static 
     RewriteCond %{REQUEST_URI}     .png$ 
     RewriteRule ^/(.*) /usr/lib/munin/cgi/munin-cgi-graph/$1 [L] 
     # Ensure we can run (fast)cgi scripts 
     ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph 
     <Location /munin-cgi/munin-cgi-graph> 
       Options +ExecCGI 
       <IfModule mod_fcgid.c> 
         SetHandler fcgid-script 
       </IfModule> 
       <IfModule !mod_fcgid.c> 
         SetHandler cgi-script 
       </IfModule> 
       Allow from all 
     </Location> 
     ScriptAlias /munin-cgi/munin-cgi-html /usr/lib/munin/cgi/munin-cgi-html 
     <Location /munin-cgi/munin-cgi-html> 
       Options +ExecCGI 
       <IfModule mod_fcgid.c> 
         SetHandler fcgid-script 
       </IfModule> 
       <IfModule !mod_fcgid.c> 
         SetHandler cgi-script 
       </IfModule> 
       Allow from all 
     </Location> 
     <Location /> 
       Options +ExecCGI 
       <IfModule mod_fcgid.c> 
         SetHandler fcgid-script 
       </IfModule> 
       <IfModule !mod_fcgid.c> 
         SetHandler cgi-script 
       </IfModule> 
       Allow from all 
     </Location> 
     <Location /static/> 
       SetHandler None 
       Allow from all 
     </Location> 
     <Directory /var/cache/munin/www> 
       Order allow,deny 
       #Allow from localhost 127.0.0.0/8 ::1 
       Allow from all 
       Options None 
       # 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> 
</VirtualHost> 

最後,開始享受穆寧

新版
# a2ensite munin 
# /etc/init.d/apache2 reload 

現在幾分鐘後,您可以在http://munin.example.com訪問munin。讓munin先收集一些數據。

+0

我已經在Ubuntu 16.04上使用這個vhost配置來獲得fast-cgi的工作,但它太複雜了。另外官方文檔提到了munin-httpd,但是這個http守護進程似乎並沒有出現在版本中(2.0.25)在16.04中可用。我寧願在這個瘋狂的配置中使用由munin提供的http守護進程。 – kacee 2018-01-23 22:01:29