一、配置IP地址能够访问互联网(略)

二、安装MYSQL

yum -y install wget

wget http://repo.mysql.com//mysql57-community-release-el7-7.noarch.rpm 

rpm -ivh mysql57-community-release-el7-7.noarch.rpm

yum install mysql-community-server 

systemctl start mysqld.service 

systemctl enable mysqld.service 

三、配置MYSQL

cat /var/log/mysqld.log #找到随机密码行:[Note] A temporary password is generated for root@localhost: g?d2_w3tzO6L   

mysql_secure_installation #提示修改ROOT密码,修改需要符合MYSQL密码策略,一路按Y完成安装。

四、安装HTTPD

yum install httpd

systemctl start httpd.service

systemctl enable httpd.service

五、安装PHP

yum install php 

vi /etc/httpd/conf/httpd.conf   修改 ServerName localhost:80

yum install php-mysql php-gd php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc php-bcmath

六、安装PHPMYADMIN

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

yum install phpmyadmin

七、配置PHPMYADMIN

<RequireAny> 

Require all granted 

systemctl restart httpd.service

通过 http://IP地址/phpMyAdmin访问

八、安装ZABBIX

rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm 

yum -y install zabbix-server-mysql zabbix-web-mysql

yum -y install zabbix-agent

九、创建数据库

create database zabbix character set utf8 collate utf8_bin;

grant all privileges on zabbix.* to zabbix@localhost identified by 'Xxx.123';

十、构建数据结构

cd /usr/share/doc/zabbix-server-mysql-3.0.2/

zcat create.sql.gz | mysql -uroot -pXxx.123 zabbix

十一、配置ZABBIX并启动

vi /etc/zabbix/zabbix_server.conf

vi /etc/zabbix/zabbix_server.conf

DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=XXXXXX

启动服务

systemctl enable zabbix-server 

systemctl start zabbix-server

十二、配置时区

vi /etc/httpd/conf.d/zabbix.conf

php_value date.timezone Asia/Shanghai

systemctl restart httpd.Service  #重启httpd

十三、安装ZABBIX

http://IP地址/zabbix  #默认账号:Admin,密码:zabbix

十四、支持中文

vi /usr/share/zabbix/include/locales.inc.php

'zh_CN' => ['name' => _('Chinese (zh_CN)'),     'display' => ture]

======================================

常见故障:

一、WEB访问异常

关闭防火墙,关闭Selinux或开放相关端口

二、数据库无法访问

确定数据库是否建立,防火墙是否允许,权限能否访问。

三、图形显示乱码

修改/usr/share/zabbix/include/defines.inc.php文件的第45行和第93行,如下:

vim /usr/share/zabbix/include/defines.inc.php

define(‘ZBX_GRAPH_FONT_NAME’,’mysh’);

define(‘ZBX_FONT_NAME’, ‘mysh’);

下载自己喜欢的字体,改名为msyh放到/usr/share/zabbix/fonts目录下即可。