Solved

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

Posted on 2010-08-26
16
10,889 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 167 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 84 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 35

Assisted Solution

by:Seth Simmons
Seth Simmons earned 83 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 167 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 83 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 83 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

728 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