Welcome to WebmasterWorld Guest from 54.226.130.194

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

CGI under Apache2 / Ubuntu

Keep getting "file not found" even though all settings seem in place

     

donovanh

5:32 pm on Feb 4, 2008 (gmt 0)

10+ Year Member



HI,

I have been consulting guides to get CGI to work on a VPS but have hit a wall. Iíve activated the cgi mod, Iíve put "AddHandler cgi-script .cgi" at the end of my Apache2.conf file, and Iíve put the following into my the sites-available file for the domain:

ScriptAlias /cgi-bin/ /path_to_domain_location/public/cgi-bin
<Directory ď/path_to_domain_location/public/cgi-binĒ> AllowOverride None
Options +ExecCGI -multiviews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

Iíve also chmodíd the cgi scripts to 755, and verified that they are uploaded in ASCII format. Iím getting this error:

...No such file or directory: exec of Ď/path_to_domain_location/public/cgi-bin/test.cgií failed
...Premature end of script headers: test.cgi

Test.cgi is the following simple code for testing:


#!/usr/local/bin/perl
#
# hello_s.pl-- simple "hello, world" program to demonstrate basic
# CGI output.
#
# Print the CGI response header, required for all HTML output
# Note the extra \n, to send the blank line
print "Content-type: text/html\n\n" ;
# Print the HTML response page to STDOUT
print <<EOF ;
<html>
<head><title>CGI Results</title></head>
<body>
<h1>Hello, world.</h1>
</body>
</html>
EOF
exit ;

Any ideas what iím missing?

Cheers,

Don