MENU

#源码#AList网盘

January 8, 2023 • Read: 587 • 网站源码

之前也用过很多网盘程序,这款更简单的来说类似于网盘检索工具,对于有很多FTP,Onedirve的人而言很有用。

本次搭建用的手动安装,安装步骤也很简单,用的GitHub上的工具。

开始

  • 本次测试环境Linux amd64
  • LNMP环境(oneinstack)

搭建

https://github.com/alist-org/alist/releases 找到你系统符合的文件。这里我用的是alist-linux-amd64.tar.gz

https://github.com/alist-org/alist/releases/download/v3.8.0/alist-linux-amd64.tar.gz
tar -zxvf alist-linux-amd64.tar.gz
chmod +x alist
./alist admin  #获取管理员信息
./alist server  #启动服务

这时候访问你的ip地址+端口 your_ip:5244 查看服务是否启动

添加自启动

使用任意方式编辑 /usr/lib/systemd/system/alist.service 并添加如下内容,其中 path_alist 为 AList 所在的路径

Description=alist
After=network.target
 
[Service]
Type=simple
WorkingDirectory=path_alist #AList 所在的路径
ExecStart=path_alist/alist server #AList 所在的路径
Restart=on-failure
 
[Install]
WantedBy=multi-user.target

然后,执行 systemctl daemon-reload 重载配置,现在你可以使用这些命令来管理程序:

  • 启动: systemctl start alist
  • 关闭: systemctl stop alist
  • 配置开机自启: systemctl enable alist
  • 取消开机自启: systemctl disable alist
  • 状态: systemctl status alist
  • 重启: systemctl restart alist

反向代理

在nginx添加如下字段

location / {
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  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;
}

官方使用文档

https://alist.nn.ci/zh/

本站测试站点

https://pan.aihoom.com

Archives QR Code Tip
QR Code for this page
Tipping QR Code
Leave a Comment