Page 1 of 1

Internal Server Error

Posted: Mon Mar 30, 2015 11:18 am
by rlinux57
I have freshly installed nagios 4.0.8. It gives internal server error while click on services/hosts on web UI . Kindly guide me how to get rid off ?

Re: Internal Server Error

Posted: Mon Mar 30, 2015 1:46 pm
by cmerchant
Can you post the last 20 or so lines from your Apache error logs after you try to view the page? What distro and version of linux? of Apache?

Code: Select all

tail /var/log/httpd/error.log

Re: Internal Server Error

Posted: Mon Mar 30, 2015 1:47 pm
by jdalrymple
We'll need to see your httpd error_log and also perhaps nagios.log.

Please recreate the error then submit the last 40 or so lines of both of those files.

Re: Internal Server Error

Posted: Mon Mar 30, 2015 10:56 pm
by rlinux57
Below is the output:

[Tue Mar 31 08:36:43 2015] [error] [client 182.180.102.104] Premature end of script headers: statusjson.cgi, referer: http://70.38.49.142/nagios/main.php
[Tue Mar 31 08:36:45 2015] [error] [client 182.180.102.104] (13)Permission denied: exec of '/usr/local/nagios/sbin/status.cgi' failed, referer: http://70.38.49.142/nagios/side.php
[Tue Mar 31 08:36:45 2015] [error] [client 182.180.102.104] Premature end of script headers: status.cgi, referer: http://70.38.49.142/nagios/side.php
[Tue Mar 31 08:36:46 2015] [error] [client 182.180.102.104] (13)Permission denied: exec of '/usr/local/nagios/sbin/status.cgi' failed, referer: http://70.38.49.142/nagios/side.php
[Tue Mar 31 08:36:46 2015] [error] [client 182.180.102.104] Premature end of script headers: status.cgi, referer: http://70.38.49.142/nagios/side.php

Re: Internal Server Error

Posted: Mon Mar 30, 2015 11:19 pm
by rhassing
The permissions are not good. The webserver does not have permission to execute the cgi scripts.
That's either SElinux still enabled, or the permissions are not good for the files in '/usr/local/nagios/sbin/'

Please give the output of:

Code: Select all

getenforce
and

Code: Select all

ls -l /usr/local/nagios/sbin/
ls -ld /usr/local/nagios/sbin/

Re: Internal Server Error

Posted: Mon Mar 30, 2015 11:31 pm
by rlinux57
getenforce
[output] Enforcing


ls -l /usr/local/nagios/sbin/
total 4540
-rwxrwxr-x. 1 nagios nagios 270156 Mar 30 20:36 archivejson.cgi
-rwxrwxr-x. 1 nagios nagios 266276 Mar 30 20:36 avail.cgi
-rwxrwxr-x. 1 nagios nagios 263012 Mar 30 20:36 cmd.cgi
-rwxrwxr-x. 1 nagios nagios 238436 Mar 30 20:36 config.cgi
-rwxrwxr-x. 1 nagios nagios 282596 Mar 30 20:36 extinfo.cgi
-rwxrwxr-x. 1 nagios nagios 237700 Mar 30 20:36 histogram.cgi
-rwxrwxr-x. 1 nagios nagios 217092 Mar 30 20:36 history.cgi
-rwxrwxr-x. 1 nagios nagios 212964 Mar 30 20:36 notifications.cgi
-rwxrwxr-x. 1 nagios nagios 274444 Mar 30 20:36 objectjson.cgi
-rwxrwxr-x. 1 nagios nagios 205444 Mar 30 20:36 outages.cgi
-rwxrwxr-x. 1 nagios nagios 209156 Mar 30 20:36 showlog.cgi
-rwxrwxr-x. 1 nagios nagios 278532 Mar 30 20:36 status.cgi
-rwxrwxr-x. 1 nagios nagios 271468 Mar 30 20:36 statusjson.cgi
-rwxrwxr-x. 1 nagios nagios 229572 Mar 30 20:36 statusmap.cgi
-rwxrwxr-x. 1 nagios nagios 225252 Mar 30 20:36 statuswml.cgi
-rwxrwxr-x. 1 nagios nagios 209956 Mar 30 20:36 statuswrl.cgi
-rwxrwxr-x. 1 nagios nagios 233508 Mar 30 20:36 summary.cgi
-rwxrwxr-x. 1 nagios nagios 225348 Mar 30 20:36 tac.cgi
-rwxrwxr-x. 1 nagios nagios 241796 Mar 30 20:36 trends.cgi


ls -ld /usr/local/nagios/sbin/
drwxrwxr-x. 2 nagios nagios 4096 Mar 30 20:36 /usr/local/nagios/sbin/

Re: Internal Server Error

Posted: Tue Mar 31, 2015 1:23 am
by rhassing
Please do:

Code: Select all

setenforce 0
And try if it works than...

If it does, please adjust the file:
/etc/sysconfig/selinux
and disable selinux

Re: Internal Server Error

Posted: Tue Mar 31, 2015 4:21 am
by rlinux57
thanks it's working now.

Re: Internal Server Error

Posted: Tue Mar 31, 2015 10:26 am
by ssax
That's great to hear, if you want to permanently disable selinux, edit /etc/sysconfig/selinux and change:

Code: Select all

SELINUX=enforcing
To:

Code: Select all

SELINUX=disabled
I will mark this thread as resolved and lock the topic, feel free to create a new topic if you have any additional issues.