1. 下载安装

https://github.com/filebrowser/filebrowser/releases
解压
filebrowser拷贝到/usr/local/bin目录

2. 基本设置

创建配置数据库:filebrowser -d /etc/filebrowser.db config init
设置监听地址:filebrowser -d /etc/filebrowser.db config set --address 127.0.0.1
设置监听端口:filebrowser -d /etc/filebrowser.db config set --port 8080
设置语言环境:filebrowser -d /etc/filebrowser.db config set --locale zh-cn
设置日志位置:filebrowser -d /etc/filebrowser.db config set --log /var/log/filebrowser.log
添加一个用户:filebrowser -d /etc/filebrowser.db users add root password --perm.admin,其中的rootpassword分别是用户名和密码,根据自己的需求更改。

3. 反向代理

server {
    server_name 子域名;
    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

4. systemd自启动

/etc/systemd/system/filebrowser.service

[Unit]
Description=The filebrowser Process Manager
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/filebrowser -d /etc/filebrowser.db
ExecStop=/bin/killall filebrowser
PrivateTmp=true

[Install]
WantedBy=multi-user.target
sudo systemctl start filebrowser
sudo systemctl enable filebrowser

5. 参考

https://www.mivm.cn/filebrowser

https://www.cnblogs.com/tamatama/p/13468456.html

标签: none

添加新评论