nginx环境下的cacti配置

php+nginx的配置参考 http://dnuser.blog.51cto.com/4863891/1258322

以前安装过apache和cacti的环境,但是现在的服务器直接采用的nginx,所以只能在nginx环境中配置cacti。



1、安装snmp

[root@localhost]#yum -y install net-snmp net-snmp-devel net-snmp-libs net-snmp-utils

 安装rrdtool

[root@localhost]#yum -y install rrdtool

2、下载cacti最新版

[root@localhost]#cd /soft/

#wget http://www.cacti.net/downloads/cacti-0.8.8a.tar.gz

解压

[root@localhost soft]# tar -zxvf cacti-0.8.8a.tar.gz

[root@localhost soft]# mv cacti-0.8.8a /var/www/

[root@localhost soft]#cd /var/www/

[root@localhost soft]#mv cacti-0.8.8a cacti

3.修改nginx配置

location /cacti {

           root   /var/www/cacti;

           index  index.php;

       }


mysql数据库添加用户

creat database cacti;

grant all on cacti.* to cactiuser@localhost identified by 'cactipass';

use cacti;

source /var/www/cacti/cacti.sql



有时候打开页面出现类似下面的错误


date(): It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Chongqing’ for ‘CST/8.0/no DST’ instead

解决办法,在php.ini里加上

date.timezone = "Asia/Shanghai"


你可能感兴趣的:(nginx,cacti)