Install Zabbix 7.0 LTS With Nginx on Oracle Linux 9

This is a step-by-step guide on how to install and configure Zabbix with Nginx on Oracle Linux 9. Zabbix is a powerful monitoring tool and is 100% free. It is used in monitoring network devices, systems, server applications, hardware appliances and IoT devices among others. It ultimately monitors the performance of IT infrastructure components and services.

Zabbix works in a client/server architecture. An agent software is installed on a client machine which facilitates communication with the server. The client software is available for Linux, Unix and Windows. Tools such as SNMP can also be used with devices that do not have a compatible Zabbix agent.

Install Zabbix 7.0 LTS on Oracle Linux 9

For our complete zabbix installation, we require a database server (MySQL/ MariaDB), PHP and Nginx web server. In my installation, I preferred to disable SElinux. Edit SElinux configuration file, change the SELINUX line to ‘disabled’

sudo setenforce 0
sudo sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config
cat /etc/selinux/config | grep SELINUX=

Install Zabbix dependencies

Install Epel and Remi repositories to use in installing required dependencies.

sudo dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm 
sudo dnf -y install https://rpms.remirepo.net/enterprise/remi-release-9.rpm

Install required dependencies

We are going to install php8.0. Let’s disable php8.2 that comes with Oracle Linux 9 by default:

sudo dnf module reset php 
sudo dnf module install php:remi-8.2

Install other php modules with the following command:

sudo dnf -y install  php-fpm php-cli php-gd php-mysql php-snmp php-pear php-curl php-common php-mcrypt

Install MariaDB Database server

Install MariaDB by running the following command:

sudo dnf -y install mariadb mariadb-server

Enable and start mariadb with the below commands

sudo systemctl enable mariadb
sudo systemctl start mariadb
sudo systemctl status mariadb

Secure MariaDB and set root password:

$ sudo mysql_secure_installation
Enter current password for root (enter for none): Just press Enter
Set root password? [Y/n] Y 
New password:  New-root-password
Re-enter new password: Re-enter New-root-password
Remove anonymous users? [Y/n] Y 
Disallow root login remotely? [Y/n] Y 
Remove test database and access to it? [Y/n] Y 
Reload privilege tables now? [Y/n] Y 
Thanks for using MariaDB!

Connect to MariaDB and set up a database and a user

mysql -u root -p

Login with the password set above and run the following commands to create a database and a user.

CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin; 
CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'StrongDBPassw0rd'; 
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';
set global log_bin_trust_function_creators = 1; 
FLUSH PRIVILEGES; 
EXIT

Install Nginx Web Server

Run the command below to install nginx:

sudo dnf -y install nginx

Enable and start nginx:

sudo systemctl enable nginx
sudo systemctl start nginx

Install Zabbix server on Oracle Linux 9

Disable Zabbix packages provided by EPEL. Edit file /etc/yum.repos.d/epel.repo and add the following statement:

[epel]
...
excludepkgs=zabbix*

Use the below command to download and install Zabbix server on Oracle Linux 9:

sudo rpm -Uvh https://repo.zabbix.com/zabbix/7.0/oracle/9/x86_64/zabbix-release-latest-7.0.el9.noarch.rpm
sudo dnf clean all

Also install zabbix server, frontend, and agent using the below command:

sudo dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent

Agree to import GPG keys when prompted:

Now proceed and start and enable Zabbix server, agent:

sudo systemctl start zabbix-server zabbix-agent
sudo systemctl enable zabbix-server zabbix-agent

By default, Zabbix-server runs on pot 10050 while Zabbix-agent runs on 10051. You can confirm if this is the case by running the following commands:

sudo ss -tlnup | grep 10050
sudo ss -tnlup | grep 10051

Configure Zabbix

On Zabbix server host import initial schema and data. You will be prompted to enter your newly created password:

zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

Disable log_bin_trust_function_creators option after importing database schema:

$ mysql -u root -p
MariaDB [(none)]> set global log_bin_trust_function_creators = 0;
MariaDB [(none)]> quit;

Next, edit the zabbix_server.conf file and define your Zabbix database credentials:

sudo vim /etc/zabbix/zabbix_server.conf

Add the credentials set when creating Zabbix database:

DBHost=localhost 
DBName=zabbix 
DBUser=zabbix 
DBPassword=StrongDBPassw0rd

Next, configure PHP for Zabbix frontend by editing the following file:

sudo vim /etc/php-fpm.d/zabbix.conf

Change the timezone value to suit your timezone:

php_value[date.timezone] = Africa/Nairobi

Save the file and restart php-fpm

sudo systemctl start php-fpm

Configure Nginx as Proxy for Zabbix Server

A file zabbix.conf is already created in nginx path. Edit it to update your servername and listening port:

sudo vim /etc/nginx/conf.d/zabbix.conf

Your configuration file should look as below:

listen 80;
server_name zabbix.example.com;

Save the file and restart nginx:

sudo systemctl restart nginx

Configure Firewall Rules for Zabbix

If your firewall is active, you need to open zabbix and nginx ports as shown:

sudo firewall-cmd --permanent --add-port=10050/tcp 
sudo firewall-cmd --permanent --add-port=10051/tcp 
sudo firewall-cmd --permanent --add-port=80/tcp
sudo firewall-cmd --reload

Zabbix 5 Web access on Oracle Linux 9

Now access your zabbix server from the browser using your server name: http://zabbix.example.com. You should see a page as below:

Click on next step to go to the next page to which is as shown below:

Click Next step once you have confirmed all is okay. In the next page, provide database credentials to connect to the zabbix database.

In the next page, provide zabbix server details.

The next page provides installation summary.

Click Next step:

Click finish and you will be presented with Zabbix login page. Login with user Admin and password zabbix.

Once you login, you should see a page as shown below:

That’s it about how to install and configure Zabbix 7.0 with Nginx on Oracle Linux 9. Install and configure Zabbix agents on the servers you wish to monitor and enjoy your Zabbix Monitoring! Remember to check more interesting Linux guides below:

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Unlock the Right Solutions with Confidence

At CloudSpinx, we don’t just offer services - we deliver clarity, direction, and results. Whether you're navigating cloud adoption, scaling infrastructure, or solving DevOps challenges, our seasoned experts help you make smart, strategic decisions with total confidence. Let us turn complexity into opportunity and bring your vision to life.

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Post

Pritunl VPN is an open source VPN server and management panel. Has a graphical interface (GUI) that provides a friendly […]

This guide takes us through how to install and configure LibreNMS on Oracle Linux 9. LibreNMS is a powerful open-source […]

LAMP is an acronym for Linux, Apache, MySQL and PHP, which are open-source software that work together to build powerful […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.