Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Nagios Installation - Forbidden You don't have permission to access /nagios/ on this server.

Posted on 2010-08-26
16
Medium Priority
?
12,137 Views
Last Modified: 2013-11-08
Hello Everybody,
I'm trying to install and configure Nagios for first time on Centos 5.4

Nagios ver : nagios-3.2.1
Plugin : nagios-plugins-1.4.15

I have followed steps given at http://www.linux4beginners.info/node/nagiosfedora

to install and configure nagios on centos 5.4, installation is done smoothly with out any issue but when I try to connect to nagios from remote PC using http://serverip/nagios/ I get the login prompt post entering the user name and password I get this error

Forbidden
You don't have permission to access /nagios/ on this server.

I have attached following files

/etc/httpd/conf.d/nagios.conf
/etc/httpd/conf/httpd.conf

selinux is disabled

Any help appreciated

Regards,
Anantha

nagios-conf.txt
httpd-conf.txt
0
Comment
Question by:Ananthahk
  • 7
  • 3
  • 2
  • +3
16 Comments
 
LVL 2

Accepted Solution

by:
Nol888 earned 501 total points
ID: 33539007
Check to make sure the permissions on /var/www/html/nagios directory are set so that apache can read the contents of the directory. Also check to make sure that all the directories in the tree are +x to apache (should be done already.)
0
 
LVL 4

Assisted Solution

by:atech1
atech1 earned 252 total points
ID: 33539082
0
 

Author Comment

by:Ananthahk
ID: 33539089
I do not have any file in /var/www/html, the nagios config files resides in

/usr/local/nagios/sbin
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 36

Assisted Solution

by:Seth Simmons
Seth Simmons earned 249 total points
ID: 33539110
What account is apache running as?
0
 
LVL 36

Expert Comment

by:Seth Simmons
ID: 33539120
sorry...just noticed you posted your conf
0
 
LVL 2

Assisted Solution

by:Nol888
Nol888 earned 501 total points
ID: 33539123
Well, Apache is service files from some directory; the key is to make sure that directory is readable by Apache. Check in your error.log file for matching entries regarding the 403.
0
 
LVL 2

Expert Comment

by:Nol888
ID: 33539130
*serving, even.
0
 

Author Comment

by:Ananthahk
ID: 33539439


From  /var/log/httpd/error_log while accessing http://192.168.57.92/nagios/ 

Sat Aug 28 01:02:24 2010] [error] [client 192.168.57.87] Directory index forbidden by Options directive: /usr/local/nagios/share/

In the httpd.conf due I need to specify any scriptAlias

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

it should point to /usr/local/nagios/sbin ??
0
 
LVL 9

Assisted Solution

by:jeremycrussell
jeremycrussell earned 249 total points
ID: 33541866
Yes, you would need what you have in the nagios-conf.txt you attached to be loaded by apache...

I didn't notice an "Include" statement in your httpd.conf, so either include that file, or add the contents of nagios-conf.txt to httpd.conf.
0
 

Author Comment

by:Ananthahk
ID: 33583957
Well following include comment is present in httpd.conf

Include conf.d/*.conf
0
 

Author Comment

by:Ananthahk
ID: 33584311
Folks any help on this appreciated
0
 
LVL 15

Assisted Solution

by:samri
samri earned 249 total points
ID: 33584957
hi

go to /etc/httpd/conf.d/ directory, and locate if there is any nagios.conf (or whtever the apache config for nagios is named.


my /etc/httpd/conf.d/nagios
===

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


<Directory "/usr/local/nagios/sbin">
   Options ExecCGI
   AllowOverride None
   Order allow,deny
   Allow from all
   AuthName "Nagios Access"
   AuthType Basic
   AuthUserFile /usr/local/nagios/etc/htpasswd.users
   Require valid-user
</Directory>

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

<Directory "/usr/local/nagios/share">
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all
   AuthName "Nagios Access"
   AuthType Basic
   AuthUserFile /usr/local/nagios/etc/htpasswd.users
   Require valid-user
</Directory>


[root@nagios conf.d]# more /usr/local/nagios/etc/htpasswd.users
nagiosadmin:&^&^&@^#@#@


Another thing to look for is the php.conf in /etc/httpd/conf.d/

This is important since, there is a line in the config,

DirectoryIndex index.php

to tell apache to look for the file index.php and serve this as the default page.  Otherwise, you would be getting the error (that you are getting now).



0
 

Author Comment

by:Ananthahk
ID: 33593026
Yeah I have the nagios.conf in /etc/httpd/conf.d/ location (I had attached this file in the query)

[root@server1 conf]# cd /etc/httpd/conf.d/
[root@server1 conf.d]# ls
nagios.conf  proxy_ajp.conf  README  welcome.conf

[root@server1 conf.d]# more /usr/local/nagios/etc/htpasswd.users
nagiosadmin:irVn27rAUsp9g

And in the httpd.conf once I put index.php (DirectoryIndex index.php) I get nagios screen where in it does not ask username an password

Also the screen looks odd and none of click in the left column work

I have attached the snapshot


Nagios-Index.JPG
0
 

Author Comment

by:Ananthahk
ID: 33593541
Well the rpm php was somewhat not happy with nagios
Complied php and provided the path in httpd.conf, now things seems to be better

Thanks all for your help
0
 

Author Closing Comment

by:Ananthahk
ID: 33593546
Was not total solution
0
 
LVL 15

Expert Comment

by:samri
ID: 33595102
glad to learn that you manged to get ur nagios up and running.  You may also want to check up Nconf -- http://www.nconf.org/dokuwiki/doku.php which I found very easy to use to manage nagios...

cheers.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
I have written articles previously comparing SARDU and YUMI.  I also included a couple of lines about Easy2boot (easy2boot.com).  I have now been using, and enjoying easy2boot as my sole multiboot utility for some years and realize that it deserves …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month9 days, 14 hours left to enroll

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question