https://github.com/filebrowser/filebrowser
systemctl status firewalld.service
systemctl stop firewalld.service && systemctl disable firewalld.service
setenforce 0
# 准备get.sh:https://raw.githubusercontent.com/filebrowser/get/master/get.sh
# 将sh脚本上传服务器
chmod u+x get.sh
./get.sh
# 在github项目地址下载应用程序zip包:filebrowser-master.zip
# 将zip上传服务器,并解压
unzip filebrowser-master.zip
# 运行程序
# 此时发现,程序监听的是127.0.0.1:8080
# 此地址无法被外界访问
[root@filebrowser ~]# filebrowser -r filebrowser-master
2021/09/04 11:58:52 No config file used
2021/09/04 11:58:52 Listening on 127.0.0.1:8080
^C2021/09/04 12:00:17 Caught signal interrupt: shutting down.
2021/09/04 12:00:17 accept tcp 127.0.0.1:8080: use of closed network connection
# 初始化配置文件
# 会在当前目录生成./filebrowser.db文件
filebrowser config init
# 设置宿主机地址
filebrowser config set --address 172.xx.xx.xxx -d ./filebrowser.db
# 再次启动文件,成功监听了宿主机地址,外界可以访问了。
[root@filebrowser ~]# filebrowser -r filebrowser-master
2021/09/04 12:00:37 No config file used
2021/09/04 12:00:37 Listening on 172.xx.xx.xxx:8080
2021/09/04 12:02:07 /api/login: 403 172.xx.xx.x <nil>
# 可以使用后台运行命令,长久运行应用程序
nohup filebrowser -r filebrowser &