Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Dec 23, 2010 6:28 pm 
Offline
Senior Newbie

Joined: Thu Dec 23, 2010 6:09 pm
Posts: 11
Location: Australia
Pretty much a complete Linux/Apache newbie here, I am in the process of moving a site from a shared host to a Linode VPS. It's all been going smoothly until I starting trying to move my Moveable Type blog which runs using a series of CGI scripts. I am running Ubuntu 10.04 and Apache2. After hours of messing about I got a PERL hello world script (hello.cgi) to execute from a the web browser in the root HTML directory. Here's the script:

Code:
#!/usr/bin/perl -w
use strict;
print "Content-Type: text/html\n\nHello world!";


I got this working by adding the following to the /etc/apache2/sites-available/mysitename.com file.

Code:
<Directory /srv/www/mysitename.com/public_html/>
    Options +ExecCGI
    AddHandler cgi-script .cgi
</Directory>


But I want to execute CGI scripts in the /srv/www/mysitename.com/public_html/mt/ directory, so I changed the directory in the entry above to that path and when I view the hello world script in that folder via a browser I see the source for the hello.cgi script rather than the output. Clearly something isn't right. I've spent more than enough time trying to work this out myself and the time has come to ask for help. So, anyone got any suggestions? Please keep answers simple I really am just learning to tread water Linux/Apache2 wise here!


Top
   
 Post subject:
PostPosted: Thu Dec 23, 2010 6:30 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
Did you make the scripts executable?


Top
   
 Post subject:
PostPosted: Thu Dec 23, 2010 6:35 pm 
Offline
Senior Newbie

Joined: Thu Dec 23, 2010 6:09 pm
Posts: 11
Location: Australia
Yes, I chmod 755 the /srv/www/mysitename.com/public_html/mt/hello.cgi script. Tried 777 too, no luck then either.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group