500 Errors after Nagios Install



wonder if anyone can help me…

installed nagios v3.0b6 on CentOS 5 (SELinux Disabled) / Apache 2.0.61 (Uni:evil: mod_ssl/2.0.61 OpenSSL/0.9.8b mod_bwlimited/1.4 FrontPage/ mod_auth_passthrough/2.1 / php 5.2.4 /

after installing nagios I’m getting 500 errors (Internal Server Error) trying to access ANY of the .cgi’s

Apache error_log:
[Sat Nov 03 21:29:14 2007] [error] [client] Premature end of script headers: tac.cgi, referer: pgesystems.com/nagios/side.html
[Sat Nov 03 21:29:14 2007] [error] [client] script not found or unable to stat: /usr/local/nagios/sbin/style, referer: pgesystems.com/nagios/cgi-bin/tac.cgi


If you have something like this in the apache error_log:

[Tue Nov 06 14:54:17 2007] [notice] SELinux policy enabled; httpd running as context user_u:system_r:httpd_t:s0
[Tue Nov 06 14:54:17 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Nov 06 14:54:17 2007] [notice] Digest: generating secret for digest authentication …
[Tue Nov 06 14:54:17 2007] [notice] Digest: done
[Tue Nov 06 14:54:17 2007] [notice] Apache/2.2.3 (CentOS) configured – resuming normal operations
[Tue Nov 06 14:54:49 2007] [error] [client xxx.yyy.zzz.www] (13)Permission denied: exec of ‘/usr/local/nagios/sbin/tac.cgi’ failed, referer: srv.org/nagios/side.html
[Tue Nov 06 14:54:49 2007] [error] [client xxx.yyy.zzz.www] Premature end of script headers: tac.cgi, referer: srv.org/nagios/side.html

Its fixable by using the following command:

[root@srv logs]# chcon -R system_u:object_r:httpd_sys_script_exec_t /usr/local/nagios/sbin


Sorry answered wrong question :slight_smile:

The command will however get rid of the bad access


premature end of script headers…

Be sure that permissions are set correctly on CGIs
Execute a CGI from the command line and see what happens
most commonly caused by a bad ftp in that there were transferred as binary rather than ASCII

Try ftping them to the host again and check the permissions. Then try to execute one from the command line. Post your results