什么是AList?
一个支持多种存储,支持网页浏览和 WebDAV 的文件列表程序,由 gin 和 Solidjs 驱动。
📥 获取 AList
下载说明
- 打开 AList Release 下载待部署系统对应的文件(本机需下载arm64版本的)
- 最新版的前端已经和后端打包好了,不用再下载前端文件
- xxxx 指的是不同系统/架构对应的名称,一般 Linux-x86/64 为 alist-linux-amd64
- 如果你的 glibc 版本太低,建议下载 musl 版本
当你看到 start server@0.0.0.0:5244 的输出,之后没有报错,说明操作成功。
第一次运行时会输出初始密码。程序默认监听 5244 端口。
现在打开 http://ip:5244 可以看到登录页面。
🚀 手动运行
1 2 3 4 5 6 7 8 9 10 11
| tar -zxvf alist-xxxx.tar.gz
chmod +x alist
./alist server
./alist admin
|
⚙️ 守护进程
配置守护进程
- 编辑服务文件:
1
| vi /usr/lib/systemd/system/alist.service
|
- 添加以下内容:
1 2 3 4 5 6 7 8 9 10 11 12
| [Unit] Description=alist After=network.target [Service] Type=simple WorkingDirectory=path_alist ExecStart=path_alist/alist server Restart=on-failure [Install] WantedBy=multi-user.target
|
- 管理命令:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| systemctl daemon-reload
systemctl start alist
systemctl stop alist
systemctl enable alist
systemctl disable alist
systemctl status alist
systemctl restart alist
|
🔄 反向代理
Nginx配置
在网站配置文件的 server 字段中添加:
1 2 3 4 5 6 7 8 9 10 11 12
| location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Range $http_range; proxy_set_header If-Range $http_if_range; proxy_redirect off; proxy_pass http://127.0.0.1:5244; client_max_body_size 20000m; }
|
如果使用宝塔面板,请务必删除以下默认配置(建议用#注释掉即可):
1 2 3
| location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md location ~ .\*\.(gif|jpg|jpeg|png|bmp|swf)$ location ~ .\*\.(js|css)?$
|