Hi folks,
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/ directory and in my domain's cgi-bin folder because I would like to allow virtualhost it's own cgi-bin.
#!/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
Why can't apache execute cgi-script from directory of
/home/mydomain/cgi-bin
Works o.k from command line but error from browser
//
[error] (2) No such file or directory: exec of /home/mydomain/cgi-bin/test.cgi
[error] Premature end of script headers
//httpd file
ScriptAlias /cgi-bin/ "/home/mydomain/cgi-bin/"
<Directory "/home/mydomain/Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "/home/mydomain/cgi-bin">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<VirtualHost x.x.x.x>
DocumentRoot /home/mydomain/www
ServerName ScriptAlias /cgi-bin/ "/home/mydomain/cgi-bin/"
ServerSignature email
</VirtualHost>
Thks for help..
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/ directory and in my domain's cgi-bin folder because I would like to allow virtualhost it's own cgi-bin.
#!/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
Why can't apache execute cgi-script from directory of
/home/mydomain/cgi-bin
Works o.k from command line but error from browser
//
[error] (2) No such file or directory: exec of /home/mydomain/cgi-bin/test.cgi
[error] Premature end of script headers
//httpd file
ScriptAlias /cgi-bin/ "/home/mydomain/cgi-bin/"
<Directory "/home/mydomain/Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "/home/mydomain/cgi-bin">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<VirtualHost x.x.x.x>
DocumentRoot /home/mydomain/www
ServerName ScriptAlias /cgi-bin/ "/home/mydomain/cgi-bin/"
ServerSignature email
</VirtualHost>
Thks for help..