centos 7.9 安装最新版本zabbix6.4 - mysq8.0-php8.0/全网最详细
CentOS 7.9安装Zabbix 6.4,使用MySQL 8.0和PHP 8.0的步骤如下:
- 添加Zabbix官方仓库:
rpm -Uvh https://repo.zabbix.com/zabbix/6.4/rhel/7/x86_64/zabbix-release-6.4-1.el7.noarch.rpm
yum clean all
- 安装Zabbix服务器、前端和代理:
yum install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-agent
- 安装MySQL 8.0:
rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
yum install mysql-community-server
- 启动MySQL服务并设置开机自启:
systemctl start mysqld
systemctl enable mysqld
- 安全配置MySQL:
mysql_secure_installation
- 创建Zabbix数据库及用户并授权:
mysql -uroot -p
create database zabbix character set utf8 collate utf8_bin;
create user zabbix@localhost identified by 'your_password';
grant all privileges on zabbix.* to zabbix@localhost;
quit;
- 导入初始数据库模式和数据:
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
- 编辑Zabbix服务器配置文件,设置数据库密码:
vi /etc/zabbix/zabbix_server.conf
找到DBPassword=
行并设置密码:
DBPassword=your_password
- 配置PHP(确保已安装PHP和PHP的Zabbix前端):
yum install php php-mysql php-gd php-bcmath php-mbstring
- 调整Apache配置以适应Zabbix前端:
vi /etc/httpd/conf.d/zabbix.conf
将php_value date.timezone
设置为你的时区,例如:
php_value date.timezone Asia/Shanghai
- 启动Zabbix服务器、HTTPD服务并设置开机自启:
systemctl start zabbix-server zabbix-agent httpd
systemctl enable zabbix-server zabbix-agent httpd
- 配置防火墙允许HTTP和Zabbix Agent:
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=zabbix-agent
firewall-cmd --reload
- 通过浏览器访问Zabbix前端界面:
http://your_server_ip/zabbix
使用上述步骤,你可以在CentOS 7.9上成功安装Zabbix 6.4,使用MySQL 8.0和PHP 8.0。确保替换示例代码中的your_password
和Asia/Shanghai
为你自己的密码和时区。
评论已关闭