Solved

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

Posted on 2010-08-26
16
11,100 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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

Supports up to 4K resolution!

The VS192 2-Port 4K DisplayPort Splitter is perfect for anyone who needs to send one source of DisplayPort high definition video to two or four DisplayPort displays. The VS192 can split and also expand DisplayPort audio/video signal on two or four DisplayPort monitors.

Question has a verified solution.

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

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…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

617 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