Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've installed Nagios on a new server following the instructions from the site below: http://sharadchhetri.com/2012/08/05/installing-nagios-3-4-centos-6-3/

The upshot is:

yum install nagios nagios-devel nagios-plugins* gd gd-devel httpd php gcc glibc glibc-common

Everything seems to be running fine, htpasswd generated, pre-flight check returns normal

nagios -v /etc/nagios/nagios.cfg

I can log into the web server page (server.com/nagios), enter my basic auth details and see the default page fine.

When I click on any of the menu items, I'm presented with an "Internal Server Error" page on the RHS frame.

Checking /var/log/httpd/error_log, /var/log/nagios/nagios.log and /var/log/messages don't give any clues.

I'm new to Nagios, but can anyone offer advice on where to look to get this solved?

Thanks

Dedicated server running CentOS 6.3, x64, 4GB ram

share|improve this question
    
Are permissions okay in /usr/local/nagios/sbin/ for cgi files and folder? Do you have ScriptAlias "/nagios/cgi-bin/ "/usr/local/nagios/sbin/" Options ExecCGI entries in httpd.conf? –  Danila Ladner May 3 '13 at 21:02
    
@DanilaLadner My setup is not in the same directory, but in /usr/lib64/nagios/cgi-bin. The owner of all files in there is root:root. The ScriptAlias, and Options values are set in httpd.conf –  chrismcb May 3 '13 at 21:10
    
Why is it in /usr/lib64? –  Danila Ladner May 3 '13 at 21:13
1  
There should be something logged in the Apache error log. –  Michael Hampton May 4 '13 at 1:01
1  
You should have mentioned the presence of Plesk to begin with. It causes all sorts of problems. –  Michael Hampton May 18 '13 at 17:31
show 15 more comments

2 Answers 2

Make sure your /etc/httpd/conf.d/nagios.conf looks like this:

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
# Last Modified: 11-26-2005
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file.  Customize the paths, etc. as
# needed to fit your system.

ScriptAlias /nagios/cgi-bin/ "/usr/lib64/nagios/cgi-bin/"

<Directory "/usr/lib64/nagios/cgi-bin/">
#  SSLRequireSSL
   Options ExecCGI
   AllowOverride None
   Order allow,deny
   Allow from all
#  Order deny,allow
#  Deny from all
#  Allow from 127.0.0.1
   AuthName "Nagios Access"
   AuthType Basic
   AuthUserFile /etc/nagios/passwd
   Require valid-user
</Directory>

Alias /nagios "/usr/share/nagios/html"

<Directory "/usr/share/nagios/html">
#  SSLRequireSSL
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all
#  Order deny,allow
#  Deny from all
#  Allow from 127.0.0.1
   AuthName "Nagios Access"
   AuthType Basic
   AuthUserFile /etc/nagios/passwd
   Require valid-user
</Directory>
share|improve this answer
    
Thanks, but that's already what I had - it is the same default nagios.conf file that the yum installer created –  chrismcb May 3 '13 at 22:53
    
@chrismcb I did a little digging and it appears SELinux might be the issue here. You might want to allow the proper SELinux permission to Nagios or disable SELinux completely. –  hfranco May 3 '13 at 23:05
    
Thanks, but as mentioned above, it was always disabled –  chrismcb May 3 '13 at 23:09
    
How do you know it's disabled? –  Keith May 6 '13 at 19:47
    
It's listed as disabled in /etc/selinux/config and getenforce returns Disabled –  chrismcb May 7 '13 at 7:39
show 1 more comment

Thanks everyone, however the RPM-installed version seems to be significantly different from the source-installed version, so I'm going to uninstall and compile from source using this guide: cuongk6t.wordpress.com/2011/06/07/how-to-install-nagios-on-centos-6-or-fedora

share|improve this answer
    
That's not a reasonable course of action... this is an apache httpd problem, not a nagios problem. –  Keith May 6 '13 at 19:40
    
You are correct... the reinstall (while useful, as it puts files in the places it should go, rather than where the rpm yum install put them), still has the same issue. –  chrismcb May 7 '13 at 7:41
    
The error was being produced in a vhost error file, rather than the main server error file (I'm using Plesk). It states Premature end of script headers: tac.cgi, referer: http://<domain in here>/nagios/ –  chrismcb May 7 '13 at 7:42
    
It doesn't actually say "<domain in here>" does it? –  Jim Black May 9 '13 at 19:31
    
No, this was just removed for posting - it has a real domain –  chrismcb May 10 '13 at 8:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.