Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 configure a dynamic virtualhost on mac:

NameVirtualHost *:80
<VirtualHost *:80>
    ServerName *.*.*
    ServerAlias *.*.*.*

    VirtualDocumentRoot "/Volumes/Work/webs/%2"
    VirtualScriptAlias "/Volumes/Work/webs/%2"

    <Directory "/Volumes/Work/webs/%2">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        order allow,deny
        allow from all

It causes this error: "client denied by server configuration". When I replace <Directory "/Volumes/Work/webs/%2"> by <Directory "/Volumes/Work/webs/myproject"> it works fine...

Any ideas ?

share|improve this question
up vote 1 down vote accepted

The <Directory> definition does not use the same logic as the directives from mod_vhost_alias - to it, the %2 is just a %2, not the second part of the domain the request is for.

Just use <Directory /Volumes/Work/webs/> instead, since that applies to all of its subdirectories.

share|improve this answer
Thank you sir :-) – ridan Sep 2 '12 at 19:44

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.