Linux CentOS7.9 zibbix5.0
rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
替换阿里源
sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo
chmod +x /etc/yum.repos.d/zabbix.repo
yum clean all
vim /etc/yum.repos.d/zabbix.repo #将zabbix-frontend中的enabled改为1
yum install zabbix-server-mysql zabbix-agent -y
安装 Software Collections
便于后续安装⾼版本的 php,默认 yum
yum install centos-release-scl -y
yum install zabbix-web-mysql-scl zabbix-apache-conf-scl -y
yum install mariadb-server -y
systemctl enable --now mariadb
#配置数据库
#这里编码设置很重要
mysql -e "create database zabbix character set utf8 collate utf8_bin;"
#这里用户为 zabbix 密码也是zabbix
mysql -e "create user 'zabbix'@'localhost' identified by 'zabbix';"
mysql -e "grant all privileges on zabbix.* to 'zabbix'@'localhost';"
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
mysql -uzabbix -pzabbix zabbix -e "show tables;"
vim /etc/zabbix/zabbix_server.conf
查看以DB开头的数据库信息
grep '^DB' /etc/zabbix/zabbix_server.conf
vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
php_value[date.timezone] = Asia/Shanghai
systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm
以上安装无误后默认访问地址为 IP地址/zabbix/index.php 自动跳转
后面全是默认,登录Username: Admin Password: zabbix