Access forbidden

I have installed Nagios as per the documentation on Mandriva Linux. But when i try to access it it gives me…

Access forbidden!

You don’t have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.
Error 403
localhost
Apache/2.2.15 (Mandriva Linux/PREFORK-3.1mdv2010.1)

Can anyone please help me out solving this issue.

Thanks,
Joe.

what are the permissions on the share directory? which make commands did you run?
which instructions did you follow by the way?

I have used the instructions present in the following link:

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

make commands that i ran were:
“make all
make install
make install -init
make install-commandmode
make install-config
make install-webconf”

Owner of nagios folder is ‘nagios’ and it belong to group 'apache’
Below is an excerpt of the permission :

drwxrwxrwx 17 nagios apache 4096 2010-12-03 13:49 ./
drwxr-xr-x 13 root root 4096 2010-12-03 12:25 …/
drwxrwxrwx 2 nagios apache 4096 2010-12-03 13:48 base/
drwxrwxrwx 2 nagios apache 4096 2010-12-03 13:49 bin/
drwxrwxrwx 2 nagios apache 4096 2010-12-03 13:48 cgi/
-rw-rw-rw- 1 nagios apache 28409 2009-01-25 09:42 Changelog
drwxrwxrwx 2 nagios apache 4096 2010-12-03 13:22 common/
-rwxrwxrwx 1 nagios apache 44483 2006-12-14 00:25 config.guess*
-rw-rw-rw- 1 nagios apache 55808 2010-12-03 13:22 config.log
-rwxrwxrwx 1 nagios apache 39867 2010-12-03 13:22 config.status*
-rwxrwxrwx 1 nagios apache 32619 2006-12-14 00:25 config.sub*
-rwxrwxrwx 1 nagios apache 236160 2009-01-25 09:59 configure*
-rw-rw-rw- 1 nagios apache 26098 2009-01-25 09:59 configure.in
drwxrwxrwx 3 nagios apache 4096 2010-12-03 13:22 contrib/
-rw-rw-rw- 1 nagios apache 114 2007-10-18 14:25 .cvsignore
-rw-rw-rw- 1 nagios apache 5178 2010-12-03 13:22 daemon-init
-rw-rw-rw- 1 nagios apache 5158 2008-11-30 12:22 daemon-init.in
drwxrwxrwx 3 nagios apache 4096 2010-12-03 13:56 etc/
-rwxrwxrwx 1 nagios apache 7025 2002-02-25 23:03 functions*
-rw-rw-rw- 1 nagios apache 115 2007-10-21 09:24 .gitignore
drwxrwxrwx 8 nagios apache 4096 2010-12-03 13:22 html/
drwxrwxrwx 2 nagios apache 4096 2010-12-03 13:22 include/
-rw-rw-rw- 1 nagios apache 422 2007-03-06 14:55 INSTALLING
-rwxrwxrwx 1 nagios apache 5869 2007-10-20 17:32 install-sh*
-rw-rw-rw- 1 nagios apache 519 2007-10-31 13:35 LEGAL
drwxrwxrwx 16 nagios apache 4096 2010-12-03 16:07 libexec/
-rw-rw-rw- 1 nagios apache 18002 2002-02-25 23:03 LICENSE
-rw-rw-rw- 1 nagios apache 10963 2010-12-03 13:22 Makefile
-rw-rw-rw- 1 nagios apache 10952 2008-04-13 14:34 Makefile.in
-rwxrwxrwx 1 nagios apache 461 2002-08-13 01:18 make-tarball*
-rwxrwxrwx 1 nagios apache 818 2002-02-25 23:03 mkpackage*
drwxrwxrwx 2 nagios apache 4096 2010-12-03 13:48 module/
-rw-rw-rw- 1 nagios apache 14965 2009-01-25 09:59 nagios.spec
-rw-rw-rw- 1 nagios apache 745 2002-02-25 23:03 OutputTrap.pm
-rw-rw-rw- 1 nagios apache 31878 2008-05-19 14:01 p1.pl
-rw-rw-rw- 1 nagios apache 202 2010-12-03 13:22 pkginfo
-rw-rw-rw- 1 nagios apache 210 2002-02-25 23:03 pkginfo.in
-rw-rw-rw- 1 nagios apache 1027 2008-11-30 12:22 README
drwxrwxrwx 3 nagios apache 4096 2010-12-03 13:22 sample-config/
drwxrwxrwx 2 nagios apache 4096 2010-12-03 13:54 sbin/
drwxrwxrwx 10 nagios apache 4096 2010-12-03 16:39 share/
-rw-rw-rw- 1 nagios apache 1255 2010-12-03 13:22 subst
-rwxrwxrwx 1 nagios apache 1195 2007-04-17 17:52 subst.in*
-rw-rw-rw- 1 nagios apache 4516 2009-01-23 11:12 THANKS
-rwxrwxrwx 1 nagios apache 2387 2009-01-25 09:59 update-version*
-rw-rw-rw- 1 nagios apache 331 2007-03-06 14:55 UPGRADING
drwxrwxrwx 5 nagios apache 4096 2010-12-06 15:29 var/
drwxrwxrwx 2 nagios apache 4096 2010-12-03 13:22 xdata/

Thanks,
Joe.

not sure how much it changed, but the instructions for v3.0 are here: nagios.sourceforge.net/docs/3_0/quickstart.html

who is in the group apache?

Hi Luca,

Thanks for taking interest in solving my issue.
I have used the same document that you provided for installation.

The apache group has users: apache and nagios.

Are the permissions set on my files appropriate?
I have installed apache-php and still it give me the access forbidden problem.

Is this problem common with the new installation of nagios?
I would really appreciate if this problem gets solved.

Thank you very much.
Joe.

it’s not common, but it happens… :stuck_out_tongue:

Just to be celar on the details you linked version 2 of the docs, i linked v3, as i said i’m not sure it changes much :slight_smile:

what error do you get in the apache logs?
are you sure you are using the right URL for nagios?
check the apache conf file for nagios.

do you have SELinux on madriva? if yes try turning it off.

Following is the error that apache log shows.

[Tue Dec 07 14:51:22 2010] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/nagios/shareindex.php
[Tue Dec 07 14:51:22 2010] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/nagios/shareindex.phtml
[Tue Dec 07 14:51:22 2010] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/nagios/shareindex.shtml
[Tue Dec 07 14:51:22 2010] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/nagios/shareindex.html
[Tue Dec 07 14:51:22 2010] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/nagios/shareindex.html.var
[Tue Dec 07 14:51:22 2010] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/nagios/shareindex.cgi
[Tue Dec 07 14:51:22 2010] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/nagios/shareindex.pl
[Tue Dec 07 14:51:22 2010] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/nagios/shareindex.htm
[Tue Dec 07 14:51:22 2010] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/nagios/shareDefault.htm
[Tue Dec 07 14:51:22 2010] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/nagios/sharedefault.htm
[Tue Dec 07 14:51:22 2010] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/nagios/shareindex.xml

I don’t understand what this error means and how to solve this.
I checked all the conf files. Everything seems to correct for me.

I did not find SELinux on my system. if at all it should be there, can you tell me its location.

Thanks,
Joe.

And one more thing, I do not fine the files that the error log mentions in the location specified by it.
i.e i cannot find shareindex.php, shareindex.phtml etc. in the location /usr/local/nagios

Is there any issue regarding the path of these files? If yes, how to change the path and where they have to be exactly?

Thanks,
Joe.

/usr/local/nagios/shareindex.php
should be
/usr/local/nagios/share/index.php

so there’s a trailing / missing somewhere either in the apache or in the nagios config… i think nagios.cfg would be the first place to look at.

Thanks for your continuous support on this issue.

I am sorry i could find any path that says /usr/local/nagios/shareindex.php in neither of the configuration files.

Can you please tell me where might be this path and where do i have to make change to correct this.

Thanks a lot
Joe.

i checked the various files and they all don’t have a trailing slash in the directory definitions (which i thought they had).
So there’s little help there to be found.

I checked my own nagios directory and i have waaay less stuff in there.

drwxr-sr-x 11 root   staff  4096 20 nov  2009 .
drwxrwsr-x 13 root   staff  4096  2 feb  2010 ..
drwxrwsr-x  2 nagios nagios 4096  5 nov 09:27 bin
drwxrwsr-x  3 nagios nagios 4096 16 nov 17:19 etc
drwxr-sr-x  2 root   staff  4096 19 nov  2009 include
drwxr-sr-x  2 root   staff  4096 21 nov  2009 lib
drwxrwsr-x  2 nagios nagios 4096  5 nov 09:30 libexec
drwxr-sr-x  4 nagios nagios 4096  1 dic  2009 nagiosgraph
drwxrwsr-x  2 nagios nagios 4096  5 nov 09:27 sbin
drwxrwsr-x 10 nagios nagios 4096  5 nov 09:27 share
drwxrwsr-x  5 nagios nagios 4096 11 dic 09:52 var

Did you install on top of an rpm install?

I’d recommend you start from scratch and check the output of every step so there are no strange error messages.

Hi Luca,

Sorry for the delayed reply. I did a fresh install of nagios on Ubuntu server based on the installation instructions.
It worked out fine. Everything is running up and working fine.
Thanks a lot for all the support.
I suppose the problem that i faced with nagios installation on Mandriva is may be because of the Mandriva operation system.
I din’t do anything different while installing on both of these operating systems. I followed the respective installation guides.

Thanks a lot once again.

Joe.

Thanks for trying a different way and for reporting back that it worked out well :slight_smile:

Luca