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>
- 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? Or anything based on LDAP authentication which would use groups named after hosts?
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.