Internal Server Error

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Internal Server Error

Post 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 ?
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: Internal Server Error

Post 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
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Internal Server Error

Post 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.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Internal Server Error

Post 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
User avatar
rhassing
Posts: 416
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: Internal Server Error

Post 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/
Rob Hassing
Image
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Internal Server Error

Post 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/
User avatar
rhassing
Posts: 416
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: Internal Server Error

Post 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
Rob Hassing
Image
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Internal Server Error

Post by rlinux57 »

thanks it's working now.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Internal Server Error

Post 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.
Locked