Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3594960
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:47:17+00:00 2026-05-18T19:47:17+00:00

Pretty much a complete Linux/Apache newbie here, I am in the process of moving

  • 0

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:

#!/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.

<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!

Solution Found:

<VirtualHost *:80>
  ServerName www.sitename.com
  ServerAdmin general@sitename.com
  ServerAlias sitename.com
  DocumentRoot /srv/www/mysitename.com/public_html/
  ErrorLog /srv/www/mysitename.com/logs/error.log
  CustomLog /srv/www/mysitename.com/logs/access.log combined
  AddHandler cgi-script .cgi .pl
</VirtualHost>

<Directory /srv/www/mysitename.com/public_html/>
    AllowOverride All
    Order allow,deny
    Allow from all
    Options All +SymLinksIfOwnerMatch +FollowSymLinks +ExecCGI -Indexes -MultiViews
</Directory>

<Directory /srv/www/mysitename.com/public_html/mt/>
    AllowOverride All
    Order allow,deny
    Allow from all
    Options All +SymLinksIfOwnerMatch +FollowSymLinks +ExecCGI -Indexes -MultiViews
</Directory>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T19:47:18+00:00Added an answer on May 18, 2026 at 7:47 pm

    Have you added mod-perl?

    Add these lines

    AddType perl-script .pl
    AddHandler perl-script .htm
    

    specify a DirectoryIndex

    (outside the Directory block)

    Are you using vhosts too? I wouldn’t normally do things the way you’re doing them to be honest.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Pretty much every other editor that isn't a vi descendant (vim, cream, vi-emu) seems
Pretty much what the title says really. We have some code that is .NET
pretty much what the title says. I am using an Ajax Drop Down as
Pretty much as the question asks. Answers preferably in pseudo code and referenced. The
Pretty much what the question says. What's the difference between the two classes of
This pretty much has me defeated. On XP and earlier versions of Windows you
Title pretty much sums it up. The external style sheet has the following code:
The title is pretty much self explanatory. Given two dates what is the best
This is a pretty-much theoretical question, but.. How much of an operating system could
This question is pretty much the same as this .Net question exept for java.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.