CentOS 7.4 installation configuration Zabbix 3.4.2

1, Installation environment description

Two machines are installed with centos-7-x86_-minimal-1708.iso

Download address: https://www.centos.org/download/

It is best to set up IP and HOSTNAME during installation

The IP and HOSTNAME downloads for both machines are as follows

Main 192.168.10.157 ZABBIX server

From 192.168.10.140 ZABBIX agent

Set host for each node

[mawenwu@zabbix-server ~]$ sudo vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.10.157 zabbix-server
192.168.10.140 zabbix-agent

Turn off DHCP for each node and set it to static IP

[mawenwu@zabbix-server ~]$ sudo vi /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=87a7a287-0360-476a-996c-a60012f7b087
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.10.157
PREFIX=24
GATEWAY=192.168.31.1
DNS1=192.168.31.1
IPV6_PRIVACY=no

Turn off firewall

All nodes should be set

[mawenwu@zabbix-server ~]$ systemctl disable firewalld
[mawenwu@zabbix-server ~]$ systemctl stop firewalld

Turn off SELinux

All nodes should be set

To modify the configuration file, restart the machine:

[mawenwu@zabbix-server ~]$ sudo vi /etc/sysconfig/selinux
SELINUX=disabled

2, Install LAMP

1. Install and configure MariaDB

[mawenwu@zabbix-server ~]$ sudo yum install mariadb-server -y
[mawenwu@zabbix-server ~]$ systemctl start mariadb
[mawenwu@zabbix-server ~]$ systemctl enable mariadb
#Database initialization settings
[mawenwu@zabbix-server ~]$ mysql_secure_installation
#First, set the password. You will be prompted to enter the password first
Enter current password for root (enter for none):<–First run direct return
#Set password
Set root password? [Y/n] <– Set or not root User password, entering y Parallel or direct return
New password: <– Set up root User's password
Re-enter new password: <– Enter your password again
#Other configurations
Remove anonymous users? [Y/n] <– Delete anonymous user or not, enter
Disallow root login remotely? [Y/n] <–Prohibited or not root Remote login,Enter,
Remove test database and access to it? [Y/n] <– Delete or not test Database, enter
Reload privilege tables now? [Y/n] <– Reload permission table or not, enter
#Initialization of MariaDB is completed. Next, test the login and enter the password to log in normally
[mawenwu@zabbix-server ~]$ mysql -uroot -p

2. Install Apache

[mawenwu@zabbix-server ~]$ sudo yum install httpd -y
[mawenwu@zabbix-server ~]$ systemctl start httpd.service
[mawenwu@zabbix-server ~]$ systemctl enable httpd.service

3. Install PHP

[mawenwu@zabbix-server ~]$ sudo yum install php -y

1111111111111111

Tags: Zabbix sudo MariaDB SELinux

Posted on Mon, 04 May 2020 17:46:28 -0700 by larsojl