1.操作环境
CentOS7操作系统
2.操作步骤
1.关闭SELinux和防火墙
#setenforce 0
#vim /etc/selinux/config
将SELINUX的值设置为disabled
#systemctl stop firewalld
#systemctl disable firewalld
2.部署依赖及环境 安装apache并设置开机自启
#yum install httpd
#systemctl enable httpd
#systemctl start httpd
安装数据库并设置开机自启
#yum install mariadb mariadb-server
#systemctl enable mariadb
#systemctl start mariadb
#mysql -u root -p
安装php
#yum install php php-mysql
下载zabbix并安装zabbix的包
#rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
#yum install -y zabbix-server-mysql zabbix-get zabbix-web zabbix-web-mysql zabbix-agent zabbix-sender
登录到数据库后,创建zabbix库并且设置为utf-8的字符集,创建账户并授权设置密码
#create database zabbix character set utf8 collate utf8_bin;
#grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
#flush privileges;
#exit;
进行导入表的操作
#cd /usr/share/doc/zabbix-server-mysql-3.2.16/
#gunzip create.sql.gz
#mysql -u root -p
#use zabbix;
#source create.sql;
exit;
3.修改对应的配置文件 修改zabbix的配置文件
#cd /etc/zabbix
#vim zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBSocket=/var/lib/mysql/mysql.sock
#systemctl start zabbix-server
#systemctl enable zabbix-server
配置php
#cd /etc/httpd/conf.d
#vim zabbix.conf
php_value data.timezone Asia/Shanghai
#systemctl restart httpd
4.打开zabbix 打开网址http://127.0.0.1/zabbix 第一个Password是数据库密码zabbix 首次登录的用户名是Admin 密码是zabbix 随后进入操作即可
|