Solved

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

Posted on 2010-08-26
16
10,234 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 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
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
LVL 34

Assisted Solution

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

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
windows 7 starter missing password 21 89
web server dns redirect 5 40
IP 10.0.1.2 / 255.0.0.0 61 56
Apache LDAP Authentication 20 31
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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.

856 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