一、安装环境介绍

操作系统:CentOS6.5

Mysql: 5.1

php: 官方要求5.4以上,php7暂不支持,本文选择使用php5.6

Apache: httpd2.2

zabbix: 3.0


二、安装httpd

yum -y install httpd httpd-devel


三、安装php

a.添加repo源(二选一)

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm


b.安装php及相关组件

yum install  php56w php56w-cli php56w-common php56w-devel php56w-pear php56w-gd php56w-mbstring php56w-mysql php56w-xml php56w-bcmath



四、安装mysql

yum -y install mysql-server mysql


启动数据库并设置密码

service mysqld start

/usr/bin/mysqladmin -u root password '123456'


五、安装zabbix

a.添加repo源

vi /etc/yum.repo.d/zabbix.repo

[zabbix]

name=Zabbix Official Repository - $basearch

baseurl=http://repo.zabbix.com/zabbix/3.0/rhel/6/$basearch/

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX

[zabbix-non-supported]

name=Zabbix Official Repository non-supported - $basearch

baseurl=http://repo.zabbix.com/non-supported/rhel/6/$basearch/

enabled=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX

gpgcheck=1


b.安装相关组件

yum install OpenIPMI libssh2 fping libcurl libiksemel net-snmp


c.安装zabbix

yum install -y zabbix-release.noarch

yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-java-gateway


d.创建初始化数据库

mysql> create database zabbix character set utf8 collate utf8_bin; 

mysql> grant all privileges on zabbix.* to zabbix@localhost identified by ''; 

mysql> quit;

zcat /usr/share/doc/zabbix-server-mysql-3.0.*/create.sql.gz | mysql -uzabbix -p zabbix


e.修改zabbix配置文件

# vi /etc/zabbix/zabbix_server.conf 

DBHost=localhost 

DBName=zabbix 

DBUser=zabbix 

DBPassword=


六、启动zabbix-server

service zabbix-server start


七、添加httpd的zabbix.conf文件

cp /usr/share/doc/zabbix-web-3.0.7/httpd22-example.conf /etc/httpd/conf.d/zabbix.conf

修改文件里的date.timezone Asia/ShangHai


重启httpd服务

service httpd restart


访问

http://172.0.0.1/zabbix