Alma Linux 8
Zabbix 7.0 LTS
postgresql
Nginx
一、Alma Linux 8
最小化安装
1、关闭防火墙:
systemctl stop firewalld.service #停止firewalld服务
systemctl disable firewalld.service #设置开机默认不启动
#生产环境单独在防火墙上开启端口和策略
#firewall-cmd --permanent --zone=public --add-port=80/tcp
# firewall-cmd --reload
2、关闭selinux
getenforce #查看状态
vi /etc/sysconfig/selinux #开机不启动
SELINUX=disabled
3、更新系统
yum update -y
安装Zabbix 7.0 LTS
1、安装zabbix源
rpm -Uvh https://repo.zabbix.com/zabbix/7.0/alma/8/x86_64/zabbix-release-7.0-1.el8.noarch.rpm
dnf clean all
2、切换PHP版本为8.0
dnf module switch-to php:8.0
image.png
3、安装Zabbix服务端,Web前端,客户端
dnf install zabbix-server-pgsql zabbix-web-pgsql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
二、安装postgresql 数据库
https://www.postgresql.org/download/linux/redhat/
参考官网安装
1、安装postgresql 源
dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
image.png
三、禁用系统内置yum源的PostgreSQL安装模块
dnf -qy module disable postgresql
image.png
4、安装postgresql
dnf install -y postgresql16-server
5、初始化数据库并启动
/usr/pgsql-16/bin/postgresql-16-setup initdb
systemctl enable postgresql-16
systemctl start postgresql-16
image.png
6、创建数据库
sudo -u postgres createuser --pwprompt zabbix
sudo -u postgres createdb -O zabbix zabbix
7、导入初始架构和数据
zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix
8、为Zabbix server配置数据库
vi /etc/zabbix/zabbix_server.conf
DBPassword=password
9、为Zabbix前端配置PHP
vi /etc/nginx/conf.d/zabbix.conf
取消这2行的注释
listen 8080;
server_name example.com;
image.png
四、启动web页面配置zabbix7
image.png
image.png
image.png
image.png
image.png
用户名 :Admin
密码:zabbix