Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to make the root directory for a virtual host so that it can execute CGI scripts. I put the following in my virtual host declaration:

<VirtualHost *:80>
    <Directory />
    Options +ExecCGI

    DocumentRoot /path/to/root
    ServerName servername
    AddHandler cgi-script .pl
share|improve this question
up vote 1 down vote accepted

Presuming you're wanting to allow cgi scripts to run in the root directory you're going to want to change the Directory section. I think you're confusing Directory with Location. Directory refers to a directory on disk whereas Location refers to a path from the document root.

So what you want is something more like:

<Directory /path/to/root>
    Options +ExecCGI

See Apache Tutorial: Dynamic Content with CGI for more info.

share|improve this answer
And generally the default apache conf already has "Directory /" defined with most options turned off for security. So perhaps the "Directory /" you (blockhead) defined is conflicting with that one. This solution from Hans should work. – kbosak Oct 14 '09 at 14:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.