将Zabbix监控部署在LNMP平台详细步骤

本文详细介绍LNMP环境的安装配置过程及Zabbix监控系统的部署步骤,包括Nginx、MySQL、PHP的安装配置,以及通过Zabbix实现服务器监控。

文章目录

项目环境:

服务端:192.168.200.40
客户端:192.168.200.60

服务端安装配置

关闭防火墙

[root@localhost ~]# systemctl stop firewalld.service 
[root@localhost ~]# systemctl disable firewalld.service 
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# setenforce 0

一、LNMP安装环境

1、安装nginx1.16

(1)从官网上下载

root@localhost ~]# wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
--2021-04-01 11:13:37--  http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
正在解析主机 nginx.org (nginx.org)... 52.58.199.22, 3.125.197.172, 2a05:d014:edb:5702::6, ...
正在连接 nginx.org (nginx.org)|52.58.199.22|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:4680 (4.6K) [application/x-redhat-package-manager]
正在保存至: “nginx-release-centos-7-0.el7.ngx.noarch.rpm”

100%[======================>] 4,680       --.-K/s 用时 0s      

2021-04-01 11:13:38 (400 MB/s) - 已保存 “nginx-release-centos-7-0.el7.ngx.noarch.rpm” [4680/4680])

(2)手动创建nginx yum安装源

[root@localhost ~]# vim /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1

(3)重新加载

[root@localhost ~]# yum list

如果出现以下问题:
[root@localhost ~]# yum list
已加载插件:fastestmirror, langpacks
/var/run/yum.pid 已被锁定,PID  17043 的另一个程序正在运行。
Another app is currently holding the yum lock; waiting for it to exit...
  另一个应用程序是:PackageKit
    内存:162 M RSS 649 MB VSZ)
    已启动: Thu Apr  1 11:10:49 2021 - 03:31之前
    状态  :睡眠中,进程ID:17043


将进程杀掉即可:
[root@localhost ~]# kill -5  17043

(4)安装nginx

[root@localhost ~]# yum install nginx -y

(5)开启服务

[root@localhost ~]# systemctl start nginx                   
[root@localhost ~]# netstat -ntap | grep nginx
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      108485/nginx: maste 
[root@localhost ~]# systemctl enable nginx                   #设为开机自启动
Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.

(6)打开网页访问 http://192.168.200.40

在这里插入图片描述

2、安装mysql 5.7

(1)安装服务

[root@localhost ~]# yum install -y mariadb-server mariadb

(2)开启服务

[root@localhost ~]# systemctl start mariadb.service 
[root@localhost ~]# systemctl enable mariadb.service 
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

(3)进行设置

[root@localhost ~]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION 
评论 10
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

清风~

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值