zabbix 5.4在 CentOS8.3中的安装(mysql8/php7)

0x1 安装 zabbix包及各种必用软件和依赖

# rpm -Uvh https://repo.zabbix.com/zabbix/5.4/rhel/8/x86_64/zabbix-release-5.4-1.el8.noarch.rpm
# dnf clean all

# dnf install -y mysql.x86_64 mysql-devel.x86_64 mysql-common.x86_64 mysql-libs.x86_64 mysql-server.x86_64 mysql-errmsg.x86_64 zabbix-proxy-mysql.x86_64  zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-agent nginx tree net-tools wget curl php.x86_64 php-devel.x86_64 php-fpm.x86_64 php-mbstring.x86_64 php-mysqlnd.x86_64 php-opcache.x86_64 php-pecl-zip.x86_64 php-json.x86_64 langpacks-zh_CN


0x2 配置各个文件和参数

配置数据库
# systemctl start mysql
# mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> quit;

导入数据库表
# zcat /usr/share/doc/zabbix-sql-scripts/mysql/create.sql.gz | mysql -uzabbix -p zabbix

配置文件及数据密码
# vi /etc/zabbix/zabbix_server.conf

DBPassword=password
FpingLocation=/usr/sbin/fping
Fping6Location=/usr/sbin/fping6

授权fping和fping6  及配置文件 
chown root:zabbix /usr/sbin/fping
chmod 6755 /usr/sbin/fping
chmod +s /usr/sbin/fping
chown root:zabbix /usr/sbin/fping6
chmod 6755 /usr/sbin/fping6
chmod +s /usr/sbin/fping6


修改nginx及PHP信息

Edit file /etc/nginx/conf.d/zabbix.conf and /etc/nginx/nginx.conf, uncomment and set 'listen' and 'server_name' directives.
# listen 80;
# server_name example.com;

root 


关闭FW或修改FW配置
systemctl stop firewalld
或FW配置命令
firewall-cmd --zone=public --add-service=zabbix-server --permanent
firewall-cmd --zone=public --add-service=zabbix-agent --permanent
firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --zone=public --add-service=https --permanent
firewall-cmd --zone=public --add-service=mysql --permanent
firewall-cmd --reload

关闭selinux
setenforce 0

或永久关闭 selinux
# vi /etc/selinux/config
SELINUX=disabled

0x3 重启各大服务PASS


# systemctl restart zabbix-server zabbix-agent nginx php-fpm
# systemctl enable zabbix-server zabbix-agent nginx php-fpm


更换中文字体
使用Windows中的字体替换graphfont.ttf
字体上传到/usr/share/zabbix/assets/fonts下面后,将雅黑字体MSYH.TTF改名为graphfont.ttf

 

0x4 浏览器中配置

zabbix数据库的用户名和密码要正确,配置中如果PHP自检没通过,请修改相应的 php配置文件   /etc/php.ini
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

gamers

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值