可以联网的centos7系统
关闭防火墙
selinux也关了
1、配置镜像源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
2、安装nginx并配置
yum install -y nginx
vi /etc/nginx/nginx.conf
server加上
server_name localhost
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # 必须要加
include fastcgi_params;
}
3.安装php-fpm
yum install -y php-fpm
find / -name php.ini
找到这个文件的位置
vi /etc/php.ini
直接输入 字母O
把下面5行写v里面
max_execution_time 300
memory_limit 128M
post_max_size = 16M
max_input_time 300
date.timezone = Asia/Shanghai
然后把下面这些注释掉
max_execution_time 30
max_input_time 60
post_max_size = 8M
4、安装zabbix服务端和web界面
rpm -ivh http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
yum install zabbix-server-mysql -y
yum install zabbix-web-mysql -y
5、配置zabbix前端使用的数据库
创建用户
mysql -uroot -pqwerasd
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
quit;
导入表
mkdir /script/zabbix -p
cd /script/zabbix
wget https://cdn.zabbix.com/zabbix/sources/oldstable/4.0/zabbix-4.0.50.tar.gz --no-check-certificate
tar xvf zabbix-4.0.50.tar.gz
mysql -uzabbix -pzabbix zabbix < /script/zabbix/zabbix-4.0.50/database/mysql/schema.sql
mysql -uzabbix -pzabbix zabbix < /script/zabbix/zabbix-4.0.50/database/mysql/images.sql
mysql -uzabbix -pzabbix zabbix < /script/zabbix/zabbix-4.0.50/database/mysql/data.sql
配置zabbix服务端
vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
6、复制web页面-启动所有服务
cp -rp /script/zabbix/zabbix-4.0.50/frontends/php/* /usr/share/nginx/html
chown -R zabbix.zabbix /usr/share/nginx/html/*
systemctl start php-fpm mariadb nginx
service zabbix-server start
7、访问
ip/setup.php
systemctl restart php-fpm nginx mariadb zabbix-server
下载的文件复制到里面
/usr/share/nginx/html/conf/zabbix.conf.php
next
8.登录
Admin/zabbix
界面如下: