一、更換yum源php
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 makecachemysql
二、開始yum安裝web
rpm -ivh http://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
會在/etc/yum.repos.d/生產一個zabbix.repo的文件sql
三、安裝相關軟件包組件數據庫
yum install zabbix-server zabbix-web zabbix-server-mysql zabbix-web-mysql mariadb-server mariadb -yapache
四、修改php時區vim
sed -i 's@# php_value date.timezone Europe/Riga@php_value date.timezone Asia/Shanghai@g' /etc/httpd/conf.d/zabbix.confide
五、配置數據庫,建立zabbix數據庫及用戶server
systemctl start mariadb
mysql
create database zabbix character set utf8 collate utf8_bin;
grant all on zabbix.* to zabbix@'localhost' identified by '123456';
exitget
六、導入數據庫
cd /usr/share/doc/zabbix-server-mysql-4.0.9/
zcat create.sql.gz |mysql -uzabbix -p123456 zabbix
七、修改zabbix配置文件
vim /etc/zabbix/zabbix_server.conf
DBHost=localhost #數據庫所在主機
DBName=zabbix #數據庫名
DBUser=zabbix #數據庫用戶
DBPassword=123456 #數據庫密碼
八、啓動zabbix及apache
systemctl start zabbix-server
systemctl start httpd
訪問zabbix