17
HTTP文件服务搭建
X edited this page 2025-04-21 13:53:20 +00:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

一、下载安装程序

  • 使用HFS和CHFS(HFS汉化版本)搭建http文件服务

  • 下载对应操作系统版本后上传到服务器中,下载地址:

HFS

CHFS

  • 解压缩(以CHFS为例)
unzip chfs-linux-amd64-3.1.zip
  • 进入解压添加执行权限
chmod +x chfs-linux-amd64-3.1

二、 以服务方式运行

  • 创建文件存储目录和日志存储目录
mkdir /opt/chfs/logs
mkdir /data/chfs
  • 创建编辑配置文件
#web端口
port=10086
#文件存储目录
path=data/chfs
allow=
log=/opt/chfs/logs
html.title=很丝滑的文件服务器
html.notice=`测试服务`
image.preview=true
ssl.cert=
ssl.key=
folder.download=
file.remove=1
session.timeout=30
[admin]
#管理密码
password=10086
rule.default=RWD
rule.none=
rule.r=
rule.w=
rule.d=
[guest]
password=
rule.default=R
rule.none=
rule.r=
rule.w=
rule.d=
  • 新建一个系统服务:vim /etc/systemd/system/chfs.service
[Unit]
Description=HTTP File Server
After=network.target

[Service]
User=root
ExecStart=/opt/chfs/chfs-linux-amd64-3.1 -file /opt/chfs/chfs.ini
Restart=always

[Install]
WantedBy=multi-user.target
  • 启动服务、设置开机自启动
systemctl daemon-reload
systemctl start chfs
systemctl enable chfs

三、 访问和挂载

  • 通过在浏览器访问 http://ip:port
  • 下载安装RaiDrive使用webdav协议挂载为网络磁盘使用