# apache/nagios authentication.

## duby2291

OK folks. I and stuck I was hoping I might be able to get some help.... When I log into nagios, it just pops up the log in prompt over and over. It seems like it just isnt recognizing my login. I had exactly the same problem setting up vqadmin too. anyway, here is my config in case it will help you.

```
/etc/conf.d/apache2

.....

APACHE2_OPTS="-D DEFAULT_VHOST -D PHP5 -D PERL -D NAGIOS"

......
```

```
/etc/apache2/httpd.conf

....

#

# To use CGI scripts outside of ScriptAliased directories:

# (You will also need to add "ExecCGI" to the "Options" directive.)

#

AddHandler cgi-script .cgi

.....
```

```
/usr/nagios/share/.htaccess

AuthName "Nagios Access"

AuthType Basic

AuthUserFile /etc/nagios/htpasswd.users

AuthGroupFile /etc/nagios/htpasswd.group

require group nagios

```

```
/usr/nagios/sbin/.htaccess

AuthName "Nagios Access"

AuthType Basic

AuthUserFile /etc/nagios/htpasswd.users

AuthGroupFile /etc/nagios/htpasswd.group

require group nagios

```

```
/etc/nagios/htpasswd.group

nagios: nagiosadmin

```

```
/etc/nagios/htpasswd.users

nagiosadmin:sBGdOmFrt2kDk

```

Well that should be all of the relevent info. I have made sure that each relevent file is owned by apache, and that apache has permission to write to all relevent folders.... I'm really stumped. Any help would be awesome.Last edited by duby2291 on Thu Jun 29, 2006 7:11 am; edited 1 time in total

----------

## duby2291

bump

----------

## Jeremy_Z

Hi, i have a working configuration but on a mandriva server. Anyway it should be similar :

Here is the part for apache conf :

```

    ScriptAlias /admin/nagios/cgi-bin/ /usr/lib/nagios/cgi/

    <Directory /usr/lib/nagios/cgi/>

        Options ExecCGI

        SSLRequireSSL

        order deny,allow

        deny from all

        AuthType Basic

        AuthUserFile /etc/nagios/passwd

        AuthGroupFile /etc/nagios/group

        AuthName "nagios"

        require group nagios

        Satisfy Any

    </Directory>

    Alias /admin/nagios/ /usr/share/nagios/

    <Directory /usr/share/nagios/>

        Options None

        SSLRequireSSL

        order deny,allow

        deny from all

        AuthType Basic

        AuthUserFile /etc/nagios/passwd

        AuthGroupFile /etc/nagios/group

        AuthName "nagios"

        require group nagios

        Satisfy Any

    </Directory>

```

----------

## njcwotx

Im not at work where I can check my configs at the moment...but I had similar issues.  I had a similar problem at one time, have you checked out these other threads?

https://forums.gentoo.org/viewtopic-t-262408-postdays-0-postorder-asc-highlight-nagios-start-0.html

https://forums.gentoo.org/viewtopic-t-243575-highlight-.html

https://forums.gentoo.org/viewtopic-t-368341-highlight-.html

https://forums.gentoo.org/viewtopic-t-370511-highlight-.html  - check out the nagios exchange links too....

When I get back to office tommorrow Ill try to compare your configs with mine and see if I spot anything.

----------

## duby2291

Yep, I been all through these forums, and the gentoo wiki, checked google, checked nagios site, checked all of the nagios documentation. Checked apache site, read a bunch of man pages for apache, tryed reading up on how apache authentication works.... 

I have tryed everything. As far as I can tell, the configuration is solid. I must have went through at least five walkthroughs, including the one you linked to, and it really seems like a solid config, but I still get the same problem

BUT I will say that I dont think it is a nagios problem per say, becouse I have exactly the same issue with vqadmin. I think it almost must be a configuration issue with apache, but I'll be damned if I can find it. I read at least 20 pages on apaches web site and others about authentication, everything I could find on the subject..

As far as I can see it is right, but it still aint working, so something must be off.

----------

## njcwotx

sounds like some kind of permissions thing....

I have created a user and a group in linux both are called "nagios".  I added the apache user to the nagios group.

then I chown and chgrp the files in the /usr/nagios/share folder, /var/nagios, and other pertinent folders you may have to play with chmod on those files as well.  Looks like my nag files are -rw-rw-r-- for the most part.  my .htaccess is set to root ownership and group with -rw-r--r--.

Im sure the chmod stuff can be improved, but file permissions had to be jacked with a bit before I could get nagios to work when I set it up.

let me know how that works out.

----------

## royw

Make sure you have at least one user authorized for each relavent CGI section.

Look in cgi.cfg for the authorized_for_* entries.  By default, all of mine were commented out.  Once I added nagiosadmin to each one, I had full access...

HTH,

Roy

----------

## emufambirwi

```
jeje ~ # /etc/init.d/nagios start

Starting nagios:No directory, logging in with HOME=/

 done.

```

I also can't log on to the web interface.

----------

