optimised
09-14-2001, 09:32 PM
Trying to get cgi-script to work in browser.
If I type absolute path in browser http://www.mydomain.com/cgi-bin/test.cgi
I get 404 error I'm 100% sure the directory and file exist.
path on server = home/mydomain/www/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
But running http://www.mydomain.com/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
AddHandler cgi-script .cgi .pl
ScriptAlias /cgi-bin/ "/home/mydomain/cgi-bin/"
<Directory "/home/mydomain/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/cgi-bin/"
ServerSignature email
</VirtualHost>
Do I need to add something else to httpd file?
If I type absolute path in browser http://www.mydomain.com/cgi-bin/test.cgi
I get 404 error I'm 100% sure the directory and file exist.
path on server = home/mydomain/www/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
But running http://www.mydomain.com/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
AddHandler cgi-script .cgi .pl
ScriptAlias /cgi-bin/ "/home/mydomain/cgi-bin/"
<Directory "/home/mydomain/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/cgi-bin/"
ServerSignature email
</VirtualHost>
Do I need to add something else to httpd file?