简介:本文将指导您在CentOS 8上部署Zabbix 6.4、PostgreSQL 15和PHP 7.4,从环境准备到安装配置,让您轻松搭建监控系统。
在部署Zabbix之前,请确保您的CentOS 8系统已满足以下要求:
启动PostgreSQL服务并设置为开机启动:
sudo dnf install postgresql-server postgresql-contrib -y
创建一个用于Zabbix的用户和数据库:
sudo systemctl start postgresqlsudo systemctl enable postgresql
步骤二:安装PHP 7.4
sudo -u postgres createuser -s zabbixsudo -u postgres createdb -O zabbix zabbix
步骤三:安装Zabbix 6.4
sudo dnf install php php-fpm php-cli php-gd php-mysqlnd php-zip php-xml php-mbstring php-pear php-bcmath -y
步骤四:配置Zabbix数据库连接
sudo rpm -ivh zabbix-server-mysql-6.4.x-x86_64.rpm zabbix-web-mysql-6.4.x-x86_64.rpm zabbix-apache-conf-6.4.x-x86_64.rpm zabbix-agent-6.4.x-x86_64.rpm zabbix-get-6.4.x-x86_64.rpm zabbix-release-6.4.x-1.el8.noarch.rpm zabbix-sql-scripts-6.4.x-1.el8.noarch.rpm zabbix-web-mysql-6.4.x-x86_64.rpm zabbix-web-php74-6.4.x-x86_64.rpm zabbix-apache2-conf-6.4.x-x86_64.rpm zabbix-doc-6.4.x-1.el8.noarch.rpm zabbix-services-6.4.x-1.el8.noarch.rpm zabbix-web-nginx-ssl-7.2.x-1.el8.noarch.rpmsudo dnf install mod_ssl -ysudo systemctl start httpdsudo systemctl enable httpd
打开
sudo zcat /etc/zabbix/zabbix_server.conf.d/zabbix_server_db_conf*.gz > /etc/zabbix/zabbix_server.conf
/etc/zabbix/zabbix_server.conf文件,进行以下配置更改:步骤五:配置Zabbix Web前端连接数据库
DBPassword=your_password_hereDBPasswordFile=/etc/zabbix/zabbix_server_db_conf_postfix_password_file
/etc/zabbix/apache2/zabbix.conf,进行以下配置更改:
DBPassword=your_password_here