安装说明
系统环境:Centos6.4X64
安装方式:yum安装和源码安装
1.安装epel
[root@cacti ~]# rpm-ivh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
2.安装LAMP环境
[root@cacti ~]# yum -y install httpd mysql-servermysql-devel php php-mysql php-gd
[root@cacti ~]# chkconfig httpd on
[root@cacti ~]# chkconfig mysqld on
[root@cacti ~]# vi /etc/httpd/conf/httpd.conf
[root@cacti ~]# service httpd start
[root@cacti ~]# service mysqld start
3.配置web和php
修改http配置
[root@cacti ~]# vi /etc/httpd/conf/httpd.conf
把第276的ServerName根据实际更改为自己的域名
在第402行增加一个index.php字段
修改php配置
[root@cacti ~]# vi /etc/php.ini
在第946行增加date.timezone = Asia/Chongqing
4.安装rrdtool
[root@cacti ~]# yum -y install cairo-devel libxml2-devel pango-devel
[root@cacti ~]# wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.8.tar.gz
[root@cacti ~]# tar -zxvf rrdtool-1.4.8.tar.gz
[root@cacti ~]# cd rrdtool-1.4.8
[root@cacti rrdtool-1.4.8]# mkdir /usr/local/rrdtool
[root@cacti rrdtool-1.4.8]# ./configure--prefix=/usr/local/rrdtool
[root@cacti rrdtool-1.4.8]# make && make install
[root@cacti rrdtool-1.4.8]# cd ~
5.安装net-snmp
[root@cacti ~]# yum-y install net-snmp net-snmp-devel net-snmp-libs net-snmp-utils
[root@cacti ~]#chkconfig snmpd on
将default修改为127.0.0.1
将其中62行的systemview改为all即可,并启用85行:view all included .1 80
6.安装cacti
[root@cacti ~]# wget http://www.cacti.net/downloads/cacti-0.8.8b.tar.gz
[root@cacti ~]# tar zxvf cacti-0.8.8b.tar.gz
[root@cacti ~]# mv cacti-0.8.8b /var/www/html/cacti
[root@cacti ~]# chown -R apache.apache /var/www/html/
7.配置数据库
[root@cacti ~]# mysqladmin -uroot password 'password'
[root@cacti ~]# mysql -uroot -p
#连接到mysql创建数据库
mysql> create database cacti default character set utf8;
#创建cacti数据库
mysql> GRANT ALL ON cacti.* TO 'arthur'@'localhost'IDENTIFIED BY'arthur';
#把数据库cacti授权于用户cacti,密码为arthur
mysql> use cacti;
mysql> source /var/www/html/cacti.sql;
#导入数据库到cacti数据库
[root@cacti ~]# vi /var/www/html/include/config.php
8.配置cacti
在浏览器输入http://ip/install/index.php
然后点击next,第一次安装,默认为new install,点击next
把rrdtool路径更改为/usr/local/rrdtool,然后点击完成即可
在浏览器输入http://ip/cacti,输入帐号密码为admin即可看到熟悉的界面,至此cacti安装完成