Auhentication problem when trying to use nagios

Hi,
i’m having problem using the link localhost/nagios/
when i’m trying to use it i’m getting an error message:
You don’t have permission to access /nagios/ on this server.
i also looked at the error_log of httpd and i saw this massge:
(13)Permission denied: access to /nagios/ denied

i’m using linux 2.6.9-5.EL
httpd version : httpd-2.0.52-9.ent
nagios version: 2.o

i install nagios in the default location /usr/local/nagios.
i start nagios with no problem after configure all cfg files.
i placed the folowing lines in httpd.conf and restart httpd process
ScriptAlias /nagios/cgi-bin “/usr/local/nagios/sbin/”
<Directory “/usr/local/nagios/sbin/”>
Options ExecCGI
AllowOverride AuthConfig
Order allow,deny
Allow from all

Alias /nagios/ “/usr/local/nagios/share/”
<Directory “/usr/local/nagios/share/”>
Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all

i created the .htaccess in the share directory with the folowing lines:
AuthUserFile /usr/local/nagios/etc/htpasswd.users
AuthType Basic
AuthName "Nagios Access"
require valid-user

i creted 2 user cald nagiosadmin and eliel with the command htpasswd and the filehtpasswd.users with 2 line was created.

i followd every manual posible in apache web site and in nagios web site and i’m still geting this error.

is any one can help me solve this issue???

can you please post the User and Group of httpd.conf? It seems your user nagiosadmin and eliel is not authorized to view that nagios dir. Also check you DocumentRoot =) Hope this helps.

User apache
Group apach

where can i add nagios users to apache group???

sorry
User apache
Group apache

try changing the apache to User nagios and Group nagios =)

permissions on the etc files should be 644.
-rw-rw-r-- 1 nagios nagios 7065 Jun 5 14:44 hostgroups.cfg
-rw-rw-r-- 1 nagios nagios 61552 Jun 5 14:44 hosts.cfg
-rw-rw-r-- 1 nagios nagios 753 Jun 10 14:59 htpasswd.users

The apache user will be able to read the htpasswd.users file, so you don’t need to add nagios user to any other group.
Paste your permissions on the htppasswd file here like i have done, so we can see what you have.

also paste the important part of your /etc/group file like I have done below.
apache:x:48:
nagios:x:501:
nagiocmd:x:502:nagios,apache

The nagiocmd group is for the permissions on the rw directory, so ignore that for now, since that is not related to your trouble.

Also, turn off your selinux firewall for now.

i have done every thing you said.
but still i’m getting the login screen again and again.
in the apache error_log i’m getting the folowing lines:
MySQL ERROR: Access denied for user ‘nagios’@‘localhost’ (using password: NO)
[Sun Jun 26 11:08:31 2005] [error] [client xx.xx.xxx.xx] MySQL user nagios not found: /nagios/

my mysql deamon is up and running, i have created the user nagios using webmin in MySql.
i don’t have any Data Base installed for nagios, only the default DB that mysql instaled.
i have not find ant documentation for such DB.

If i remeber right nagios version 2.0 doesn’t use the mysql DB by default O_o

Try searching the forum, there’s been a problem reported recently for mysql_auth (but i think it was for 1.2…)

Luca

I had this exact problem at one point. Remove the mod_auth_mysql from apache.
yum info mod_auth_mysql
yum remove mod_auth_mysql

The big tip here is your apache error log, that shows that apache is triing to look in the database for a user called “whoever”.

mod_auth_mysql uses a mysql db to store usernames/passwords

thanks. it is working.

thanks. it is working.

It’s working but what did you do to fix the problem? Your info could help someone else who has had your problem also.

thanks too,i had this problem but it is solved now.
i remove the mod_auth_mysql package. and then restart the httpd service,
but this remove won’t cause problem for other applications?

I doubt it, but if it did, I’m sure we could figure out how to get around it.