RHEL8 Icinga Web2 “Page not Found”

Hello

Recently I have experienced an issue with RHEL8 Icinga web2

The PHP version used

PHP 8.0.30 (cli) (built: Aug  3 2023 17:13:08) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.30, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.30, Copyright (c), by Zend Technologies

Here the Icinga 2 version used

icinga2 - The Icinga 2 network monitoring daemon (version: r2.13.5-1)

Copyright (c) 2012-2024 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl2.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

System information:
  Platform: Red Hat Enterprise Linux
  Platform version: 8.9 (Ootpa)
  Kernel: Linux
  Kernel version: 4.18.0-513.11.1.el8_9.x86_64
  Architecture: x86_64

Build information:
  Compiler: GNU 8.5.0
  Build host: unknown
  OpenSSL version: OpenSSL 1.1.1k  FIPS 25 Mar 2021

Application information:

General paths:
  Config directory: /etc/icinga2
  Data directory: /var/lib/icinga2
  Log directory: /var/log/icinga2
  Cache directory: /var/cache/icinga2
  Spool directory: /var/spool/icinga2
  Run directory: /run/icinga2

Old paths (deprecated):
  Installation root: /usr
  Sysconf directory: /etc
  Run directory (base): /run
  Local state directory: /var

Internal paths:
  Package data directory: /usr/share/icinga2
  State path: /var/lib/icinga2/icinga2.state
  Modified attributes path: /var/lib/icinga2/modified-attributes.conf
  Objects path: /var/cache/icinga2/icinga2.debug
  Vars path: /var/cache/icinga2/icinga2.vars
  PID path: /run/icinga2/icinga2.pid

Server operating system and version

[root@epic-icinga2-monitor ~]# cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="8.9 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.9"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.9 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.9
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.9"

This is what the /var/log/httpd/ssl_access_log says

10.149.0.23 - - [13/May/2024:15:58:22 -0500] "GET /js/icinga.min.js HTTP/1.1" 200 374675
10.149.0.23 - - [13/May/2024:15:58:27 -0500] "GET /img/icinga-logo-big.svg HTTP/1.1" 200 6232
10.149.0.23 - - [13/May/2024:15:58:28 -0500] "GET /img/favicon.png HTTP/1.1" 200 806
10.149.0.23 - - [13/May/2024:15:58:37 -0500] "GET /icingaweb2/ HTTP/1.1" 404 3298
10.149.0.23 - - [13/May/2024:15:58:38 -0500] "GET /js/icinga.min.js HTTP/1.1" 304 -
10.149.0.23 - - [13/May/2024:15:58:38 -0500] "GET /css/icinga.min.css HTTP/1.1" 304 -
10.149.0.23 - - [13/May/2024:15:58:38 -0500] "GET /img/favicon.png HTTP/1.1" 200 806
10.149.0.23 - - [13/May/2024:16:06:44 -0500] "GET /authentication/login HTTP/1.1" 200 7228
10.149.0.23 - - [13/May/2024:16:06:46 -0500] "GET /css/icinga.min.css HTTP/1.1" 304 -
10.149.0.23 - - [13/May/2024:16:06:46 -0500] "GET /js/icinga.min.js HTTP/1.1" 304 -
10.149.0.23 - - [13/May/2024:16:44:15 -0500] "GET /icingaweb2/ HTTP/1.1" 404 3298
10.149.0.23 - - [13/May/2024:16:44:16 -0500] "GET /js/icinga.min.js HTTP/1.1" 304 -
10.149.0.23 - - [13/May/2024:16:44:16 -0500] "GET /css/icinga.min.css HTTP/1.1" 304 -
10.149.0.23 - - [13/May/2024:16:44:16 -0500] "GET /img/favicon.png HTTP/1.1" 200 806

Also, run the command icinga2 daemon -C if something is wrong with the file configuration

[2024-05-13 16:46:04 -0500] information/cli: Icinga application loader (version: r2.13.5-1)
[2024-05-13 16:46:04 -0500] information/cli: Loading configuration file(s).
[2024-05-13 16:46:04 -0500] information/ConfigItem: Committing config item(s).

....

[2024-05-13 16:46:04 -0500] information/ConfigItem: Instantiated 1 ApiListener.
[2024-05-13 16:46:04 -0500] information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
[2024-05-13 16:46:04 -0500] information/cli: Finished validating the configuration file(s).

I don’t know if something is missing but everything looks good :frowning_face:

Any help would be appreciated!

Thanks in advance.

Here is my /etc/httpd/conf.d/icingaweb2.conf file

Alias /icingaweb2 "/usr/share/icingaweb2/public"

<IfVersion < 2.4>
    # Forward PHP requests to FPM
    SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
    <LocationMatch "^/icingaweb2/(.*\.php)$">
        ProxyPassMatch "fcgi://127.0.0.1:9000/usr/share/icingaweb2/public/$1"
    </LocationMatch>
</IfVersion>

Listen 443 https

SSLPassPhraseDialog exec:/usr/local/bin/ssl_password.sh
SSLSessionCache         shmcb:/run/httpd/sslcache(512000)
SSLSessionCacheTimeout  300
SSLRandomSeed startup file:/dev/urandom  256
SSLRandomSeed connect builtin
SSLCryptoDevice builtin

##
## SSL Virtual Host Context
##
<VirtualHost *:443>
  DocumentRoot "/usr/share/icingaweb2/public"

  ErrorLog logs/ssl_error_log
  TransferLog logs/ssl_access_log
  LogLevel warn

  SSLEngine on
  SSLProtocol All -SSLv2 -SSLv3
  SSLCipherSuite HIGH:!TLSv1:!SSLv3:!SSLv2:!aNULL
  SSLCertificateFile /etc/pki/tls/certs/epic-star.crt
  SSLCertificateKeyFile /etc/pki/tls/private/epic-star.key
  SSLCertificateChainFile /etc/pki/tls/certs/DigiCertCA.crt

  <Files ~ "\.(cgi|shtml|phtml|php3?)$">
      SSLOptions +StdEnvVars
  </Files>
  <Directory "/var/www/cgi-bin">
      SSLOptions +StdEnvVars
  </Directory>

  BrowserMatch "MSIE [2-5]" \
        nokeepalive ssl-unclean-shutdown \
        downgrade-1.0 force-response-1.0

  CustomLog logs/ssl_request_log \
        "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

  ## Rewrite rules
  RewriteEngine On

  <Directory "/usr/share/icingaweb2/public">
    Options SymLinksIfOwnerMatch
    AllowOverride All
    DirectoryIndex index.php

    AuthType Basic
    AuthName "Icinga Web 2"
    AuthUserFile "/etc/icingaweb2/.http-users"
    Require valid-user

    <IfModule mod_authz_core.c>
        # Apache 2.4
        <RequireAll>
            Require all granted
        </RequireAll>
    </IfModule>

    <IfModule !mod_rewrite.c>
        DirectoryIndex error_norewrite.html
        ErrorDocument 404 /icingaweb2/error_norewrite.html
    </IfModule>


    SetEnv ICINGAWEB_CONFIGDIR "/etc/icingaweb2"
    EnableSendfile Off

    RewriteEngine on
    # modified base
    RewriteBase /
    RewriteRule ^$ dashboard/ [NC,R]
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
  </Directory>
</VirtualHost>

After several weeks of digging to this issue, it was sorted out with the following step on (icingaweb2.conf)

#    <IfModule mod_authz_core.c>
#        # Apache 2.4
#        <RequireAll>
#            Require all granted
#        </RequireAll>
#    </IfModule>

I could successfully login using Webserver Authentication.

1 Like