安装zabbix-4.0-LTS(Apache+mariadb)
更新:HHH   时间:2023-1-7


1.1 环境准备

10.0.0.61      zabbix-server

hostnamectl set-hostname zabbix-server  &&  bash
sed -ri 's#(IPADDR=)(.*)#\110.0.0.61#g' /etc/sysconfig/network-scripts/ifcfg-eth0
systemctl restart network  &&  ip add
cat >>/etc/hosts<<EOF
10.0.0.61 zabbix-server
EOF

1.2 配置zabbix yum仓库

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

1.3 安装zabbix服务端和zabbix-web前端

yum install zabbix-server-mysql zabbix-web-mysql  -y
rpm -qa |grep zabbix

1.4 安装mariadb

yum install mariadb-server -y
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation
回车
n
4次y

1.5 创建zabbix库,授权zabbix用户

create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by '123456';

1.6 导入zabbix表结构和初始数据

zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p123456 zabbix
#检查zabbix库是否导入成功
mysql -uroot  zabbix -e 'show tables;'

1.7 配置启动zabbix-server

vi /etc/zabbix/zabbix_server.conf
91行:DBHost=localhost
100行:DBName=zabbix
116行:DBUser=zabbix
124行:DBPassword=123456
#启动zabbix-server
systemctl start zabbix-server 
systemctl enable zabbix-server
#检查
netstat -lntup | grep 10051

1.8 修改Zabbix前端的PHP配置,并启动httpd

vi /etc/httpd/conf.d/zabbix.conf        #<==修改时区为上海
 20行:php_value date.timezone Asia/Shanghai

systemctl start httpd
systemctl enable httpd

1.9 前端zabbix-web的安装

浏览器访问:http://10.0.0.61/zabbix
登录的账号密码:
Admin
zabbix
后期修改zabbix数据库密码的时候,需要修改的配置文件:
/etc/zabbix/web/zabbix.conf.php








返回云计算教程...