Problem with CGIs


newbie here…I installed Nagios without a problem but when I try to click on one of the cgi links I get an error. Here is the error from my Apache log file:

(13)Permission denied: exec of ‘/usr/local/nagios/sbin/status.cgi’ failed, referer: localhost/nagios/side.html

Premature end of script headers: status.cgi, referer: localhost/nagios/side.html

Any help would be great.


I googlled the term and received 2 hits this one and a Rumanian one which revealed the following:

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

Ran ithose and issue fixed… :slight_smile:


Command not found is what I get when I run that command.
My problem is similiar though. I can run all the cgi’s, but when running trends, it gives me no final output(picture) and I get the apache header error.


Fixed my problem too. Thanks for finding those commands.


wow, wish I would have found this earlier. Ill just note that you can also disable SELinux to fix this. I knew there had to be a way to make SELinux work with nagios, but hadent had time to investigate further. This chcon command must allow just that.


Yup, the chcon command was what allowed me to set up Nagios and work with SELinux (on FC4) a few months ago. Can’t believe I’d forgotten that.