0.关闭防火墙service iptables stop ,chkconfig iptables off
/etc/init.d/iptables stop
/etc/init.d/ip6tables stop
chkconfig iptables off
chkconfig ip6tables off
关闭SElinux
vi /etc/sysconfig/selinux
把SELINUX=enforcing改为SELINUX=disabled并保存
setenforce 0
1.安装cacti需要的环境包
yum install -y mysql mysql-server httpd mod_ssl php php-snmp php-mysql net-snmp net-snmp-utils nano cairo-devel libxml2-devel pango-devel pango libpng-devel freetype
yum install -y freetype-devel libart_lgpl-devel gcc
2.安装rrdtool
yum install cairo-devel libxml2-devel pango pango-devel
cd /tmp
wget http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz
tar zxvf rrdtool.tar.gz
cd rrdtool-1.4.7
./configure
make prefix=/usr/local/ all
make prefix=/usr/local/ install
ln -s /usr/local/rrdtool/bin/* /usr/local/bin/

3.为cacti创建库和用戶
service mysqld start
/usr/bin/mysqladmin --user=root create cacti
mysql -e "GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cacti'"
4.下载cacti包並且解压
cd /var/www/html/
tar zxvf cacti-0.8.7i.tar.gz
cd cacti-0.8.7i/
mv cacti-0.8.7i cacti
chmod -R 777 /var/www/html/cacti/*
chown -R root:root /var/www/html/cacti/*
5.导入cacti库
mysql -ucactiuser -pcacti cacti < /var/www/html/cacti/cacti.sql

6.修改php配置文件
vi /var/www/html/include/config.php
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cacti";
$database_port = "3306";
7.设置crontab定時任务
echo '*/5 * * * * root /usr/bin/php /var/www/html/cacti/poller.php' >> /etc/crontab
8.设置服务开机自动启动
chkconfig snmpd on
chkconfig httpd on
chkconfig mysqld on
chkconfig crond on
service httpd restart
service snmpd restart
service crond restart
9.编辑httpd.conf文件
Alias /cacti/ "/var/www/html/cacti/"

    Options FollowSymLinks
    AllowOverride None
10.安装Plugin Architecture
[root@localhost ~]# wget http://mirror.cactiusers.org/downloads/plugins/cacti-plugin-0.8.7g-PA-v2.8.tar.gz
[root@localhost ~]# tar zxvf cacti-plugin-0.8.7g-PA-v2.8.tar.gz
[root@localhost ~]# cp -R cacti-plugin-arch/* /var/www/html/cacti
[root@localhost ~]# cd /var/www/html/cacti
[root@localhost html]# mysql -ucactiuser -pcacti cacti < /var/www/html/cacti/pa.sql
[root@localhost html]# yum install -y patch
[root@centos54 cacti]# patch -p1 -N