apache服务器已经集成了WebDAV模块,所以只需要启用该模块即可。
- 编辑 /etc/httpd/conf/httpd.conf
$ vi /etc/httpd/conf/httpd.conf
在文件的最后添加以下语句:
Include conf/webdav.conf #指定webdav的配置文件路径 - 新建webdav配置文件
$ vi /etc/httpd/conf/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.users.pwd
Require valid-user
Order allow,deny
Allow from all
</Directory>
</IfModule> - chown apache:apache /var/www/webdav
- 添加用户
$ htpasswd -c /etc/httpd/webdav.users.pwd test #根据提示输入密码 - 重启apache服务
$ service httpd restart
mac webdav服务
cd /etc/apache2
cd /etc/apache2/extra
// 备份文件(切记只要备份一次就行)
sudo vim httpd-dav.conf
// 查找Digest 把编辑模式从Digest改成Basic 还是那几步,改完了之后保存退出
http://www.linuxidc.com/Linux/2015-02/113577.htm
https://www.cnblogs.com/QianChia/p/5824382.html
页面展示配置 参考配置文档 https://www.linuxidc.com/Linux/2017-01/139442.htm
展示不全,乱码配置
Further relax access to the default document root:
<Directory "/opt/xxx/download">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#add by wangjun
indexOptions FancyIndexing ScanHTMLTitles NameWidth=* DescriptionWidth=* HTMLTable Charset=UTF-8 VersionSort FoldersFirst
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
配置完成后重启apache服务
网友评论