apache2 Webdav using VirtualDocumentRoot

Posted by picca on Server Fault See other posts from Server Fault or by picca
Published on 2011-01-02T20:42:38Z Indexed on 2011/01/02 20:55 UTC
Read the original article Hit count: 245

Filed under:
|
|

I'm trying to get up dynamical WebDav on my virtual hosts

<VirtualHost *:80>
    # http://www.example.com/test.txt -> /var/www/example.com/www/test.txt
    VirtualDocumentRoot /var/www/%-2.0.%-1.0/%-3+/ 

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

        Require valid-user
    </Location>
</VirtualHost>
  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 = www.example.com -> PROBLEM-1 = example.com
    • HTTP_HOST = example.com -> PROBLEM-1 = example.com

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?

© Server Fault or respective owner

Related posts about apache

Related posts about authentication