如何在CentOS 8/Rhel 8上安装ICinga Web 2

时间:2020-02-23 14:44:40  来源:igfitidea点击:

在我们的最后一篇文章中,我们涵盖了CentOS 8/Rhel 8 Linux机器上的ICinga 2的安装。

这是一个延续教程,讨论如何在CentOS 8/Rhel 8上安装ICinga Web 2.
Icinga Web 2是一个功能强大的PHP框架,用于Web应用程序,这些框架是一种干净和减少的设计。
它快速,响应,可访问,可容易地与模块可扩展。

我们将在官方ICinga2包存储库上提供ICinga Web 2.
安装后,在安装向导的帮助下从Web界面完成设置和配置。

第1步:在CentOS 8/Rhel 8上安装ICinga 2

我们必须使用下面的教程开始安装ICinga 2.

在CentOS/Rhel 8上安装ICinga 2

安装ICinga 2服务器后,继续在CentOS 8/Rhel 8 Linux系统上安装ICinga Web 2.

第2步:在CentOS 8/Rhel 8 Linux上安装ICinga Web 2

启用PowerTools存储库和涡涡柱。

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

然后将ICinga Web 2的存储库内容添加到我们的系统中。

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

这是我的安装

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!

更新包索引:

sudo dnf makecache

使用命令安装Apache Web Server ANS ICinga Web 2在CentOS 8/Rhel 8 Linux上:

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

将从AppStream存储库安装PHP和其他扩展等依赖项包。

我们需要启动httpd,服务和配置防火墙。

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

还启动PHP-FPM服务。

sudo systemctl enable --now php-fpm.service

ICinga Web 2配置文件是: /etc/httpd/conf.d/icingaweb2.conf

将selinux放在许可模式下

有关易于设置的,请考虑禁用SELinux或者将其放在许可模式下。

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

在执行后续步骤之前,请确认HTTPD和PHP-FPM服务处于运行状态:

$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.

第2步:在CentOS 8/Rhel 8上配置ICinga Web 2

运行CLI上的命令以启动配置:

sudo icingacli setup config webserver apache

生成Web设置所需的身份验证令牌。
要生成令牌,请使用命令:

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

启动Web设置

最后访问浏览器中的ICinga Web 2以访问安装向导并完成安装: /icingaweb2/setup

粘贴令牌之前生成,然后单击"下一步"。
如果我们不记得令牌,我们可以使用ICingacli显示它:

$icingacli setup token show

在下一页上,选择要启用的模块:

确认要求然后继续设置数据库。

填充和验证数据库配置。

配置后端名称。

创建第一个管理员用户:

配置日志记录:

填充所有其他必需的设置,以在CentOS 8/Rhel 8 Linux系统上完成ICinga Web 2的安装。