Centos7安装Zabbix4.0(server-agent模式)

安装zabbix server篇

一、安装前准备虚拟环境(已经准备好centos7服务器的此步骤-跳过)

创建虚拟机:在VirtualBox安装centos7
至少安装两台服务器:
zabbix server
zabbix agent

二、Centos7系统环境设置

# 升级系统组件到最新的版本
[root@zabbix ~]# yum -y update
# 临时关闭selinux
[root@zabbix ~]# setenforce 0
# 永久关闭selinux
[root@zabbix ~]# vi /etc/selinux/config
#将SELINUX=enforcing改为SELINUX=disabled
# 以上的更改需要重启后生效
[root@zabbix ~]# reboot
# 查看selinux是否关闭,Disabled 为关闭
[root@zabbix ~]# getenforce
Disabled

在这里插入图片描述

# 临时关闭防火墙
[root@zabbix ~]# systemctl stop firewalld.service
# 查看防火墙是否关闭
[root@zabbix ~]# firewall-cmd --state
not running
# 禁止firewall开机启动
[root@zabbix ~]# 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.

三、搭建LAMP环境

# 安装所需所有软体仓库
# Zabbix是建立在LAMP或者LNMP环境之上,在此为了方便就使用yum安装LAMP环境。
[root@zabbix ~]# yum install -y httpd mariadb-server mariadb php php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mhash
# 安装完成后检查应用版本
[root@zabbix ~]# rpm -qa httpd php mariadb
php-5.4.16-46.1.el7_7.x86_64
mariadb-5.5.64-1.el7.x86_64
httpd-2.4.6-90.el7.centos.x86_64
[root@zabbix ~]# vi /etc/httpd/conf/httpd.conf
ServerName www.zabbila.com      #修改为主机名
DirectoryIndex index.html index.php   # 添加首页支持格式

# 编辑httpd
vi /etc/httpd/conf/httpd.conf
ServerName www.zabbixla.com      #修改为主机名
DirectoryIndex index.html index.php   # 添加首页支持格式 

在这里插入图片描述

# 编辑配置php,配置中国时区 
[root@zabbix ~]# vi /etc/php.ini
date.timezone = PRC

在这里插入图片描述

# 启动httpd
[root@zabbix ~]# systemctl start httpd
# 加入开机自启动httpd
[root@zabbix ~]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
# 启动mysqld
[root@zabbix ~]# systemctl start mariadb
# 加入开机自启动mysqld
[root@zabbix ~]# systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
# 查看httpd启动情况,80端口监控表示httpd已启动
[root@zabbix ~]# ss -anplt | grep httpd
LISTEN     0      128       [::]:80                    [::]:*                   users:(("httpd",pid=1752,fd=4),("httpd",pid=1751,fd=4),("httpd",pid=1750,fd=4),("httpd",pid=1749,fd=4),("httpd",pid=1748,fd=4),("httpd",pid=1746,fd=4))
#查看mysqld启动情况,3306端口监控表示mysqld已启动 
[root@zabbix ~]# ss -naplt | grep mysqld
LISTEN     0      50           *:3306                     *:*                   users:(("mysqld",pid=2043,f
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值