Centos6系列安装Zabbix3.0

刚开始接触zabbix踩了无数的坑,不知道centos6系列是安装不了zabbix3.0(yum安装),于是在github上找到了一个项目,大家可以参考一下https://github.com/zabbixcn/zabbix3.0-rpm.git
本文主要说明如何通过CentOS6(64位)安装zabbix 3.0

环境要求


PHP >= 5.4(默认CentOS6 是5.3.3,需自己安装) curl >= 7.20 (如需支持SMTP认证)
git clone https://github.com/zabbixcn/zabbix3.0-rpm.git
cd zabbix3.0-rpm/RPMS

安装mysql


MySQL建议使用5.6版本,CentOS6默认为5.1,不建议使用,性能偏低
1
2
3
4
5
6
7
8
9
rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
yum install mysql-server -y #此过程会因为网路问题偏慢,请耐心等待
vim /etc/my.cnf
skip_name_resolve=on
innodb_file_per_table=on
mysql
mysql> CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
mysql> GRANT ALL ON zabbix.* TO 'zabbix'@'127.0.0.1' IDENTIFIED BY 'zabbix';
mysql> FLUSH PRIVILEGES;

安装Apache,PHP,Zabbix-Web


Zabbix 3.0对PHP的要求最低为5.4,而CentOS6默认为5.3.3,完全不满足要求,故需要利用第三方源,将PHP升级到5.4以上,注意,不支持PHP7
1
2
3
4
5
6
7
8
9
rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm
yum install zabbix-web-mysql-3.0.0-1.el6.noarch.rpm
zabbix-web-3.0.0-1.el6.noarch.rpm httpd php56w php56w-gd php56w-mysql
php56w-bcmath php56w-mbstring php56w-xml php56w-ldap
/etc/init.d/httpd restart
/etc/init.d/php restart
sed -i "s@# php_value date.timezone Europe/Riga@php_value date.timezone
Asia/Shanghai@g" /etc/httpd/conf.d/zabbix.conf

安装zabbix-server


1
2
3
4
5
6
7
8
9
10
11
yum localinstall zabbix-server-mysql-3.0.0-1.el6.x86_64.rpm
vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
cd /usr/share/zabbix-server-mysql-3.0.0
zcat create.sql.gz | mysql -uzabbix -pzabbix zabbix
/etc/init.d/zabbix-server restart

zabbix web界面配置


http://${IP}/zabbix
用户:Admin 密码:zabbix

火柴 wechat
扫描上方二维码关注我的博客!
0%