In our last article, we covered the installation of Icinga 2 on CentOS 8 / RHEL 8 Linux machine. This is a continuation guide discussing how you can install Icinga Web 2 on CentOS 8 / RHEL 8. Icinga Web 2 is a powerful PHP framework for web applications that comes in a clean and reduced design. It’s fast, responsive, accessible and easily extensible with modules.

We’ll install Icinga Web 2 from packages available on the official Icinga2 package repositories. After installation, the setup and configuration is done from a web interface with the help of a setup wizard.

Step 1: Install Icinga 2 on CentOS 8 / RHEL 8

You have to start with the installation of Icinga 2 using our guide below.

Install Icinga 2 on CentOS / RHEL 8

After installation of Icinga 2 server, proceed to install Icinga Web 2 on CentOS 8 / RHEL 8 Linux system.

Step 2: Install Icinga Web 2 on CentOS 8 / RHEL 8 Linux

Enable PowerTools repository and EPEL.

sudo dnf install -y 'dnf-command(config-manager)'
sudo dnf config-manager --set-enabled PowerTools
sudo dnf install -y epel-release

Then add the repository contents for Icinga Web 2 to our system.

sudo dnf install https://packages.icinga.com/epel/8/release/noarch/icinga-rpm-release/icinga-rpm-release-8-4.el8.icinga.noarch.rpm

Here is my installation output:

Last metadata expiration check: 0:02:42 ago on Sat 28 Dec 2019 09:03:06 AM EAT.
icinga-rpm-release-8-4.el8.icinga.noarch.rpm                                                                            8.3 kB/s | 9.5 kB     00:01    
Dependencies resolved.
========================================================================================================================================================
 Package                                  Arch                         Version                                 Repository                          Size
========================================================================================================================================================
Installing:
 icinga-rpm-release                       noarch                       8-4.el8.icinga                          @commandline                       9.5 k

Transaction Summary
========================================================================================================================================================
Install  1 Package

Total size: 9.5 k
Installed size: 2.6 k
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                1/1 
  Installing       : icinga-rpm-release-8-4.el8.icinga.noarch                                                                                       1/1 
  Verifying        : icinga-rpm-release-8-4.el8.icinga.noarch                                                                                       1/1 

Installed:
  icinga-rpm-release-8-4.el8.icinga.noarch                                                                                                              

Complete!

Update package index:

sudo dnf makecache 

Install Apache web server ans Icinga Web 2 on CentOS 8 / RHEL 8 Linux using the commands:

sudo dnf install httpd icingacli icingaweb2 php-json php-ldap

The dependency packages like PHP and other extensions will be installed from the AppStream repository.

We need to start httpd, service and configure firewalld.

sudo systemctl enable --now httpd
sudo firewall-cmd --add-service={http,https} --permanent
sudo firewall-cmd --reload

Also start PHP-FPM service.

sudo systemctl enable --now php-fpm.service

Icinga Web 2 configuration file is: /etc/httpd/conf.d/icingaweb2.conf

Put SELinux in Permissive Mode

For easy setup, consider disabling SELinux or putting it in permissive mode.

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

Before doing the next steps, confirm httpd and php-fpm services are in running state:

$ systemctl status php-fpm httpd
● php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2019-12-28 09:14:58 EAT; 9min ago
 Main PID: 12132 (php-fpm)
   Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec"
    Tasks: 6 (limit: 11512)
   Memory: 27.6M
   CGroup: /system.slice/php-fpm.service
           ├─12132 php-fpm: master process (/etc/php-fpm.conf)
           ├─12270 php-fpm: pool www
           ├─12271 php-fpm: pool www
           ├─12272 php-fpm: pool www
           ├─12273 php-fpm: pool www
           └─12274 php-fpm: pool www

Dec 28 09:14:58 centos8.novalocal systemd[1]: Starting The PHP FastCGI Process Manager...
Dec 28 09:14:58 centos8.novalocal systemd[1]: Started The PHP FastCGI Process Manager.

● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/httpd.service.d
           └─php-fpm.conf
   Active: active (running) since Sat 2019-12-28 09:14:58 EAT; 9min ago
     Docs: man:httpd.service(8)
 Main PID: 12131 (httpd)
   Status: "Running, listening on: port 80"
    Tasks: 213 (limit: 11512)
   Memory: 25.1M
   CGroup: /system.slice/httpd.service
           ├─12131 /usr/sbin/httpd -DFOREGROUND
           ├─12133 /usr/sbin/httpd -DFOREGROUND
           ├─12134 /usr/sbin/httpd -DFOREGROUND
           ├─12135 /usr/sbin/httpd -DFOREGROUND
           └─12136 /usr/sbin/httpd -DFOREGROUND

Dec 28 09:14:58 centos8.novalocal systemd[1]: Starting The Apache HTTP Server...
Dec 28 09:14:58 centos8.novalocal httpd[12131]: Server configured, listening on: port 80
Dec 28 09:14:58 centos8.novalocal systemd[1]: Started The Apache HTTP Server.

Step 2: Configure Icinga Web 2 on CentOS 8 / RHEL 8

Run the commands on CLI to start configurations:

sudo icingacli setup config webserver apache

Generate authentication token required for web setup. In order to generate a token use the command:

$ sudo icingacli setup token create
The newly generated setup token is: 879cae394a246ddc

Starting Web Setup

Finally visit Icinga Web 2 in your browser to access the setup wizard and complete the installation: /icingaweb2/setup.

setup icinga web 2 centos rhel 8 01

Paste token generated earlier and click next. In case you do not remember the token you can show it using the icingacli:

$ icingacli setup token show

On the next page, select the modules to enable:

setup icinga web 2 centos rhel 8 02

Confirm requirements then proceed to setup database.

setup icinga web 2 centos rhel 8 03

Fill and validate database configs.

setup icinga web 2 centos rhel 8 04

Configure backend name.

setup icinga web 2 centos rhel 8 05

Create the first admin user:

setup icinga web 2 centos rhel 8 06

Configure Logging:

setup icinga web 2 centos rhel 8 07

Fill all other required settings to finish installation of Icinga Web 2 on CentOS 8 / RHEL 8 Linux system.

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!


As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.

LEAVE A REPLY

Please enter your comment!
Please enter your name here