1. 安装zabbix的repo源:
rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm2.安装zabbix-server-mysql和zabbix-web-mysql
yum install zabbix-server-mysql zabbix-web-mysql -y3.安装mariadb
yum install mariadb-server.x86_64 -y systemctl enable mariadb.service systemctl start mariadb.service mysql_secure_installation mysql mysql> create database zabbix character set utf8 collate utf8_bin; mysql> grant all on zabbix.* to zabbix@localhost identified by '123456'; rpm -ql zabbix-server-mysql cd /usr/share/doc/zabbix-server-mysql-4.0.22 gzip -d create.sql.gz mysql -uzabbix -p123456 zabbix <create.sql4.修改zabbix-server的配置
vim /etc/zabbix/zabbix_server.conf DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=123456 systemctl enable zabbix-server.service systemctl start zabbix-server.service netstat -lntup Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 32566/mysqld tcp6 0 0 :::10051 :::* LISTEN 13644/ntpd5.修改zabbix-web配置
systemctl start httpd systemctl enable httpd vim /etc/httpd/conf.d/zabbix.conf php_value date.timezone Asia/Shanghai systemctl restart httpd数据库为:zabbix,密码为:123456.