什么是AList?
一个支持多种存储,支持网页浏览和 WebDAV 的文件列表程序,由 gin 和 Solidjs 驱动。

📥 获取 AList

下载说明
  1. 打开 AList Release 下载待部署系统对应的文件(本机需下载arm64版本的)
  2. 最新版的前端已经和后端打包好了,不用再下载前端文件
  3. xxxx 指的是不同系统/架构对应的名称,一般 Linux-x86/64 为 alist-linux-amd64
  4. 如果你的 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 #注意此处 xxxx 改为你下载的文件对应的名称

# 授予程序执行权限:
chmod +x alist

# 运行程序
./alist server

# 获得管理员信息
./alist admin

⚙️ 守护进程

配置守护进程
  1. 编辑服务文件:
1
vi /usr/lib/systemd/system/alist.service
  1. 添加以下内容:
1
2
3
4
5
6
7
8
9
10
11
12
[Unit]
Description=alist
After=network.target

[Service]
Type=simple
WorkingDirectory=path_alist #例如放在地址: /mnt 下 ,即: WorkingDirectory=/mnt
ExecStart=path_alist/alist server #WorkingDirectory=/mnt/alist server
Restart=on-failure

[Install]
WantedBy=multi-user.target
  1. 管理命令:
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;
# the max size of file to upload
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)?$