2021-09-14  点击量: 42

windows,Linux平台webdav服务器搭建方法

点击注册搜外友链,有机会免费获得终身会员,机不可失!

开源项目:webdav

Github页面:https://github.com/hacdias/webdav

支持windows,Linux等平台

windows平台

下载webdav.exe,同位置新建config.yaml文件

config.yaml文件内容:

# Server related settings
address: 127.0.0.1
port: 9999
auth: true
tls: false
cert: cert.pem
key: key.pem

# Default user settings (will be merged)
scope: .
modify: true
rules: []

users:
  - username: admin
    password: admin
    scope: C:/webweb/data

 

 

 

Linux等平台
下载webdav.exe放在/usr/bin/webdav

目录/etc/webdav/创建config.yaml文件

config.yaml文件内容:

# Server related settings
address: 0.0.0.0
port: 9999
auth: true
tls: false
cert: cert.pem
key: key.pem

# Default user settings (will be merged)
scope: .
modify: true
rules: []

users:
  - username: admin
    password: admin
    scope: /root/webdav/data

在/etc/systemd/system里新建文件webdav.service

webdav.service文件内容:

[Unit]
Description=WebDAV server
After=network.target

[Service]
Type=simple
User=root
ExecStart=/usr/bin/webdav --config /etc/webdav/config.yaml
Restart=on-failure

[Install]
WantedBy=multi-user.target


运行
systemctl enable webdav
systemctl start webdav
查看状态systemctl status webdav

 

评论已关闭!