[root@iz2ze9n3z2fl9zj9hrv58vz ~]# yum install cacti -y
[root@iz2ze9n3z2fl9zj9hrv58vz ~]# whereis cacti
cacti: /etc/cacti /usr/share/cacti
nginx的文件cacti.java-er.com.conf
访问下
http://cacti.java-er.com/
Warning: 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/cacti/include/global_constants.php on line 30
[root@iz2ze9n3z2fl9zj9hrv58vz ~]# vi /usr/share/cacti/include/global_constants.php
第一行增加
ini_set('date.timezone','Asia/Shanghai');
再次访问
FATAL: Connection to Cacti database failed. Please ensure:
the PHP MySQL module is installed and enabled.
the database is running.
the credentials in config.php are valid.
mysql -u root -p
create database cacti default character set utf8;
source /usr/share/doc/cacti-1.2.5/cacti.sql
修改/etc/cacti/db.php文件配置数据库
踩坑:cacti.sql文件路径去/usr/share/doc/下找,而不是/usr/share/cacti/下找
踩坑:用二级域名而不是目录需要修改db.php中的$url_path = '/cacti/';
$url_path = '/';
修改完成直接访问就成功了
默认账户和密码admin/admin
爆出了一堆数据库要调整的值
时区修改
下面这句命令行
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u admin mysql -p
vi /etc/my.cnf
以下参数如果之前的my.cnf文件有,那么修改,没有就增加
[mysqld]
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
innodb_flush_log_at_timeout = 3
innodb_read_io_threads = 32
innodb_write_io_threads = 16
等我再写一篇配置篇