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

share|improve this question

1 Answer 1

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

 
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.