问题1:
打开网页http://192.168.133.150/cacti
网页显示:
Forbidden
You don''t have permission to access /cacti on this server.
Apache/2.0.52 (Red Hat) Server at 192.168.133.150 Port 80
解决:
查看日志记录:
tail -f /var/log/httpd/error.log
[Fri Mar 25 07:48:36 2011] [error] [client 192.168.133.1] client denied by server configuration: /usr/share/cacti
[Fri Mar 25 07:48:39 2011] [error] [client 192.168.133.1] client denied by server configuration: /usr/share/cacti
[Fri Mar 25 07:52:24 2011] [error] [client 192.168.133.1] client denied by server configuration: /usr/share/cacti
根据上面显示 ,是没有权限,然后查看相关权限和cacti别名
[root@slave1 conf.d]# ls -la /usr/share |grep cacti
drwxrwxrwx 6 cacti cacti 4096 Mar 22 12:57 cacti
/usr/share/cacti 权限正常
然后查看cacti别名
vi /etc/httpd/conf/httpd.conf
在里面找了半天,没有找到相关于aliase /cacti 的记录,然后自己加上一条,但是系统报错误;
去掉自己加的那条,然后用webmin查看,的确系统原来已经有一条 aliase /cacti /usr/share/cacti的记录.
确认
/etc/httpd/conf.d 在这个目录下面
root@slave1 conf]# ll /etc/httpd/conf.d
total 80
-rw-r--r-- 1 root root 3492 Feb 25 2005 auth_mysql.conf
-rw-r--r-- 1 root root 351 Mar 25 09:31 cacti.conf 在这儿
-rw-r--r-- 1 root root 778 Mar 25 07:47 manual.conf
-rw-r--r-- 1 root root 1827 Dec 3 2004 perl.conf
-rw-r--r-- 1 root root 448 Aug 17 2005 php.conf
-rw-r--r-- 1 root root 1438 Jan 31 2005 python.conf
-rw-r--r-- 1 root root 392 Aug 31 2005 README
-rw-r--r-- 1 root root 10919 Aug 31 2005 ssl.conf
-rw-r--r-- 1 root root 354 Mar 25 07:47 webalizer.conf
-rw-r--r-- 1 root root 299 Aug 31 2005 welcome.conf
查看cacti.conf文件,发现问题所在
[root@slave1 conf.d]# vi cacti.conf
# This configuration file maps the rrd based graphing tool
# Cacti into the URL space. By default no access is allowed.
#
Alias /cacti "/usr/share/cacti"
<Location "/cacti">
Order deny,allow
Deny from all 默认是禁止任何人访问的,如果开启,则在前面加# 关闭该条 (如果为了安装,正常时关闭该条,下面allow中增加可以访问地址)
# Allow from .example.com
</Location>
<Directory "/usr/share/cacti">
AllowOverride Limit
Options FollowSymLinks
</Directory>
问题2:
图片显示红叉
手动在cacti用户下运行 php /usr/share/cacti/poller.php
ERROR: creating ''/usr/share/cacti/rra/localhost_mem_buffers_3.rrd'': Permission denied
ERROR: opening ''/usr/share/cacti/rra/localhost_mem_buffers_3.rrd'': No such file or directory
ERROR: creating ''/usr/share/cacti/rra/localhost_mem_swap_4.rrd'': Permission denied
ERROR: opening ''/usr/share/cacti/rra/localhost_mem_swap_4.rrd'': No such file or directory
ERROR: creating ''/usr/share/cacti/rra/localhost_load_1min_5.rrd'': Permission denied
解决:
其实在安装完后,会发现太多权限导致的问题
主要是链接文件,直接使用chown -R chgrp -R都不会起作用,需要使用chown -R -h chgrp -R -h
然后相关链接的文件也许 |