Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Forum Archive > Main Support Categories > Server Platforms
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.

Server Platforms
Discussion regarding any server based ubuntu release.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old February 4th, 2006   #1
wildscribe
Spilled the Beans
 
Join Date: May 2005
Beans: 13
Setting up Apache2 to run CGI scripts on Ubuntu

I cannot seem to get Apache2 on Ubuntu 5.10 to recognize CGI Perl scripts. I keep getting "File Not Found" errors. I suspect it is a permission error, but I have tried a bunch of things and nothing seems to work.

Here is what I did and hopefully someone can help me out.

I created a cgi-bin in the /var/www/ folder so the full extenstion is now /var/www/cgi-bin

I then chmod 755 cgi-bin so it is readable.

Then, I created a test script, ptest.pl using this code

#!/usr/bin/perl
print "Content-type:text/html|n\n";
print "<html>\n\n";
print "<h1>Hi!</h1>\n;
print "</html>\n\n>"

And then I used the command "sudo chmod 755 ptest.pl" to make the
script readable.

Then I edited the apache2.conf file and removed the "#" from the "AddHandler cgi-bin .gci" So this file can be seen by Apache2. I also added the .pl extension so it now reads "AddHandler cgi-script .cgi .pl"

Next, I restarted Apache2 and I cannot get any script to work in a browser.

I know this sounds so basic and I have been working with Linux for more than a year as a workstation, but I am really puzzled with this one.

Thank you!

- - - WiLd
wildscribe is offline   Reply With Quote
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:20 PM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry