Welcome to WebmasterWorld Guest from

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

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

Junior Member

10+ Year Member

joined:May 14, 2003
votes: 0


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

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:

# 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 ;
<head><title>CGI Results</title></head>
<h1>Hello, world.</h1>
exit ;

Any ideas what iím missing?




Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members