0

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
    </Directory>

    DocumentRoot /path/to/root
    ServerName servername
    AddHandler cgi-script .pl
</VirtualHost>
blockhead
  • 861
  • 1
  • 8
  • 13

1 Answers1

1

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
</Directory>

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

Hans Lawrenz
  • 196
  • 3
  • 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