1,升级
yum -y update
2,关闭selinux
vi /etc/selinux/config
3,关防火墙
firewall-cmd --state #查看默认防火墙状态,关闭后显示not running,开启后显示running
systemctl stop firewalld.service #临时关闭firewall
systemctl disable firewalld.service
4,升级php
Zabbix是建立在LAMP或者LNMP环境之上,在此为了方便就使用yum安装LAMP环境。
yum install -y httpd mariadb-server mariadb php php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mhash
rpm -qa httpd php mariadb
5,编辑http
vi /etc/httpd/conf/httpd.conf
ServerName www.zabbixyk.com #修改为主机名
DirectoryIndex index.html index.php # 添加首页支持格式
6更改中国时间
vi /etc/php.ini
将;date.timezone = 修改为date.timezone =
PRC
去掉前面的注释保存并退出
7启动
启动httpd、mysqld
systemctl start httpd
systemctl enable httpd #启动并加入开机自启动httpd
systemctl start mariadb
systemctl enable mariadb #启动并加入开机自启动mysqld
8安装zabbix
1.yum install php-bcmath php-mbstring –y
2.rpm
-ivh
http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
3.yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent –y
4.cd /usr/share/doc/zabbix-server-mysql-4.0.40/
5.zcat create.sql.gz | mysql -uzabbix -p -h 192.168.137.129
zabbix
6.
mysql -uroot –p zabbix –e ‘show tables’
9.设置配置时区,并设置加入开机自启动zabbix-server
vi
/etc/httpd/conf.d/zabbix.conf
将# php_value date.timezone Europe/Riga 变更成php_value date.timezone Asia/Shanghai
systemctl enable zabbix-server #启动并加入开机自启动zabbix-server
重启