Newbie question - 403 Forbidden

Are you following the steps in the documentation at all? You have to configure apace also, if you want to view the nagios website.
nagios.sourceforge.net/docs/1_0/
nagios.sourceforge.net/docs/2_0/
The nagios docs are very clear and you only have to use your head in situations where you didn’t do something standard. In other words, change the paths to suit where you installed stuff. But it looks like for the most part, you used the defaults. Except for --with-nagios-group=nagcmd which doesn’t appear to be worth the effort and needless.

nagios.sourceforge.net/docs/2_0/installweb.html

[quote=“jakkedup”]Are you following the steps in the documentation at all? You have to configure apace also, if you want to view the nagios website.
nagios.sourceforge.net/docs/1_0/
nagios.sourceforge.net/docs/2_0/
The nagios docs are very clear and you only have to use your head in situations where you didn’t do something standard. In other words, change the paths to suit where you installed stuff. But it looks like for the most part, you used the defaults. Except for --with-nagios-group=nagcmd which doesn’t appear to be worth the effort and needless.[/quote]

I know you said earlier that you configured Apache as per the documentation. Re-read through them and make sure you’ve followed them exactly. If you’re still getting that error, post the segment of your Apache configuration file (post the path to that file, too).

yes, i have configured apache. I’m running apache, and added this to my /etc/httpd/httpd.conf file:

ScriptAlias /nagios/cgi-bin “/usr/local/nagios/sbin”

<Directory “/usr/local/nagios/sbin”>

SSLRequireSSL

Options ExecCGI
AllowOverride AuthConfig
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

Alias /nagios/ “/usr/local/nagios/share”

<Directory “/usr/local/nagios/share”>

SSLRequireSSL

Options None
AllowOverride AuthConfig
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

Cool…mind showing us the contents of htpasswd.users?

Feel free to add me to MSN messenger. I’m online usually between 9:30AM and 6:30 PM, EST. I’ve got that info in my profile.
Edited Thu Jan 26 2006, 11:11PM ]

Out of curiosity…was that httpd.conf file one you created, or was it already there?
Edited Thu Jan 26 2006, 11:13PM ]

Wrong, read the docs again.
The below is NOT in httpd.conf it’s somewhere else.

AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user

Edited Thu Jan 26 2006, 11:13PM ]

Oh wow…you’re right. I can’t believe I missed that.

Love your status map, btw. I was talking to my boss about that sort of thing last night. He had no idea Nagios was capable of that sort of thing. I gotta show him that.
Edited Thu Jan 26 2006, 11:15PM ]

ok, heres the contents of htpasswd.users

nagiosadmin:HawQ1ahFJoR3w

I’m not sure how the contents of .htaccess got into httpd.conf. Anyhow, I edited httpd.conf to be:

<Directory “/usr/local/nagios/sbin”>

SSLRequireSSL

AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all

Order deny,allow

Deny from all

Allow from 127.0.0.1

Alias /nagios/ /usr/local/nagios/share

<Directory “/usr/local/nagios/share”>

SSLRequireSSL

Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all

Order deny,allow

Deny from all

Allow from 127.0.0.1

so, this looks right. I’ve gone thru the documentation once again to retarace my steps. On page 12, there are steps to Create a Nagios User/Group. Then, in red bold is:

adduser nagios

which I did. Does it also require that you add a nagios Group? If so. why isn’t the command listed in red bold?? Should I have also done a

groupadd nagios ?

OK, we need to get this working by Monday, so I’m going to hand feed you the info. But this time only.
nagios.sourceforge.net/docs/1_0/installweb.html
nagios.sourceforge.net/docs/1_0/cgiauth.html

First lets see if your system is built like mine.
ls /etc/httpd
Do you have a conf and a conf.d directory?
If so, do you have files in /etc/httpd/conf.d
ls /etc/httpd/conf.d
If so, then restore your original /etc/httpd/conf/httpd.conf file or remove all the changes you made and do this.

The below entries could be made in the httpd.conf file directly, but it’s much more organized if you have it like the below.
vi /etc/httpd/conf.d/nagios.conf
Put this in that file: But change the paths to fit your system, if they are different that where I INSTALLED NAGIOS.

ScriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/
<Directory “/usr/local/nagios/sbin/”>
AllowOverride AuthConfig
Options ExecCGI
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

Put the following in a .htaccess file in /usr/local/nagios/share and also in /usr/local/nagios/sbin

AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
require valid-user

Setting Up Authenticated Users:
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Continue adding more users until you’ve created an account for everyone you want to access the CGIs

htpasswd /usr/local/nagios/etc/htpasswd.users

Enabling Authentication/Authorization Functionality In The CGIs
make sure that /usr/local/nagios/etc/cgi.cfg has this:
use_authentication=1

Restart nagios and also apache.
/etc/rc.d/init.d/httpd restart
/etc/rc.d/init.d/nagios restart

That should get you going. Login to nagios website with the username/password you created above.

When you run
adduser nagios
the nagios group will be created also.

[quote=“chucker8”]…
so, this looks right…
[/quote]

Nope it’s not. Where is the;
ScriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/

ok I double-checked…its there:

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

<Directory “/usr/local/nagios/sbin”>

SSLRequireSSL

AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all

Order deny,allow

Deny from all

Allow from 127.0.0.1

Alias /nagios/ /usr/local/nagios/share

<Directory “/usr/local/nagios/share”>

SSLRequireSSL

Options None
AllowOverride AuthConfig
Order allow,deny
Allow from all

Order deny,allow

Deny from all

Allow from 127.0.0.1

ls /etc/httpd

. magic suse_addmodule.conf suse_public_html.conf
… mime.types suse_define.conf suse_text.conf
access.conf modules suse_include.conf susehelp.conf
httpd.conf srm.conf suse_loadmodule.conf susehelp.conf.old

I don’t have a conf or conf.d directory in /etc/httpd

I have created .htacess file with those contents and placed in /usr/local/nagios/share and also in /usr/local/nagios/sbin

Ran:

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

Confirmed:
use_authentication=1 is enable in /usr/local/nagios/etc/cgi.cfg

Restarted apache : /etc/httpd/apache restart
Restarted nagios:

tpx15:/etc/init.d # /etc/init.d/nagios restart
Running configuration check…done
Stopping network monitor: nagios
No lock file found in /usr/local/nagios/var/nagios.lock
Waiting for nagios to exit . done.
Starting network monitor: nagios
su: warning: cannot change directory to /home/nagios: No such file or directory
tpx15:/etc/init.d #

su - root first, then run the startup script.
/etc/rc.d/init.d/nagios start

It looks like you already are root, so why isn’t there a /home/nagios directory?

grep nagios /etc/passwd
What is nagios user’s home directory?
Edited Fri Jan 27 2006, 01:52AM ]

tpx15:/etc/init.d # /etc/init.d/nagios restart
Running configuration check…done
Stopping network monitor: nagios
No lock file found in /usr/local/nagios/var/nagios.lock
Waiting for nagios to exit . done.
Starting network monitor: nagios
su: warning: cannot change directory to /home/nagios: No such file or directory
tpx15:/etc/init.d # whoami
root
tpx15:/etc/init.d # grep nagios /etc/passwd
nagios:x:2047:100::/home/nagios:/bin/bash

not sure how to find nagios home directory, does this help:…

tpx15:~ # su nagios
nagios@tpx15:/root> cd
bash: cd: /home/nagios: No such file or directory
nagios@tpx15:/root>

tpx15:/etc/init.d # grep nagios /etc/passwd
nagios:x:2047:100::/home/nagios:/bin/bash

Blah, annoying. It should work, 'cause the entry it there. Run this command:

ls -l /home

All that shows is that the system thinks that the user nagios should have a home directory of /home/nagios.
So now, ls -l /home will show that there is no directory of /home/nagios. So, I have to ask, WHY NOT? make one with the adduser command.
man adduser will tell you how.