1.安装Apache
yum -y install httpd apr apr-util httpd-devel
2.配置WebDAV模块
Apache中默认已经集成了WebDAV模块,启动模块:
vim /etc/httpd/conf.d/webdav.conf
<IfModule mod_dav.c>
LimitXMLRequestBody 131072
Alias /webdav "/var/www/webdav"
<Directory /var/www/webdav>
Dav On
Options +Indexes
IndexOptions FancyIndexing
AddDefaultCharset UTF-8
AuthType Basic
AuthName "WebDAV Server"
AuthUserFile /etc/httpd/webdav.pwd
Require valid-user
Order allow,deny
Allow from all
</Directory>
</IfModule>
3.创建访问目录:
mkdir -p /var/www/webdav
chown apache:apache /var/www/webdav
4.添加认证用户:
htpasswd -c /etc/httpd/webdav.pwd test #根据提示输入密码
5.重启apache服务:
service httpd restart
6.测试webdav:
浏览器访问:http://x.x.x.x/webdav