Premature Script Headers

Okay, so I loaded Nagios freshly onto a new server. I can authenticate to view the Nagios main page, but I get a misconfiguration error in IE when I attempt to view anything beyond that. I’ve checked the apache error log and this is what it shows

[Fri Nov 18 15:56:24 2005] [error] [client 65.48.36.2] (13)Permission denied: exec of ‘/usr/local/nagios/sbin/status.cgi’ failed, referer: 65.48.36.139/nagios/side.html
[Fri Nov 18 15:56:24 2005] [error] [client 65.48.36.2] Premature end of script headers: status.cgi, referer: 65.48.36.139/nagios/side.html

I frankly am not sure how to interpret this. Any help would be greatly appreciated.

A search of this forum reveals much info on this problem.
meulie.net/forum_viewtopic.php?21.1997
is just one link.

I ran the ldd command on every cgi file in my sbin/ directory, but there are no such errors reported.
Edited Fri Nov 18 2005, 01:36PM ]

use the search in this forum for the word Premature and you will find many things to try.

I have a similar problem. If I modify a cgi file (for example status.cgi), the server give me the same error (Premature end of script headers).

With a simple modify, like an added slash in a HTML tag (I need for example to close the img tag with a slash), give me this problem…

WHY??? :frowning:

SOLVED:
From what I’ve found out, the problem was actually with SELinux policy on Fedora Core 4 (the OS I’m running), which can prevent the execution of the CGIs on apache. This command took care of my issue:

chcon -R system_u:object_r:httpd_sys_script_exec_t /usr/local/nagios/sbin

I found that here:
issues.apache.org/bugzilla/show_bug.cgi?id=33504

Thanks to jakkedup for pointing me in the right direction, though I should’ve thought to go there myself.

Edited Tue Nov 22 2005, 07:33AM ]

[quote=“w_il_nagios”]I have a similar problem. If I modify a cgi file (for example status.cgi), the server give me the same error (Premature end of script headers).

With a simple modify, like an added slash in a HTML tag (I need for example to close the img tag with a slash), give me this problem…

WHY??? :frowning: [/quote]

why should you want to modfy the IMG tags, they are ok as they are.
If you added another one copy and paste from the original code. It possibly is an error due to wrong character escaping.

Luca