当前位置:网站首页>在 Apache 上配置 WebDAV 服务器
在 Apache 上配置 WebDAV 服务器
2022-07-04 12:34:00 【星哥玩云】
WebDAV 使得应用程序可以直接将文件写到 Web Server 上,并且在写文件时候可以对文件加锁,写完后对文件解锁,还可以支持对文件所做的版本控制。基于 WebDAV 可以实现一个功能强大的内容管理系统或者配置管理系统。现在主流的 WEB 服务器一般都支持 WebDAV。下面较详细的介绍一下 WebDAV 在 APACHE 服务器中的配置。
一、修改 httpd.conf 文件
在末尾处加上以下内容:
Include conf/mod_dav.conf #下面将介绍该文件的设置
二、在 apache/conf/ 目录下新建一文件(mod_dav.conf),并输入以下内容
#Dav LoadModule dav_module modules/mod_dav.so LoadModule dav_fs_module modules/mod_dav_fs.so DAVLockDB var/DavLock Alias /webdav “/home/webdavfolder” # 后面的路径就是电脑(或服务器)硬盘上的一个文件夹,用作网络存储器的空间 Dav On
这样配置,其实也就可以访问了(可通过windows的网上邻居访问)。但这样有个致命的缺点就是不需要密码就可以访问,安装性大大降低了。
三、增加安全性的配置
继续编辑上面第二步中的文件,改为:
#Dav filesystem DAVLockDB var/DavLock Alias /webdav “/home/webdavfolder” Dav On AuthType Basic AuthName DAV AuthUserFile /usr/local/svn/svn-auth-file #密码验证文件 require user user1
四、/usr/local/svn/svn-auth-file 文件的创建
进入 apache/bin 目录,执行以下命令产生密码验证文件:
htpasswd -cm /usr/local/svn/svn-auth-file user1
提示输入密码时输入该用户的密码。
若还需要增加用户user2,则执行以下命令:
htpasswd -m /usr/local/svn/svn-auth-file user2
删除某个用户(user2),可以使用下列指令:
htpasswd -D /usr/local/svn/svn-auth-file user2
五、修改完成后,重启apache
此时已经可以安全访问 WebDAV 了。可以通过 http://localhost/webdav 来访问共享资源了。当然,如果你是在服务器上配置的,使用 http://yourdomain.tld/webdav 的形式来访问。用户名和密码即是上述设置的内容。
注:以上配置未经验证,仅供参考
边栏推荐
- Global and Chinese market of ice water machines 2022-2028: Research Report on technology, participants, trends, market size and share
- After installing vscode, the program runs (an include error is detected, please update the includepath, which has been solved for this translation unit (waveform curve is disabled) and (the source fil
- WPF double slider control and forced capture of mouse event focus
- PostgreSQL 9.1 飞升之路
- AI painting minimalist tutorial
- WPF双滑块控件以及强制捕获鼠标事件焦点
- CANN算子:利用迭代器高效实现Tensor数据切割分块处理
- 从0到1建设智能灰度数据体系:以vivo游戏中心为例
- [leetcode] 96 and 95 (how to calculate all legal BST)
- runc hang 导致 Kubernetes 节点 NotReady
猜你喜欢
Understand bloomfilter in one article
CTF竞赛题解之stm32逆向入门
Communication tutorial | overview of the first, second and third generation can bus
Fastlane 一键打包/发布APP - 使用记录及踩坑
[data clustering] section 3 of Chapter 4: DBSCAN performance analysis, advantages and disadvantages, and parameter selection methods
比量子化学方法快六个数量级,一种基于绝热状态的绝热人工神经网络方法,可加速对偶氮苯衍生物及此类分子的模拟
Fastlane one click package / release app - usage record and stepping on pit
Runc hang causes the kubernetes node notready
Paper notes ACL 2020 improving event detection via open domain trigger knowledge
A taste of node JS (V), detailed explanation of express module
随机推荐
Vit (vision transformer) principle and code elaboration
《天天数学》连载57:二月二十六日
昨天的事情想说一下
C language: the sorting problem of circle number reporting
CVPR 2022 | TransFusion:用Transformer进行3D目标检测的激光雷达-相机融合
记一次 Showing Recent Errors Only Command /bin/sh failed with exit code 1 问题
Article download address
How to realize the function of Sub Ledger of applet?
轻松玩转三子棋
使用 NSProxy 实现消息转发
PostgreSQL 9.1 飞升之路
runc hang 导致 Kubernetes 节点 NotReady
CANN算子:利用迭代器高效实现Tensor数据切割分块处理
Fly tutorial 02 advanced functions of elevatedbutton (tutorial includes source code) (tutorial includes source code)
vim 出现 Another program may be editing the same file. If this is the case 的解决方法
Simple understanding of binary search
Peak detection of measured signal
【Android Kotlin】lambda的返回语句和匿名函数
MDK在头文件中使用预编译器时,#ifdef 无效的问题
Global and Chinese market of cardiac monitoring 2022-2028: Research Report on technology, participants, trends, market size and share