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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI scripts not being found

Status
Not open for further replies.

Shodan44

Programmer
Apr 15, 2002
4
0
0
AU
Greetings. I am running Apache 1.3.9 and am having a great deal of trouble in getting CGI scripts to run. I am constantly getting the "500 Internal server error" page. The error.log is always saying exec failed because the file or dirtory does not exist. E.G.

[Sun Apr 14 06:56:03 2002] [error] (2)No such file or directory: exec of /usr/lib/cgi-bin/test.cgi failed
[Sun Apr 14 06:56:03 2002] [error] [client 192.168.0.1] Premature end of script headers: /usr/lib/cgi-bin/test.cgi


I even made it so my DocumentRoot (/var/www) could execute CGI scripts but I still get the same error message, of course pertaining to /var/www. The script I'm testing is fine because it prints out HTML when I run it from the shell.

The pertinent lines from my conf files are:

srm.conf:

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

AddHandler cgi-script .cgi .pl


access.conf:


<Directory /cgi-bin/>
AllowOverride None
Options ExecCGI FollowSymLinks
Allow from all
</Directory>



HTTPD runs itself as User: &quot; & Group: &quot; does that mean the cgi-bin directory and scripts have to be owned by and in the group (In any case I've tried changing owner and group but no joy!!) When I type &quot;which perl&quot; I get back &quot;/usr/bin/perl&quot; which is what I have at the top of my test.cgi script. Also my cgi-bin directory and test script has been chmoded to 777.

I've ploughed through many of the old posts relating to running CGI scripts but can't find anything that gives me a possible answer to this problem. I believe I must be missing something fairly basic because there doesn't seem to be all that much to getting CGI running on APACHE and everything looks ok to me! Could anyone suggest some things to take a look at? Any help would be greatly appreciated!

Thanks

Shodan44
 
All I can suggest is make sure you don't have front page extensions running, then make sure you have the following:
<Directory /var/ AllowOverride All
Options ExecCGI
Order allow,deny
Allow from all
</Directory>

and finally make sure permissions are 755 for the cgi file you'll be running.

Good luck.
 
Hi all,

I am havin the neext error. When I execute a cgi that uses the POST method in Apache 1.3.26 it doesn´t work and gives the next error message:
--------------
Premature end of script headers:
--------------
If I run it in Apache 2 it works perfectly so I think the problem isn´t in the cgi itself.

Any idea?

Regards.
 
Hi all,

I am having the neext error. When I execute a cgi that uses the POST method in Apache 1.3.26 it doesn´t work and gives the next error message:
--------------
Premature end of script headers:
--------------
If I run it in Apache 2 it works perfectly so I think the problem isn´t in the cgi itself.

Any idea?

Regards.
 
Hi all,

I am having the next error. When I execute a cgi that uses the POST method in Apache 1.3.26 it doesn´t work and gives the next error message:
--------------
Premature end of script headers:
--------------
If I run it in Apache 2 it works perfectly so I think the problem isn´t in the cgi itself.

Any idea?

Regards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top