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