Page 1 of 1

Migration from CentOS 5 to 7 issue with /nagiosxi/login.php

Posted: Thu May 07, 2015 2:38 pm
by BenCowan
I'm hacking my way through trying to migrate my NagiosXI setup in production on CentOS 5.8 over
to a test server running CentOS 7.1.1. It's running okay, but after the migration, I can only get
into the Nagios interface, the XI interface gives me a 403 Forbidden, but I'm not sure why:

You don't have permission to access /nagiosxi/ on this server.

It was working fine right after a fresh intsall.

Re: Migration from CentOS 5 to 7 issue with /nagiosxi/login.

Posted: Thu May 07, 2015 2:41 pm
by jdalrymple
What does your /etc/httpd/conf.d/nagiosxi.conf look like. Here is a working one on 7.0:

Code: Select all

<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
   Require all granted
</Directory>

Alias /nagiosxi "/usr/local/nagiosxi/html"
Apache configurations changed in 7.x

Re: Migration from CentOS 5 to 7 issue with /nagiosxi/login.

Posted: Thu May 07, 2015 4:29 pm
by BenCowan
I compared to mine and it looked the same except for, I did not have
this line:

Require all granted

I tried adding that and restarting httpd. I just get a blanks page now.

Re: Migration from CentOS 5 to 7 issue with /nagiosxi/login.

Posted: Thu May 07, 2015 4:32 pm
by jolson
Are any errors cropping up in your httpd error log?

Code: Select all

cat /var/log/httpd/error_log

Re: Migration from CentOS 5 to 7 issue with /nagiosxi/login.

Posted: Thu May 07, 2015 4:34 pm
by jdalrymple
BenCowan wrote:Require all granted
That would be the big change going to Apache 2.4 - obviously you're still not out of the woods though.

Does the tail of /var/log/httpd/access_log and/or /var/log/httpd/error_log offer any useful information - I expect you are having some php errors if you're getting a blank page.

Re: Migration from CentOS 5 to 7 issue with /nagiosxi/login.

Posted: Thu May 07, 2015 7:13 pm
by BenCowan
Found these errors in the log:
[Thu May 07 16:32:49.291124 2015] [:error] [pid 15002] [client ???.???.???.???:64253] PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
[Thu May 07 16:32:49.291219 2015] [:error] [pid 15002] [client ???.???.???.???:64253] PHP Fatal error: Unknown: Failed opening required '/usr/local/nagiosxi/html/login.php' (include_path='.:/usr/share/pear:/usr/share/php') in Unknown on line 0

I renamed /etc/httpd/conf.d/php.conf and replaced with a copy from my centos 5.8 system. This allowed me to get into the
NagiosXI interface, so this issue is resolved I believe. Now I see this:

System Status Degraded!
One or more critical components of Nagios XI has been stopped, is disabled, or has malfunctioned. This can cause problems with monitoring, notifications, reporting, and more. You should investigate this problem immediately.

but this is a different hurdle..., Thanks for the help everybody.