Cannot access /hostname/nagios/cgi-bin

I am trying to install Nagios ver 2.0b3 with Apache 2.x. After installation I am able to go to:

hostname/nagios

but when I try to access

localhost/nagios/cgi-bin

I am getting the following error message:

Forbidden

You don’t have permission to access /nagios/cgi-bin/ on this server.
Apache/2.0.54 (Uni:evil: Server at 10.45.1.221 Port 80

Any help will be highly appreciated.

Thx.

Ketan

With the setup described in the docs, you should not be able to access cgi-bin itself directly. You can only access the cgis in it.

Thank you! I appreciate your prompt reply. However when I try to access any of the CGIs within the directory, for example:
nagios/nagios/cgi-bin/outages.cgi

I get the following error message:
It appears as though you do not have permission to view information you requested…
If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI
and check the authorization options in your CGI configuration file.

I tried all the file permissions and stuff and that seems to be ok. Is there any one file or directory that is the cause of this error?

I am kinda stuck at this point. Any help is highly appreciated.

Thanks.

Ketan

Authentication for the web interface takes three parts working together:

  1. Webserver based authentication; must have working config. Your use is probobly using basic auth. and an htpasswd file. Make sure these are all correct.

  2. Nagios user. Each user of the web interface must have a contact defined by the same name as is used to login.

  3. CGI permissions. cgi.cfg configures permissions for who can access what. Make sure these match what you need.

Make sure each of these three parts is functioning. If you can narrow it down to one of them with which you still have a problem, we can help there.

alaster
Can you describe those three topic? How can we fix the problem?
For example:

  1. I add 3 user with htpasswd: nagiosadmin, gues,nagios. For all of them passwords is empty.
  2. I add .htaccess /nagios/sbin and /nagios/share directories
  3. finally, I uncomment allt authentication lines.
    But I still get same error.
    Than you…

chcon -R system_u:object_r:httpd_sys_script_exec_t /usr/local/nagios/sbin

to label the nagios scripts properly;

/usr/local/nagios/sbin is wherever your cgis are located.