Unable to login to Nagios 4.0.2 after Ubuntu upgrade 14.04

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
stewlg
Posts: 15
Joined: Fri Nov 14, 2014 11:03 am

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

Post by stewlg »

Here you go:

Code: Select all

root@griffin:~# ls -al /etc/apache2/conf-enabled/
total 8
drwxr-xr-x 2 root root 4096 Oct  6 22:24 .
drwxr-xr-x 9 root root 4096 Oct  6 22:23 ..
lrwxrwxrwx 1 root root   30 Oct  6 22:23 charset.conf -> ../conf-available/charset.conf
lrwxrwxrwx 1 root root   28 Oct  6 22:23 httpd.conf -> ../conf-available/httpd.conf
lrwxrwxrwx 1 root root   44 Oct  6 22:23 localized-error-pages.conf -> ../conf-available/localized-error-pages.conf
lrwxrwxrwx 1 root root   30 Oct  6 22:24 nagios3.conf -> ../conf-available/nagios3.conf
lrwxrwxrwx 1 root root   46 Oct  6 22:23 other-vhosts-access-log.conf -> ../conf-available/other-vhosts-access-log.conf
lrwxrwxrwx 1 root root   31 Oct  6 22:23 security.conf -> ../conf-available/security.conf
lrwxrwxrwx 1 root root   36 Oct  6 22:23 serve-cgi-bin.conf -> ../conf-available/serve-cgi-bin.conf

Code: Select all

root@griffin:~# ls -al /etc/apache2/sites-enabled/
total 8
drwxr-xr-x 2 root root 4096 Oct  6 22:23 .
drwxr-xr-x 9 root root 4096 Oct  6 22:23 ..
lrwxrwxrwx 1 root root   35 Oct  6 22:23 000-default.conf -> ../sites-available/000-default.conf
root@griffin:~# 
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

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

Post by Box293 »

Please post the contents of:

Code: Select all

/etc/apache2/conf-enabled/nagios3.conf
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
stewlg
Posts: 15
Joined: Fri Nov 14, 2014 11:03 am

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

Post by stewlg »

nagios3.conf:

Code: Select all

# apache configuration for nagios 3.x
# note to users of nagios 1.x and 2.x:
#       throughout this file are commented out sections which preserve
#       backwards compatibility with bookmarks/config for older nagios versios.
#       simply look for lines following "nagios 1.x:" and "nagios 2.x" comments.

ScriptAlias /cgi-bin/nagios3 /usr/lib/cgi-bin/nagios3
ScriptAlias /nagios3/cgi-bin /usr/lib/cgi-bin/nagios3
# nagios 1.x:
#ScriptAlias /cgi-bin/nagios /usr/lib/cgi-bin/nagios3
#ScriptAlias /nagios/cgi-bin /usr/lib/cgi-bin/nagios3
# nagios 2.x:
#ScriptAlias /cgi-bin/nagios2 /usr/lib/cgi-bin/nagios3
#ScriptAlias /nagios2/cgi-bin /usr/lib/cgi-bin/nagios3

# Where the stylesheets (config files) reside
Alias /nagios3/stylesheets /etc/nagios3/stylesheets
# nagios 1.x:
#Alias /nagios/stylesheets /etc/nagios3/stylesheets
# nagios 2.x:
#Alias /nagios2/stylesheets /etc/nagios3/stylesheets

# Where the HTML pages live
Alias /nagios3 /usr/share/nagios3/htdocs
# nagios 2.x:
#Alias /nagios2 /usr/share/nagios3/htdocs
# nagios 1.x:
#Alias /nagios /usr/share/nagios3/htdocs

<DirectoryMatch (/usr/share/nagios3/htdocs|/usr/lib/cgi-bin/nagios3|/etc/nagios3/stylesheets)>
        Options FollowSymLinks

        DirectoryIndex index.php index.html

        AllowOverride AuthConfig
        Require all granted

        AuthName "Nagios Access"
        AuthType Basic
        AuthUserFile /etc/nagios3/htpasswd.users
        # nagios 1.x:
        #AuthUserFile /etc/nagios/htpasswd.users
        require valid-user
</DirectoryMatch>

<Directory /usr/share/nagios3/htdocs>
        Options +ExecCGI
</Directory>

# Enable this ScriptAlias if you want to enable the grouplist patch.
# See http://apan.sourceforge.net/download.html for more info
# It allows you to see a clickable list of all hostgroups in the
# left pane of the Nagios web interface
# XXX This is not tested for nagios 2.x use at your own peril
#ScriptAlias /nagios3/side.html /usr/lib/cgi-bin/nagios3/grouplist.cgi
# nagios 1.x:
#ScriptAlias /nagios/side.html /usr/lib/cgi-bin/nagios3/grouplist.cgi
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

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

Post by Box293 »

I'm not sure if this will help but here is a nagios.conf file from a test server I ran up not too long ago on Ubuntu 14.04.01 LTS running Nagios Core 4.0.8.

Code: Select all

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file.  Customize the paths, etc. as
# needed to fit your system.

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
#  SSLRequireSSL
   Options ExecCGI
   AllowOverride None
   Order allow,deny
   Allow from all
#  Order deny,allow
#  Deny from all
#  Allow from 127.0.0.1
   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">
#  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 Access"
   AuthType Basic
   AuthUserFile /usr/local/nagios/etc/htpasswd.users
   Require valid-user
</Directory>
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
stewlg
Posts: 15
Joined: Fri Nov 14, 2014 11:03 am

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

Post by stewlg »

Your example was not directly helpful, but your deliberate tour of my configuration made me observe my configuration with more attention.

I think all my issues were due to my Nagios 3.x installation, which was still partly cross-wired with my Nagios 4 installation. I think this nascent problem flared up during the Apache 2.2 => 2.4 transition that I gather happened as part of the Ubuntu 14.04 dist upgrade. I killed the old Nagios3.conf, and renamed the httpd.conf as nagios.conf, then edited it a bit. Here's what nagois.conf looks like now:

Code: Select all

servername griffin.doodle.local

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
    Options ExecCGI
    AllowOverride AuthConfig
    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 can now log in and see system status - thank goodness. PNP4Nagios is broken, but that's less critical, and anyhow outside of this forum's purview.

Note the "require all granted" syntax that replaces the older syntax you had in your example. This is new to Apache 2.4. (See https://httpd.apache.org/docs/2.4/upgrading.html).

Thank you again for your help.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

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

Post by slansing »

Ah yes, that is why I am generally frightened by distro upgrades... package conflicts and issues. Glad that it's sorted out for the majority now, let us know if you have any further questions on this. I'll lock this thread down for the time being.
Locked