CentOS 7.9 installation and configuration process of zabbix5.0.14

CentOS 7.9 installation and configuration process of zabbix5.0.14

1. Basic environment configuration

1. Turn off firewalld and selinux

##Shut down firewalld
systemctl stop firewalld
systemctl disabled firewalld
##Turn off selinux
setenforce 0 && sed -i.bak 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config

2. Configure the yum warehouse and the zabbix warehouse

wget https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
yum install zabbix-release-5.0-1.el7.noarch.rpm
##View the configuration of the zabbix warehouse in /etc/yum.repos.d/[root@localhost opt]# cat /etc/yum.repos.d/zabbix.repo 
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591

[zabbix-frontend]
name=Zabbix Official Repository frontend - $basearch
baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/frontend
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591

[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/debuginfo/
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=1

[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=http://repo.zabbix.com/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1

Configure mysql warehouse (mysql storage is required for zabbix monitoring background)

##Use Tsinghua University's mirror repository [root@localhost opt]# cat /etc/yum.repos.d/mysql.repo 
[mysql]
name=mysql
baseurl=https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql-5.7-community-el7-x86_64/
gpgcheck=0
enabled=1

Configure the centos extras repository (subsequent installations will require the software packages in this repository)

[root@localhost opt]# cat /etc/yum.repos.d/centos-extras.repo 
[centos-extras]
name=centos-extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/7.9.2009/extras/x86_64/
enabled=1
gpgcheck=0

2. Install the database

yum install mysql-community-server

Start mysql service

systemctl start mysql
systemctl enable mysql

On initial server startup, the following occurs:

Server initialization.

SSL certificate and key files are generated in the data directory.

validate_password is installed and enabled.

'root'@'localhost creates a superuser account. The superuser password is set and stored in the error log file. To display it, use the following command:

[root@localhost opt]# grep 'temporary password' /var/log/mysqld.log
2021-08-16T08:00:40.185610Z 1 [Note] A temporary password is generated for root@localhost: r8EaYzX_Xper

Change the root password as soon as possible by logging in with the generated temporary password and setting a custom password for the superuser account:

[root@localhost opt]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 702
Server version: 5.7.35 MySQL Community Server (GPL)

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'xxxxxxx';

Notice:
validate_password is installed by default. The default password policy validate_password is implemented, which requires that the password contain at least 1 uppercase letter, 1 lowercase letter, 1 number, and 1 special character, and the total password length is at least 8 characters.

Modify the mysql configuration file to improve its performance

[root@centos7 ~]# vim /etc/my.cnf
[mysqld] //Add the following two lines under [mysqld] skip_name_resolve = ON
innodb_file_per_table=ON

3. Install zabbix related components

1. Install zabbix-server
Install zabbix-server and zabbix-agent

yum install zabbix-server-mysql zabbix-agent

Install the zabbix-get command line tool (for later deployment of angent on the client to test monitoring items)

yum install zabbix-get

2. Install frontend
Enable Red Hat Software Collections (for easy installation of dependent packages)

##This software package is in the centos-extras repository, so the centos-extras repository was configured before yum install centos-release-scl

Edit the configuration file /etc/yum.repos.d/zabbix.repo and enable zabbix-frontend repository.

[zabbix-frontend]
...
enabled=1
...

Install Zabbix frontend packages

yum install zabbix-web-mysql-scl zabbix-nginx-conf-scl

Error when installing frontend
insert image description here
It is prompted that rh-php72-php-fpm, rh-nginx116-nginx and other software packages are required.
Solution:
Because centos-release-scl was not installed before, the above problem occurred. After configuring the centos-extras warehouse, install it.

3. Create the initial database

#mysql -uroot -pxxxxx

mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by 'xxxxxxx';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> quit;

Import the initial schema and data, and you will be prompted for your newly created password.

# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

4. Edit the configuration file /etc/zabbix/zabbix_server.conf to configure the database for Zabbix server

DBPassword=xxxxxxx

5. Configure PHP for Zabbix frontend
Edit the configuration file /etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf

##Uncomment these two lines listen 80;
server_name example.com;
##At the same time, comment out the configuration that provides the default web service vim /etc/opt/rh/rh-nginx116/nginx/nginx.conf
...
server {
        #listen 80 default_server;
        #listen [::]:80 default_server;
        server_name _;
...
##Then restart the service

Edit the configuration file /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf, add the nginx user in the listen.acl_users directive (the system will automatically create it when installing rh-nginx116-nginx)

listen.acl_users = apache,nginx
##Then configure the time zone php_value[date.timezone] = Asia/Shanghai

6. Start the zabbix server and agent processes, and set them to start automatically at boot.

systemctl restart zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm
systemctl enable zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm

4. Configure Zabbix frontend

Open the Zabbix frontend URL in your browser:

For Apache: http://<server_ip_or_name>/zabbix
For Nginx: http://<server_ip_or_name>

insert image description here

Check the prerequisites to ensure that all software prerequisites are met.

insert image description here

NOTE: If you need to change the Apache user or group, you must verify permissions on the session folder. Otherwise Zabbix installer may not be able to continue.

Configure Database Connection Enter the details for connecting to your database. The Zabbix database must have been created

insert image description here

Zabbix Server Details Enter the Zabbix server details. Entering the name of the Zabbix server is optional

insert image description here

Review the settings summary.

insert image description here

Installation Complete

insert image description here

Log in
The Zabbix frontend is ready! The default username is Admin and the password is zabbix.

insert image description here
insert image description here

This is the end of this article about centos7.9 installation of zabbix5.0.14 and configuration process. For more information about centos7.9 installation of zabbix, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • CentOS7 installation zabbix 4.0 tutorial (illustration and text)
  • CentOS 8 Installation Guide for Zabbix 4.4
  • Super detailed steps to install zabbix3.0 on centos7
  • Centos7.4 zabbix3.4.7 source code installation method and steps
  • How to install and deploy the latest version of Zabbix 3.4 on Centos 7.3 (picture and text)
  • Detailed explanation of Centos7.2 compilation and installation of zabbix3.2 (detailed steps)
  • Detailed installation steps of Zabbix3.4 under Centos 7
  • Detailed tutorial on installing Zabbix 3.2 on CentOS 7.2

<<:  Whitespace processing in HTML/CSS and how to preserve whitespace in the page

>>:  Some common advanced SQL statements in MySQL

Recommend

Detailed explanation of docker compose usage

Table of contents Docker Compose usage scenarios ...

How to modify Ubuntu's source list (source list) detailed explanation

Introduction The default source of Ubuntu is not ...

How to set up scheduled tasks in Linux and Windows

Table of contents Linux 1. Basic use of crontab 2...

Mysql Sql statement exercises (50 questions)

Table name and fields –1. Student List Student (s...

CSS3 achieves infinite scrolling/carousel effect of list

Effect Preview Ideas Scroll the current list to t...

Several ways to store images in MySQL database

Usually the pictures uploaded by users need to be...

How to install Linux flash

How to install flash in Linux 1. Visit the flash ...

Vue easily realizes watermark effect

Preface: Use watermark effect in vue project, you...

Solution to the problem of adaptive height and width of css display table

Definition and Usage The display property specifi...

Summary of the main attributes of the body tag

bgcolor="text color" background="ba...

Solutions to MySQL OOM (memory overflow)

OOM stands for "Out Of Memory", which m...

Summary of bootstrap learning experience-css style design sharing

Due to the needs of the project, I plan to study ...

Vue implements setting multiple countdowns at the same time

This article example shares the specific code of ...