在apache配置/etc/httpd/conf.d/php.conf中,检查一下语句是否启用,一般情况下, 应该是已经默认启用了的。 # PHP is an HTML-embedded scripting language which attempts to make it # easy for developers to write dynamically generated webpages. LoadModule php5_module modules/libphp5.so # # Cause the PHP interprester to handle files with a .php extension. AddHandler php5-script .php AddType text/html .php # # Add index.php to the list of files that will be served as directory # indexes. DirectoryIndex index.php
3.导入默认的cacti数据库 如果使用yum默认安装,创建数据库的脚本默认在/usr/share/doc/cacti-0.8.7f/cacti.sql [root@tigertall php.d]# cd /usr/share/doc/cacti-0.8.7f/ 执行创建数据库的命令 [root@tigertall 0.8.7.f]# mysql -uroot -phandomse cacti < cacti.sql
4.创建cacti数据库的用户和密码, 登录到数据库 [root@tigertall 0.8.7.f]# mysql -u root -p 'pass' 用户授权,请把用户名,数据库和密码换成自己需要的设置。 mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'somepassword'; 刷新权限 mysql> flush privileges;
5.编辑cacti配置,做数据连接设置 [root@tigertall include]# vi /usr/share/cacti/include/config.php 这里有cacti连接使用的数据库类型,用户名,密码信息
/* 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 = "cactiuser"; $database_port = "3306";
/* Default session name - Session name must contain alpha characters */ #$cacti_session_name = "Cacti";
2.解压到本地目录,编译安装 安装spine需要有net-snmp-devel、mysql、mysql-devel、openssl-devel支持,请查看下是否已经安装。 使用以下命令来编译安装: tar xvzf cacti-spine-0.8.7g.tar.gz cd cacti-spine-0.8.7g ./configure make make install 默认安装在/usr/local/spine/目录下。