1、版本要求
操作系统版本 ubuntu18.04
zabbix server版本 zabbix-6.0.37(源码包)
php版本 php7.2(apt安装)
mariadb版本 mariadb-10.5.22(apt安装)
nginx版本 1.24.0(apt安装)
2、安装php
sudo apt-get update
sudo apt-get install build-essential autoconf libtool pkg-config libssl-dev
sudo apt install php
#安装完后直接启动即可
sudo systemctl start php7.2-fpm.service #根据实际的systemd服务启动
3、安装nginx
sudo vim /etc/apt/sources.list.d/nginx.list #可以一个服务一个list文件
deb http://nginx.org/packages/ubuntu/ bionic nginx
deb-src http://nginx.org/packages/ubuntu/ bionic nginx
sudo apt install nginx
sudo vim /etc/nginx/sites-available/zabbix.conf #这里是调用的
server {
listen 4090; #自定义端口
server_name localhost;
location / {
root /www; # 存放页面的目录
index index.html index.php;
}
location ~ \.php$ {
root /www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi.conf;
}
}
sudo systemctl start nginx
#ss -tnl查看4090端口是否启动
4、安装mariadb
# 添加安装源到list文件
sudo sh -c 'echo "deb [arch=$(dp