Zabbix安装实验报告(centos7 zabbix-4.0)
一、Zabbix 主机的初始配置
配置IP地址、主机名,关闭 kdump 与 SELinux
配置IP地址
TYPE=“Ethernet”
BOOTPROTO=“static”
DEFROUTE=“yes”
PEERDNS=“yes”
PEERROUTES=“yes”
IPV4_FAILURE_FATAL=“no”
IPV6INIT=“yes”
IPV6_AUTOCONF=“yes”
IPV6_DEFROUTE=“yes”
IPV6_PEERDNS=“yes”
IPV6_PEERROUTES=“yes”
IPV6_FAILURE_FATAL=“no”
IPV6_ADDR_GEN_MODE=“stable-privacy”
NAME=“ens33”
UUID=“c6ccf3d4-1631-4ad8-b106-767335dfd119”
DEVICE=“ens33”
ONBOOT=“yes”
IPADDR=“192.168.22.39”
GATEWAY=“192.168.22.254”
NETMASK=“255.255.255.0”
DNS1=“114.114.114.114”
DNS2=“8.8.8.8”
设置主机名
[root@localhost ~]# vim /etc/sysconfig/network
Created by anaconda
HOSTNAME=gzt.linux.org
[root@localhost ~]# vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.22.39 gzt gzt.linux.org
关闭 kdump 与 SELinux
[root@localhost ~]# vim /etc/selinux/config
This file controls the state of SELinux on the system.
SELINUX= can take one of these three values:
enforcing - SELinux security policy is enforced.
permissive - SELinux prints warnings instead of enforcing.
disabled - No SELinux policy is loaded.
SELINUX=disabled
SELINUXTYPE= can take one of three two values:
targeted - Targeted processes are protected,
minimum - Modification of targeted policy. Only selected processes are protected.
mls - Multi Level Security protection.
SELINUXTYPE=targeted
[root@localhost ~]# systemctl disable kdump
[root@localhost ~]# systemctl stop kdump
[root@localhost ~]# reboot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
二、部署 LAMP
安装Apache 和 Mariadb
[root@localhost ~]# yum -y install httpd
[root@localhost ~]# yum install mariadb-server -y
[root@gzt ~]# systemctl start httpd.service
[root@gzt ~]# systemctl enable httpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@gzt ~]# systemctl start mariadb.service
[root@gzt ~]# systemctl enable mariadb.service
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
安装php包
[root@localhost ~]# yum -y install php
安装PHP组件,使PHP支持 MariaDB
[root@localhost ~]# yum -y install php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash
重启MariaDB、 Apache
[root@gzt ~]# systemctl restart mariadb.service
[root@gzt ~]# systemctl restart httpd.service