rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
yum clean all
sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo
## 启用Red Hat软件集
yum install centos-release-scl
## 修改/etc/yum.repos.d/zabbix.repo,并启用zabbix-frontend
vim /etc/yum.repos.d/zabbix.repo
[zabbix-frontend]
enabled=1
## 创建数据库,用户并授权
create database zabbix character set utf8 collate utf8_bin;
create user zabbix@localhost identified by 'Zabbix@123456';
grant all privileges on zabbix.* to zabbix@localhost;
## 导入表结构与初始化数据
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
## nginx配置
vim /etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf
listen 80;
server_name 192.168.150.160;
## php配置
vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
listen.acl_users = apache,nginx
php_value[date.timezone] = Asia/Shanghai
systemctl restart zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm
systemctl enable zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm