在CentOS 7上搭建Zabbix

先最小安装CentOS7

安装源:http://mirrors.163.com/centos/7/os/x86_64/

软件选择:最小安装基本功能

 

添加epel源

yum install epel-release

 

命令自动补全

yum install bash-completion

 

更新系统

yum update

 

安装数据库

yum install mariadb-server

 

启动数据库

systemctl start mariadb.service

配置数据库账号

mysql_secure_installation

 

安装web环境

yum install php php-mysql httpd

 

安装zabbix库及程序

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

# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent

 

创建初始数据库

# mysql -uroot -p

password

mysql> create database zabbix character set utf8 collate utf8_bin;

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

mysql> quit;

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

 

修改zabbix server配置文件数据库连接密码

Edit file /etc/zabbix/zabbix_server.conf

DBPassword=password

 

修改前端PHP配置文件的时区

Edit file /etc/httpd/conf.d/zabbix.conf, uncomment and set the right timezone for you.

# php_value date.timezone Asia/Shanghai

 

启动服务程序

systemctl start mariadb.service

systemctl enable mariadb.service

systemctl start zabbix-server.service

systemctl enable zabbix-server.service

systemctl start zabbix-agent.service

systemctl enable zabbix-agent.service

systemctl start httpd.service

systemctl enable httpd.service

 

允许防火墙http访问

firewall-cmd --permanent --zone=public --add-service=http

firewall-cmd --reload

 

进行web控制台设置

http://zabbixhost/zabbix/

填写数据库连接信息等完成设置

 

setsebool -P httpd_can_network_connect on selinux 允许它通过httpd服务

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值