Click to See Complete Forum and Search --> : cgi-script server internal error


digitized
09-14-2001, 05:38 AM
I am trying to get my web server to execute cgi-scripts. I'm starting off using this small script listed below. I put the script in the /var/www/cgi-bin directory and in my domain's cgi-bin folder.
> /home/mydomain/www/cgi-bin (I have chmod 755 both places.)


#!/usr/bin/perl
#
print "Content-type: text/html\n\n";
print "Hello World\n";

I ran >perl -c test.cgi
syntax fine
Then >perl - w test.cgi
Hello World

command line works fine returns- Hello World.
/cgi-bin>#perl test.cgi

But running http://mydomain/cgi-bin/test.cgi
I keep getting internal error 505
Error_log
[error] (2) No such file or directory: exec of /home/mydomain/www/cgi-bin/test.cgi
[error] Premature end of script headers

## httpd.conf - configuration for the Apache web server

#enable cgi-scripts
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

#use cgi-scripts
AddHandler cgi-script .cgi .pl


# If the perl module is installed, this will be enabled.
<IfModule mod_perl.c>
Alias /perl/ /var/www/perl/
<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options None
</Location>
</IfModule>


ScriptAlias /cgi-bin/ "/home/mydomain/www/cgi-bin/"

<Directory "/home/mydomain/www/cgi-bin">
Options None
AllowOverride None
Order allow,deny
Allow from from all
</Directory>

# Virtual host mydomain
<VirtualHost x.x.x.x>
DocumentRoot /home/mydomain/www/
ServerName www.mydomain.com (http://www.mydomain.com)
ScriptAlias /cgi-bin/ "/home/mydomain/www/cgi-bin/"
ServerSignature email
</VirtualHost>

Do I need to add something else to httpd file?
Why can't it find file in /home/mydomain/www/cgi-bin

Thanks