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

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
add comment

1 Answer

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
add comment

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.