Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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>
share|improve this question

1 Answer 1

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

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

 
discard

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.