1,关闭防火墙和selinux安装常用工具
systemctl stop firewalld && systemctl disable firewalld
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
cat /etc/selinux/config
关闭selinux后机器需要重启生效
检查系统时间是否有误
date
如果时间有问题,下载ntpdate同步时间
yum install -y ntpdate
ntpdate -u ntp1.aliyun.com
将系统时间写入到bios中
clock -w
yum install -y vim wget net-tools bash-completion yum-utils
2,下载安装编辑PHP7.2
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum -y install httpd httpd-devel
vim /etc/httpd/conf.d/cacti.conf
这里是新建的一个cacti.conf文件,可以直接将内容复制粘贴上下述配置文件中
#Cacti: An RRDtool based graphing web application
#
# For security reasons, the Cacti web interface is accessible only to
# localhost in the default configuration. If you want to allow other clients
# to access your Cacti installation, change the httpd ACLs below.
# For example:
# On httpd 2.4, change "Require host localhost" to "Require all granted".
# On httpd 2.2, change "Allow from localhost" to "Allow from all".
#端口修改为80
<VirtualHost *:80>
LogLevel warn
#servername修改为自己主机地址
ServerName 192.168.200.242
ServerAdmin admin@yourdomain.com
DocumentRoot "/var/www/html/cacti"
Alias /cacti /var/www/html/cacti
#注释掉加密
# SSLEngine On
# SSLCertificateFile /etc/ssl/certs/YourOwnCertFile.crt
# SSLCertificateKeyFile /etc/ssl/private/YourOwnCertKey.key
<Directory /var/www/html/cacti/>
<IfModule mod_authz_core.c>
# httpd 2.4
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
# httpd 2.2
Order deny,allow
Deny from all
Allow from all</