?
Solved

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

Posted on 2010-08-26
16
Medium Priority
?
11,552 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 35

Assisted Solution

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

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

Optimum High-Definition Video Viewing and Control

The ATEN VM0404HA 4x4 4K HDMI Matrix Switch supports 4K resolutions of UHD (3840 x 2160) and DCI (4096 x 2160) with refresh rates of 30 Hz (4:4:4) and 60 Hz (4:2:0). It is ideal for applications where the routing of 4K digital signals is required.

Question has a verified solution.

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

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

719 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