标签:
最近在项目中需要通过WebDav方式提供文件发布的功能,特此记录配置全过程。Apache2内置直接支持WebDav功能,开启并配置即可,配置过程如下(注:这里使用了xampp集成的apache,与独立安装的配置略有差异):
1、开启WebDav
修改httpd.conf文件,找到如下行,去掉Include前面的#
# Distributed authoring and versioning (WebDAV) Include etc/extra/httpd-dav.conf
DavLockDB "/opt/lampp/var/DavLock"
Alias /webdav"/opt/lampp/webdav" #访问路径及别名
<Directory "/opt/lampp/webdav">
Dav On
Options Indexes #开启Web页面的直接访问
Order Allow,Deny
Allow from all
AuthType Digest
AuthName DAV-upload
# You can use the htdigest program to create the password database:
# htdigest -c "/opt/lampp/user.passwd" DAV-upload admin
AuthUserFile "/opt/lampp/user.passwd"
AuthDigestProvider file
# Allow universal read-access, but writes are restricted
# to the admin user.
<RequireAny>
Require method GET POST OPTIONS
Require user admin
</RequireAny>
</Directory>
sudo chown daemon.daemon -R var sudo chown daemon.daemon -R webdav
sudo htpasswd -c user.passwd admin
标签:
原文地址:http://my.oschina.net/u/699015/blog/471663