1, replacing the source yum
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache
2, start yum install
-ivh RPM http://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
will be produced in /etc/yum.repos.d/ a zabbix.repo file
3, install the relevant package components
yum install zabbix-server zabbix-web zabbix-server-mysql zabbix-web-mysql mariadb-server mariadb -y
4, modify the php time zone
sed -i 's@# php_value date.timezone Europe/Riga@php_value date.timezone Asia/Shanghai@g' /etc/httpd/conf.d/zabbix.conf
5, the configuration database, create a database and user zabbix
systemctl start mariadb
mysql
create database zabbix character set utf8 collate utf8_bin;
grant all on zabbix.* to zabbix@'localhost' identified by '123456';
exit
6, into the database
cd /usr/share/doc/zabbix-server-mysql-4.0.9/
zcat create.sql.gz |mysql -uzabbix -p123456 zabbix
7, modify the configuration file zabbix
/etc/zabbix/zabbix_server.conf vim
DBHost = localhost # database hosts
DBName = zabbix # database name
DBUser = zabbix # database user
DBPassword = 123456 # password database
8, zabbix and start apache
systemctl start zabbix-server
systemctl start httpd
Access zabbix
Reproduced in: https: //blog.51cto.com/12226796/2410973