a. 配置httpd服务
vim /etc/httpd/conf.d/cacti.conf
Alias /cacti /var/www/html/cacti
DirectoryIndex index.php
AllowOverride all
order deny,allow
deny from all
allow from all
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc on
php_flag track_vars on
b.配置apache
vim /etc/httpd/conf/httpd.conf 配置apache
276行ServerName localhost:80
c.配置php
vim /etc/php.ini
946行date.timezone = PRC
开启服务
d. 配置 mysql并导入 cacti.sql
service mysqld start (开启服务)
mysql> create database cacti;
Query OK, 1 row affected (0.00 sec)
grant all on cacti.* to cacti@'localhost' identified by 'abc123';
GRANT 权限列表 ON 库名.表名 TO ‘用户名’@‘来源地址’【IDENTFIED BY ‘密码’】
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
导入数据库
完成
e. 配置snmpd服务
vim /etc/snmp/snmpd.conf
41 行om2sec notConfigUser 127.0.0.1 public//地址自己服务器的地址,也可用127.0.0.1来表示的,后面的"public"
表示的是snmp 团体名,也可以改的,默认的就是“public”
62行access notConfigGroup "" any noauth exact all none none//把"exact"后面的单词改成"all"
85 行view all included .1 80//把这一行前面的"#"号去掉
开启服务
f.配置cacti目录权限
useradd cacti -d /var/www/html/cacti -s /sbin/nologin
chown -R root:root /var/www/html/cacti/
chown -R cacti:cacti /var/www/html/cacti/rra /var/www/html/cacti/log