Re: CGI Scripting Question

From: Boris Glawe (
Date: 06/21/05

Date: Tue, 21 Jun 2005 17:15:18 +0200

Don wrote:
> I've installed RHEL 4 WS on a PC and I am having some trouble with cgi
> scripts.
> I finally got the scripts to put out HTML, but the part that collects
> and displays data from my application is not working. I get no HTML
> output to the screen when I run them in the /var/www/cgi-bin directory.
> I've copies the scripts to /tmp/cgi-bin. I get HTML output on the
> screen and the data collection & display works correctly when run the
> same script from /tmp/cgi-bin.
> I can run the two copies of the script as root or apache with the same
> results.
> Anyone have any ideas on how to correct this problem?

Look at /var/log/messages.

I am sure, that selinux refuses to execute the scripts. Only apache is
allowed to execute them.

You can disable selinux or you can disable selinux for apache only. Run
system-config-securitylevel for that.

It is not a good idea though to disable selinux, since it protects your
system very effectivly.

I am also missing a good tutorial how to do cgi-skripting, html-document
updloads via ftp, etc with selinux. Does anybody have any hints?

greets Boris