下载
[[email protected].io]# wget https://github.com/alist-org/alist/releases/download/v3.7.2/alist-linux-amd64.tar.gz
[[email protected].io]# tar zxf alist-linux-amd64.tar.gz
[[email protected].io]# sudo ./alist admin
INFO[2023-01-03 20:57:22] reading config file: data/config.json
INFO[2023-01-03 20:57:22] load config from env with prefix: ALIST_
INFO[2023-01-03 20:57:22] init logrus...
WARN[2023-01-03 20:57:22] not enable search
INFO[2023-01-03 20:57:22] admin user's info:
username: admin
password: abc1234
部署
[[email protected].io]# cat /usr/lib/systemd/system/alist.service
[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
[[email protected].io]# sudo systemctl daemon-reload
[[email protected].io]# sudo systemctl enable alist
[[email protected].io]# sudo systemctl start alist
配置
Storage 配置
打开 http://localhost:5244,你会看到这个页面:
图 1:alist 默认首页 |
---|
![]() |
忽略上面的错误,然后点击下面的 login:
图 2:alist login |
---|
![]() |
然后输入账号密码,账号密码就是最开始下载的时候,alist admin
输出的最后两行:
图 3:alist 账号密码 |
---|
![]() |
然后配置 storage:
图 4:添加 Storage |
---|
![]() |
这里我添加一个 local 的试试:
图 5:添加 local storage |
---|
![]() |
然后再重新打开 http://localhost:5244 就有内容了。
图 6:配置 storage 后首页 |
---|
![]() |
Nginx 配置
如果你本机还有 Nginx,那么可以将 alist 配置在 Nginx 之后,但是不得不说,alist 的 nginx 代理做得不好,无法使用 subpath,所以只能代理 。/
,因此 nginx 的配置为
那么你需要做额外的两个步骤:
步骤一:修改你的 alist 配置文件:
[[email protected].io]# cat /etc/alist/data/config.json
...
"site_url": "http://<domain>/alist",
...
步骤二:增加 nginx 的配置
[[email protected].io]# cat /etc/nginx/nginx.conf
location /alist/ {
proxy_pass http://127.0.0.1:5244/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Range $http_range;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
client_max_body_size 20000m;
}
问题解决
failed get storage: can’t find storage with rawPath: /
可能你一安装完之后打开就是这个报错的页面,但是实际上这无关大雅,关键的是你需要点击下面的 “Login” 登录一下:
图 7:忽略错误,选择登录 |
---|
![]() |