Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache CGI Headache

Status
Not open for further replies.

Stkcode

Technical User
Jan 8, 2002
4
0
0
US
Hi,

I'm having a problem getting mod_cgi (/var/html/cgi-bin)to work correctly on Apache 1.3.23 under Red Hat Linux 7.2
The apache error log shows,

[Mon Feb 4 13:45:13 2002] [error] (2)No such file or directory: exec of /var/ failed
[Mon Feb 4 13:45:14 2002] [error] [client 192.168.1.1] Premature end of script headers: /var/
I also have several other scripts I've tried and I get the same thing on all of them.
Here's where I'm lost.

When I run these scripts under mod_perl (/var/html/perl), most of the perl scripts run just fine. I would just continue to run under mod_perl, except some of the scripts wont work under mod_perl. Their seem to be some syntax that doesn't work under mod_perl, but does work under mod_cgi.

All the good stuff is their:

shebang in the script files (#!/usr/bin/perl)
the cgi-bin directory and perl scripts have read and execute permissions
some of them work under the /var/ directory just fine yet none of them work under /var/

The httpd.conf contains,

for mod_cgi

ScriptAlias /cgi-bin/ "/var/
<Directory &quot;/var/ AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>

AddHandler cgi-script .cgi .pl


for mod_perl

<IfModule mod_perl.c>
Alias /perl/ /var/ <Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
</Location>
</IfModule>


User apache
Group apache


I've also tried changing the owner and group of the cgi-bin directory and the script files to apache. Still know luck. I'm out of ideas.

If anyone has any suggestions, please let me know...I stumped

Thank You,
Jon
 
Hi,

Although AddHandler is supposed to be valid in a global context I have found on a couple of occasions (e.g. with virtual hosts) it doesn't seem to work unless you place it in the relevant <Directory> container. See if that makes a difference... i.e. :

<Directory &quot;/var/ AllowOverride None
Options ExecCGI
AddHandler cgi-script .cgi .pl <===
Order allow,deny
Allow from all
</Directory>

Hope this helps
 
Thanks for the reply. Gave it a shot but no luck. Same error comes up.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top