I can’t log in to Nagios web interface – Problems with loading a website are often blamed on the Internet connection, but even the most perfectly set up network cannot help if there is no service to reply at your destination. One of the most popular HTTP servers used for this task is Apache2. Much of Apache’s popularity can be attributed to its easy installation and use, but never the less it is possible to run into problems with even the easiest of the software. If you’ve encountered an issue loading your web page, follow these simple troubleshooting methods outlined in this guide to attempt to get your web server back up and working again. Below are some tips in manage your apache2 server when you find problem about apache-2.2, monitoring, redhat, nagios, .
When i try to login to Nagios in my web browser and after having repeatedly enter my login and password on my Nagios page
http://127.0.0.1/nagios/, i get this :
This server could not verify that you are authorized to access the
document requested. Either you supplied the wrong credentials (e.g.,
bad password), or your browser doesn’t understand how to supply the
credentials required. Apache/2.2.15 (Red Hat) Server at 127.0.0.1 Port
I changed the password :
htpasswd -c /etc/nagios/htpasswd.users nagiosadmin
And restart the server :
service httpd restart
But without result !
<Directory "/usr/lib/nagios/cgi-bin/"> Options ExecCGI AllowOverride None Order allow,deny Allow from all AuthName "Nagios Access" AuthType Basic AuthUserFile /etc/nagios/passwd Require valid-user </Directory>
You have specified the wrong path for
AuthUserFile: it should be
/etc/nagios/htpasswd.users instead of
Ensure that apache’s user can read
If your apache user is
$ sudo chown www-data /etc/nagios/htpasswd.users $ sudo chmod 600 /etc/nagios/htpasswd.users
Under Apache 2.4, the directives “Require” replaces the directives “Order allow,deny”. However, there is still a bug so that Require valid-user does not work, but Require user x y z does. so…
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin" <Directory "/usr/local/nagios/sgin"> #SSLRequireSSL Options ExecCGI AllowOverride None <RequireAll> Require user nagiosadmin AuthName Nagios AuthType Basic AuthUserFile "/usr/local/nagios/etc/htpasswd.users" </RequireAll> </Directory> Alias /nagios "/usr/local/nagios/share" <Directory "/usr/local/nagios/share"> #SSLRequiresSSL Options None AllowOverride None <RequireAll> Require user nagiosadmin AuthName Nagios AuthType Basic AuthUsrFile "/usr/local/nagios/etc/htpasswd.users" </RequireAll> </Directory>
change permission for /usr/local/nagios/etc/htpasswd.users file
chmod 755 /usr/local/nagios/etc/htpasswd.users
I solved this error by changing the permission.