apache mysql php已经安装好了,接下来就是进入主题了

                       (请看:http://wolfword.blog.51cto.com/blog/4892126/1203250

 

   rrdtool是用来做绘图用的,但是还是需要其他的安装包的支持, cairo-devel libxml2-devel pango pango-devel 等,这里我们用yum安装没有必要一一的编译安装,太浪费时间了

1,rrdtool安装

200909128.jpg

   [root@test3 ~]# tar zvxf rrdtool-1.4.4.tar.gz

   [root@test3 ~]# cd rrdtool-1.4.4

   [root@test3 rrdtool-1.4.4]# ./configure --prefix=/usr/local/rrdtool    

   [root@test3 rrdtool-1.4.4]# make && make install 

 [root@test3 rrdtool-1.4.4]# ln -s /usr/local/rrdtool/bin/* /usr/local/bin/ 

 

2,snmp安装

  在这里我就直接用yum安装了
[root@test3 ~]# yum  -y install net-snmp*

     [root@test3 ~]# service  snmpd restart
Stopping snmpd: [  OK  ]
Starting snmpd: [  OK  ]

[root@test3 ~]# chkconfig snmpd on

 

3,cacti安装 

[root@test3 ~]# mv cacti-0.8.7g/* /usr/local/apache/htdocs/
[root@test3 ~]# mysql -uroot -p123456
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.49-log MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database cacti;                                                   创建cacti数据库
Query OK, 1 row affected (0.09 sec)

mysql> insert into mysql.user(host,user,password) values('localhost','cacti',password('cacti123'));                                                                              在数据库里面创建cacti用户
Query OK, 1 row affected, 3 warnings (0.10 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.04 sec)

mysql> grant all on cacti.* to cacti@'localhost' identified by 'cacti123'; 

                      把数据库cacti授权给cacti用户
Query OK, 0 rows affected (0.03 sec)                                                           

 [root@test3 ~]# useradd cactiuser            创建本地cacti用户

[root@test3 ~]# cd /usr/local/apache/htdocs/

[root@test3 htdocs]# mysql -ucacti -pcacti123 cacti < cacti.sql

将数据倒入数据库cacti之后要修改配置文件以保证能与数据库cacti连接

[root@test3 htdocs]# mysql -ucacti -pcacti123 cacti < cacti.sql 
[root@test3 htdocs]# pwd
/usr/local/apache/htdocs
[root@test3 htdocs]# vim include/config.php    

195758719.jpg

改完之后就可以见证奇迹了

  结果显示的是空白页,很是郁闷!! 查看日志

[root@test3 logs]# tail error_log 
[Sat May 18 20:10:24 2013] [error] [client 127.0.0.1] File does not exist: /usr/local/apache/htdocs/favicon.ico
[Sat May 18 20:13:39 2013] [notice] caught SIGTERM, shutting down
[Sat May 18 20:13:43 2013] [warn] module php5_module is already loaded, skipping
[Sat May 18 20:13:43 2013] [notice] Apache/2.2.11 (Unix) PHP/5.2.9 configured -- resuming normal operations[Sat May 18 20:18:33 2013] [notice] Apache/2.2.11 (Unix) PHP/5.2.9 configured -- resuming normal operations

    在httpd.conf文件中添加如下行

  AddType image/x-icon .ico 

  关闭selinux还是不行

  唉唉,搞了两天问题还是没有解决~~~~~~~~~~~~~~ 不知道为什么一直都显示的是空白页,请高手帮助

      皇天不负有心人,经过12小时的艰苦奋斗!! 问题终于被我解决了。。。。归根到底是php不能连接mysql导致的!!。。。究早期根本原因是当时编译安装php的时候的问题,我用的版本是php-5.3.25 所以在编译安装的时候应该是--with-mysql 而不是--with-mysql-dir因为在这个版本的php编译安装的时候根本就没有这个参数。。但是有人这样安装的时候居然成功了,不理解!!

  在编译安装之前还要安装mysql-devel这个包

如果安装出现如下错误就用如下的非常规方法!!!!

/usr/local/mysql/lib/libmysqlclient.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [libphp5.la] Error 1
[root@test3 php-5.3.25]# cd /usr/local/mysql
[root@test3 mysql]# mv lib lib.back
[root@test3 mysql]# ln -s /usr/lib64/mysql/ /usr/local/mysql/lib

                成功了!!!!!!!!!!!!!!!!!!

203248149.jpg