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 get up dynamical WebDav on my virtual hosts

<VirtualHost *:80>
    # -> /var/www/
    VirtualDocumentRoot /var/www/%-2.0.%-1.0/%-3+/ 

    <Location /webdav>
        Dav On
        AuthType Basic
        AuthName ""
        AuthUserFile /var/www/[PROBLEM-1]/passwd.dav

        Require valid-user
  1. Is there any way I can set dynamically PROBLEM-1 placeholder based on whatever comes with *HTTP_HOST*? More precisely part of it? Example:
    • HTTP_HOST = -> PROBLEM-1 =
    • HTTP_HOST = -> PROBLEM-1 =

What I'm trying to do here is to load dav passwd file dynamically based on which domain is requested. It is something like "groups" if you wish. So that owner of domainA is not allowed to access files of domainB. So maybe there is some other solution based on AuthGroupFile directive? Or anything based on LDAP authentication which would use groups named after hosts?

share|improve this question

I don't know of a way to do that, but I think you should be able to use an .htaccess file to accomplish the same thing.

share|improve this answer

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.