Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 :

Authorization Required

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 80

I changed the password :

htpasswd -c /etc/nagios/htpasswd.users nagiosadmin

And restart the server :

service httpd restart

But without result !

share|improve this question
    
What does the Apache error log say? Show us your configuration for Nagios /etc/httpd/conf.d/nagios.conf? –  quanta Sep 10 '12 at 2:28
    
This is the configuration for Nagios : pastebin.com/eNek5CPD –  M. Saâd Sep 10 '12 at 2:34
    
And this is the Apache's error.log : pastebin.com/94iWakSu –  M. Saâd Sep 10 '12 at 2:46
    
user nagiosadmin: authentication failure for "/nagios/": Password Mismatch. –  quanta Sep 10 '12 at 2:47

2 Answers 2

up vote 2 down vote accepted
<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 /etc/nagios/htpasswd.

share|improve this answer

Ensure that apache's user can read /etc/nagios/htpasswd.users:

If your apache user is www-data, then:

$ sudo chown www-data /etc/nagios/htpasswd.users
$ sudo chmod 600 /etc/nagios/htpasswd.users
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.