LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-19-2011, 04:22 AM   #1
ahmadirad
Member
 
Registered: Dec 2010
Posts: 34

Rep: Reputation: 0
Nagios INternal server error


Dear all
i installed nagios on centos. everythins is ok. i can view and login nagios web site. but when i click on every links i recieved error:
-------------------------------------------------
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Apache/2.2.3 (CentOS) Server at 192.168.100.17 Port 80
-------------------------------------------------------

all links say this error.
please some body help me.


/etc/httpd/conf.d/nagios.conf :
---------------------------------------------------
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 /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
# 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 /usr/local/nagios/etc/htpasswd.users
Require valid-user
</Directory>

---------------------------------------------------------

Last edited by ahmadirad; 09-19-2011 at 05:11 AM.
 
Old 09-19-2011, 04:27 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well as the error says there is something wrong the the nagios config, not the apache config. look in nagios.cfg and the files it references and see what's wrong. you can also run "nagios -v /path/to/nagios.cfg and it will give a specific complaint usually.
 
Old 09-19-2011, 04:35 AM   #3
ahmadirad
Member
 
Registered: Dec 2010
Posts: 34

Original Poster
Rep: Reputation: 0
[root@centos /]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 3.3.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 07-25-2011
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config file '/usr/local/nagios/etc/objects/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/templates.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/localhost.cfg'...
Read object config files okay...

Running pre-flight check on configuration data...

Checking services...
Checked 8 services.
Checking hosts...
Checked 1 hosts.
Checking host groups...
Checked 1 host groups.
Checking service groups...
Checked 0 service groups.
Checking contacts...
Checked 1 contacts.
Checking contact groups...
Checked 1 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 24 commands.
Checking time periods...
Checked 5 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check
[root@centos /]#
 
Old 09-19-2011, 04:37 AM   #4
ahmadirad
Member
 
Registered: Dec 2010
Posts: 34

Original Poster
Rep: Reputation: 0
also i see every link in nagios reffers to http://192.168.100.17/nagios/cgi-bin/........... when i looking for such path i see there is not folder cgi-bin under nagios folder.
 
Old 09-19-2011, 04:49 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
sorry, I'll blame the morning... that clearly IS an httpd error, my bad. so what does it say in the error_log? if you have copied that file correctly then there's clearly a <Directory /x/y/z > missing at the start of it.
 
Old 09-19-2011, 06:00 AM   #6
ahmadirad
Member
 
Registered: Dec 2010
Posts: 34

Original Poster
Rep: Reputation: 0
/var/log/httpd/error_log


[Mon Sep 19 15:18:59 2011] [error] [client 192.168.100.201] (13)Permission denied: exec of '/usr/local/nagios/sbin/status.cgi' failed, referer: http://192.168.100.17/nagios/side.php

[Mon Sep 19 15:18:59 2011] [error] [client 192.168.100.201] Premature end of script headers: status.cgi, referer: http://192.168.100.17/nagios/side.php
 
Old 09-19-2011, 06:04 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
ok, so it's a permissions issue... sort out the permissions.
 
Old 09-19-2011, 06:28 AM   #8
linux1986
LQ Newbie
 
Registered: Sep 2011
Distribution: redhat
Posts: 14

Rep: Reputation: Disabled
Check wheather suphp is enabled or not. change file permissions to 644 and dir permissions to 755. and correct the ownership also
 
Old 09-19-2011, 06:36 AM   #9
ahmadirad
Member
 
Registered: Dec 2010
Posts: 34

Original Poster
Rep: Reputation: 0
i found the solution:

https://issues.apache.org/bugzilla/s...g.cgi?id=33504
see comment 3

Last edited by ahmadirad; 09-19-2011 at 06:39 AM.
 
Old 05-02-2012, 10:20 AM   #10
mazydizzle
LQ Newbie
 
Registered: May 2012
Posts: 1

Rep: Reputation: Disabled
Problems with Nagios on my Centos Server

Hi all,

I have followed this thread and none of the above solutions have worked for me.

It appears that the Nagios html page works fine and I can login and access the initial menu page, however any of the links on the left hand side result in the "Internal Server Error".

I have looked at my error_log file and I cannot see any errors relating to permissions accessing the CGI scripts. There are other errors though but none are generated when clicking on the links in the Nagios Web Page.

I have followed the link posted as a resolution and followed the command in comment 3 of that link which did not help either.

The only thing that I do not know how to do is...

"Check wheather suphp is enabled or not. change file permissions to 644 and dir permissions to 755. and correct the ownership also"

I am not too sure which files and folders you meant by this and I do not know what "suphp" is.

As you can guess, I am not an experience Linux user. My Centos Server is controlled by a plexk control panel and hosts other websites. I'd like to use this box for monitoring also.

Can anyone help?

Mario
 
Old 05-02-2012, 08:19 PM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Check the nagios log (on my system /usr/local/nagios/var/nagios.log )
 
Old 09-22-2012, 04:25 AM   #12
saudahmad17
LQ Newbie
 
Registered: Sep 2012
Posts: 1

Rep: Reputation: Disabled
I had the same problem as you do. After spending a lot of time reading and trying anything, the step that solved the problem was issuing


Code:

chcon -R -t httpd_sys_content_t /usr/local/nagios

 
Old 10-11-2012, 11:44 AM   #13
tester123
LQ Newbie
 
Registered: Oct 2012
Posts: 1

Rep: Reputation: Disabled
Lightbulb Solved:internal server error...nagios

hi friends,
was breaking my head about this issue when just did one step to fix it up:

sudo setenforce 0

after this was quite silly but still it worked for me!! i am able to check out all the side links now.. hosts,services,map etc etc..

hope this small piece of info helps someone..thank you
 
1 members found this post helpful.
Old 10-26-2012, 01:40 AM   #14
saraswat
LQ Newbie
 
Registered: Nov 2009
Posts: 4

Rep: Reputation: 0
Thanks Tester123...

your tip was really useful..

did lot of googling, but couldn't got the solution, your only single command did the work for me....

thanks again..

Sunil Saraswat
 
Old 10-26-2012, 05:00 AM   #15
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
As per Post #12, correct the SELinux setting; do not disable it.... (posts 13,14)
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Nagios 3.0.6 Internal Server Error when accessing options on the web interface fryzer Linux - Server 14 11-11-2010 10:13 AM
Internal Server Error 500 but no error log Sly Phy Programming 1 08-10-2010 10:51 PM
Additionally, a 500 Internal Server Error error was encountered while trying to use a ukrainet Linux - General 10 06-24-2005 02:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration