CGI not working

jerry2005

Verified User
Joined
May 13, 2005
Messages
88
Location
Netherlands
I noticed that my cgi-bin dirs are not working, i am trying to execute the following script:

test.cgi:

#!/usr/bin/perl

print "Content-type: text/html\n\n";

print <<END_HTML;
<html>
<head></head>
<body>Hello, World!</body>
</html>
END_HTML

Getting a 500 error running this script, file right are 755.

Runnning from command line:

./test.cgi
-su: ./test.cgi: /usr/bin/perl: bad interpreter: Permission denied

root@localhost:~# ls -la /usr/bin/perl
-rwxr-xr-x 2 root root 1057324 Mar 8 2005 /usr/bin/perl

suexec_log looks fine:

[2005-11-30 00:57:39]: info: (target/actual) uid: (blerrynl/blerrynl) gid: (blerrynl/blerrynl) cmd: test.cgi


Could this be related because of disabling the mod=perl ??? this was needed that get apache working on debian.

I am stuck and cant find any solution.
 
You need to recompile apache with mod_perl.

And Make sure your using the correct path to the interpreter.
which perl or whereis perl should help you with that.
 
Recompile apache with the mod_perl with the DA way ? build/update the custom script or do it manualy.

And perl is avaible in the /usr/bin/perl
 
Just a few things...

1. Make sure your file has been edited with a unix editor (ie line ends are correct). If in doubt open the test.cgi in something like pico (my favourite!) then save it.

2. Make sure that both the script and the directory it's in have the correct ownership and permissions
owner:group should both be the accountname
permissions should be 755

3. In the main httpd.conf make sure that the cgi_bin
has Options +ExecCGI set.

4. In the httpd.conf make sure this line hasn't been commented out:
AddHandler cgi-script .cgi
 
Last edited:
Back
Top