2011年5月11日星期三

Apache2 webdav digest public_html .htaccess 激活用户自己的Webdav

Allow users set their own WedDAV folder in their public_html folder. (Debian, Ubuntu)

经过苦心思索,终于自己摸索出了让用户在自己public_html文件夹定义自己WebDAV的方法:

# sudo nano /etc/apache2/mods-enabled/userdir.conf

<IfModule mod_userdir.c>
   UserDir public_html
   UserDir disabled root

   DavLockDB /var/dav/config/DavLock

   <Directory /home/*/public_html>
     AllowOverride FileInfo AuthConfig Limit Indexes
     Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
     <Limit GET POST OPTIONS>
     Order allow,deny
     Allow from all
     </Limit>
     <LimitExcept GET POST OPTIONS>
     Order deny,allow
     Deny from all
     </LimitExcept>
   </Directory>


   <Directory /home/*/public_html/dav>
     AllowOverride FileInfo AuthConfig Limit Indexes
     Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
     SetHandler default-handler

     Dav On
     AuthType Digest
     AuthName dav
     AuthDigestDomain /
     AuthUserFile /dev/null
     AuthGroupFile /dev/null
     Require valid-user

     Order allow,deny
     Allow from all
   </Directory>

</IfModule>


then edit /home/user0/public_html/dav/.htaccess

"AuthUserFile /home/user0/config/dav/digest.htpasswd"

$ mkdir ~/config
$ htdigest -c /home/user0/config/dav/digest.htpasswd dav user0

没有评论:

发表评论