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服務