Apache CGI troubles.

Parker Thompson parkert at u.washington.edu
Tue Feb 20 09:40:08 PST 2001



Have you made sure that all is good in your httpd.conf
(/etc/httpd/conf/httpd.conf on a RedHat system)?

You'll probably want to make sure you have the following, or equivelent:

ScriptAlias /cgi-bin/ "/chinook/live/cgi-bin/"

<Directory "/chinook/live/cgi-bin/">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>

AddHandler cgi-script .cgi

This should allow you to execute scripts in the directory you specified.
I'd recommend reading through your httpd.conf for more neato stuff you can
do, and check out apache.org for fancy-pants config options.

Parker.
-------------------------------------------------------------
"The thing I love about masturbation is that it's always
great, and sometimes, it's exceptional...There's no thinking
'am I happening', you *know* you're happening."
- Dave Mathews on pressure

On Tue, 20 Feb 2001, Russ Garwood straight up said:


:I tried that, but no luck. Thanks though.

:

:>Just a thought, but what about using #!/usr/bin/perl on the first line?

:>I've never seen #! usr/bin/perl ...

:>

:>~ Michal

:>

:>--

:>

:>Russ Garwood wrote:

:>

:>|Good evening all,

:>|

:>| Sorry for the repost to anyone who already read this - I just realized

:>|that, for some reason, my system clock reset itself, causing the my

:>|original post to be sent on Saturday Jan 2nd, 1988, so people like me who

:>|sort their email by date would never see the original post at all.

:>|

:>| Has anybody else had troubles running CGI scripts with Apache? I'm

:>using

:>|Red Hat 6.2, with the Apache 1.3.12 that comes with, and every time I run a

:>|cgi script, I get error 500. My test script is as follows:

:>|

:>|

:>|#! usr/bin/perl

:>|

:>|print "Content-Type: text/html\n\n";

:>|

:>|print "Hello, world";

:>|

:>|

:>|A glimpse at the error log informs:

:>|

:>|[Sun Feb 18 21:06:12 2001] [error] (2)No such file or directory: exec of

:>|/chinook/live/cgi-bin/test.cgi failed

:>|[Sun Feb 18 21:06:12 2001] [error] [client 10.0.0.4] Premature end of

:>|script headers: /chinook/live/cgi-bin/test.cgi

:>|

:>|Where "/chinook/live" is the DocumentRoot for Apache.

:>|

:>|

:>| The script runs just fine from the console. I've looked at file

:>|permissions, my script is in the correct dir, and cgi execution is enabled,

:>|both in the httpd.conf and .htaccess. I've gone over everything I thought

:>|was relevant in The Idiot's Guide To Solving Perl CGI Problems at CPAN, and

:>|other CGI tutorials available at apache.org. Anybody else have this problem?

:>|

:>| - Russell Garwood

:>|

:>|

:

:

:





More information about the Linux mailing list