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

How to use mysqldump for full and point-in-time backups

Mysqldump is used for logical backup in MySQL. Al...

MySQL 8.0.12 Simple Installation Tutorial

This article shares the installation tutorial of ...

Use of Docker image storage overlayfs

1. Overview The image in Docker is designed in la...

Vue implements the function of calling the mobile phone camera and album

This article shares the specific code of Vue to a...

SQL implementation of LeetCode (182. Duplicate mailboxes)

[LeetCode] 182.Duplicate Emails Write a SQL query...

JavaScript to achieve fireworks effects (object-oriented)

This article shares the specific code for JavaScr...

Nginx source code compilation and installation process record

The installation of the rpm package is relatively...

Detailed steps to install MySQL 8.0.27 in Linux 7.6 binary

Table of contents 1. Environmental Preparation 1....

Docker configuration Alibaba Cloud image acceleration pull implementation

Today I used docker to pull the image, but the sp...

How to quickly log in to MySQL database without password under Shell

background When we want to log in to the MySQL da...

Solution to the problem of session failure caused by nginx reverse proxy

A colleague asked for help: the login to the back...

How to install Nginx and configure multiple domain names

Nginx Installation CentOS 6.x yum does not have n...

Summary of Ubuntu backup methods (four types)

Method 1: To use respin, follow these steps: sudo...

Detailed explanation of Linux one-line command to process batch files

Preface The best method may not be the one you ca...

Summary of various forms of applying CSS styles in web pages

1. Inline style, placed in <body></body&g...