Linux

How To Install Zabbix On CentOS 7 With Configuration

How To Install Zabbix On CentOS 7 With Configuration

Insight: How To Install Zabbix On CentOS 7 With Configuration

Zabbix is an open source Linux monitoring software. It monitors various services like network services, application, network hardware and servers.

In this tutorial, We will show you the easy method of installing zabbix on CentOS 7 with configuration steps.

How To Install Zabbix On CentOS 7 With Configuration

Install Apache2/httpd on CentOS 7

At first you need to install Apache2/httpd on CentOS 7. Run the following commands to install Apache2/httpd on CentOS 7.

sudo yum -y install httpd

Now, Start and enable the service

systemctl start httpd
systemctl enable httpd

Install and Configure PHP 7.2 on CentOS 7

Now, We need to install PHP 7. We will use a third-party repository. Run following commands below.

yum -y install epel-release
sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Now install PHP 7.2 packages.

yum -y install mod_php72w php72w-cli php72w-common php72w-devel php72w-pear php72w-gd php72w-mbstring php72w-mysql php72w-xml php72w-bcmath

We need to edit the default ‘php.ini’ file. Edit the file using the vim editor.

vim /etc/php.ini

Change the values of the configuration as shown below.

 max_execution_time = 600
 max_input_time = 600
 memory_limit = 256M
 post_max_size = 32M
 upload_max_filesize = 16M
 date.timezone = Asia/Jakarta

Save and exit.

Install Database In CentOS 7

We will install and Configure MariaDB in CentOS7.

Install mariadb server in CentOS 7 using yum command below.

sudo yum -y install mariadb-server

Start the service and enable it:

systemctl start mariadb
systemctl enable mariadb

 

Now run the command below to configure MariaDB root password and follow the on screen instruction. You need to type the password and enter after the on screen instruction.

READ THIS ALSO  Install Cockpit On CentOS 7,RHEL 7 & Fedora 28
mysql_secure_installation

Now, we need to create a new database for our Zabbix installation.

Run the following command to login to the MySQL shell.

mysql -u root -p

We are creating a database zabbix with password omgfoss.

create database zabbix; 
grant all privileges on zabbix.* to [email protected]'localhost' identified by 'omgfoss'; 
grant all privileges on zabbix.* to [email protected]'%' identified by 'omgfoss'; 
flush privileges;

 


How To Install Zabbix On CentOS 7 With Configuration

We will install and configure Zabbix from the official repository.

First step:

Install Zabbix packages, Zabbix server, frontend, agent.

Add the Zabbix repository to the CentOS 7 system and install it:

yum -y install http://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-1.el7.noarch.rpm
yum -y install zabbix-get zabbix-server-mysql zabbix-web-mysql zabbix-agent

Now, Import initial schema and data. You will be prompted to enter your newly created password.

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

Edit file /etc/zabbix/zabbix_server.conf

DBPassword=password

Now start the Zabbix-server service and enable it to launch every time you start your system.

systemctl start zabbix-server
systemctl enable zabbix-server

Zabbix-server is running on the CentOS 7 system and you can verify it with the command below.

systemctl status zabbix-server

Help us to improve this article if there is any mistakes.