apache服务器已经集成了WebDAV模块,因此只须要启用该模块便可。
1. 编辑 /etc/httpd/conf/httpd.conf
$ vi /etc/httpd/conf/httpd.conf
在文件的最后添加如下语句:
Include conf/webdav.conf #指定webdav的配置文件路径
2. 新建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>
1. $ mkdir -p /var/www/webdav
$ chown apache:apache /var/www/webdav
2. 添加用户
$ htpasswd -c /etc/httpd/webdav.users.pwd test #根据提示输入密码
3. 重启apache服务
$ service httpd restarthtml
mac webdav服务
cd /etc/apache2
$ sudo vim httpd.conf
// 查找httpd-dav.conf
/httpd-dav.conf
经过搜索找到这几行
LoadModule dav_module libexec/apache2/mod_dav.so
LoadModule dav_fs_module libexec/apache2/mod_dav_fs.so
LoadModule auth_digest_module libexec/apache2/mod_auth_digest.so
而且把他们行首的#号删除 (友情提示,他们这些行长的都很像必定要看清了别改错了)
按esc完成编辑,输入:wq退出
// 而后切换目录
$ cd /etc/apache2/extra
// 备份文件(切记只要备份一次就行)
$ sudo cp httpd-dav.conf httpd-dav.conf.bak
// 如今要编辑这个文件了
$ sudo vim httpd-dav.conf
// 查找Digest 把编辑模式从Digest改为Basic 仍是那几步,改完了以后保存退出
http://www.linuxidc.com/Linux/2015-02/113577.htm
https://www.cnblogs.com/QianChia/p/5824382.htmllinux
页面展现配置 参考配置文档 https://www.linuxidc.com/Linux/2017-01/139442.htmweb
展现不全,乱码配置apache
# Further relax access to the default document root:vim
<Directory "/opt/xxx/download">服务器
#ide
# Possible values for the Options directive are "None", "All",ui
# or any combination of:rest
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViewsorm
#
# 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服务