Page 1 of 2

Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.04

Posted: Fri Nov 14, 2014 11:18 am
by stewlg
I recently put a server through an unexpectedly traumatic Ubuntu apt-get dist-upgrade to 14.04, and one of the things affected was Apache and Nagios.

I've finally gotten it so I can see the Nagios screens again, but it's still not working correctly yet.

- I'm no longer prompted to log in, ever (I want to always log in as nagiosadmin)
- I see "Logged in as ?" under current network status
- When I try to do anything I get error messages such as "It appears as though you do not have permission to view information for any of the hosts you requested... If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI and check the authorization options in your CGI configuration file."
- I get no errors in Apache's log or Nagios's log

Looking at others with similar problems, I would assume I need to get Apache to oblige me to login. I've tried to cause this to happen a variety of ways, but I so far have not gotten it to work. For example here's my httpd.conf:

Code: Select all

ScriptAlias /nagios/cgi-bin /usr/lib/cgi-bin/nagios3
<Directory "/usr/lib/cgi-bin/nagios3">
    AllowOverride AuthConfig
    Options ExecCGI
    Require all granted
    AuthName "Nagios Access"
    AuthType Basic
    AuthUserFile /usr/local/nagios/etc/htpasswd.users
    require valid-user
</Directory>

Alias /nagios /usr/local/nagios/share
<Directory "/usr/local/nagios/share">
    Options None
    AllowOverride AuthConfig
    Require all granted
    AuthName "Nagios Access"
    AuthType Basic
    AuthUserFile /usr/local/nagios/etc/htpasswd.users
    require valid-user
</Directory>
(I've been running Nagios since 3, don't be thrown off by the directory name; I promise to fix it if I can get this working again.)

Thank you!

Re: Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.

Posted: Fri Nov 14, 2014 11:29 am
by lmiltchev
Can you run the following command and show us the output?

Code: Select all

grep nag /etc/group

Re: Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.

Posted: Fri Nov 14, 2014 12:00 pm
by stewlg
Sure:

Code: Select all

root@griffin:/var/log/apache2# grep nag /etc/group
nagios:x:1003:
nagcmd:x:1004:nagios,www-data

Re: Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.

Posted: Fri Nov 14, 2014 3:19 pm
by abrist
The user "nagios" should be in the groups "nagios" and "www-data".
The user "www-data" should be in the groups "nagios" and "www-data".

Re: Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.

Posted: Fri Nov 14, 2014 8:52 pm
by stewlg
Ok, this is how it looks now:

Code: Select all

root@griffin:~# grep nag /etc/group
www-data:x:33:nagios,www-data
nagios:x:1003:nagios,www-data
nagcmd:x:1004:nagios,www-data
My problem remains - no change.

Re: Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.

Posted: Fri Nov 14, 2014 9:20 pm
by Box293
Is SELinux enabled?

getenforce

Also, run these commands:

Code: Select all

a2enmod rewrite
a2enmod cgi
service apache2 restart
Does this help?

Re: Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.

Posted: Sat Nov 15, 2014 1:31 am
by stewlg
Apparently I am not running selinux. I didn't need selinux before, hopefully I don't need it now.

Code: Select all

root@griffin:~# getenforce
Disabled
root@griffin:~# 
mod rewrite and cgi were already enabled:

Code: Select all

root@griffin:~# a2enmod rewrite
Module rewrite already enabled
root@griffin:~# a2enmod cgi
Module cgi already enabled
root@griffin:~# service apache2 restart
 * Restarting web server apache2
   ...done.
Still not working.

Re: Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.

Posted: Sun Nov 16, 2014 5:33 am
by Box293
Can you please attach your apache2.conf file, it's probably in /etc/apache2/

Re: Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.

Posted: Sun Nov 16, 2014 11:12 am
by stewlg
Attached find my current apache2.conf.

I appreciate all the suggestions so far, and look forward to getting this working again.

Re: Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.

Posted: Sun Nov 16, 2014 5:54 pm
by Box293
Thanks for that.

Can you please do the following:

Code: Select all

ls -al /etc/apache2/conf-enabled/
ls -al /etc/apache2/sites-enabled/
I want to see what files are in the folders to compare them with the apache2.conf file.