Page 1 of 1

Authorization failure /nagiosxi

Posted: Fri Sep 01, 2017 7:10 am
by foreverdirect
RHEL7 64bit 2014.r2.6
Migrated system from NagiosXI VMware image to RHEL7 using backup and restore.
After the restore to a new server with a new ip-address and new hostname, the web interface is unavailable because it generates an authentication failure.
uncommenting the authentication rules in conf.d/nagiosxi.conf will allow me to login with nagiosadmin using apache login screen.
But this doesn't allow automatic login, nor does it allow the upgrade to 5.4.8 because the install fails on:
http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authorization failed.

nagiosxi.conf:

<Directory "/usr/local/nagiosxi/html">
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
# AuthName "Nagios XI"
# AuthType Basic
# AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
# Require valid-user
</Directory>

Alias /nagiosxi "/usr/local/nagiosxi/html"

Re: Authorization failure /nagiosxi

Posted: Fri Sep 01, 2017 10:00 am
by scottwilkerson
The format changed in httpd 2.4

you should be able to replace with this

Code: Select all

<Directory "/usr/local/nagiosxi/html">
#  SSLRequireSSL
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all
   Require all granted
</Directory>

Alias /nagiosxi "/usr/local/nagiosxi/html"

# Special configuration to allow .htaccess in custom includes
<Directory "/usr/local/nagiosxi/html/includes/components/custom-includes">
    AllowOverride All
    Options None
</Directory>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule nagiosxi/api/v1/(.*)$ /usr/local/nagiosxi/html/api/v1/index.php?request=$1 [QSA,NC,L]
</IfModule>
Then restart httpd

Code: Select all

systemctl restart  httpd

Re: Authorization failure /nagiosxi

Posted: Tue Sep 05, 2017 8:35 am
by foreverdirect
Thanks a lot, this worked

Re: Authorization failure /nagiosxi

Posted: Tue Sep 05, 2017 9:05 am
by bolson
Closing this topic as resolved.

Thank you for visiting the Nagios Support Forum!