alist简易搭建教程

一键脚本

仅支持Linux-x86_64/aarch64平台。

安装

curl -fsSL "https://nn.ci/alist.sh" | bash -s install    

更新

curl -fsSL "https://nn.ci/alist.sh" | bash -s update

卸载

curl -fsSL "https://nn.ci/alist.sh" | bash -s uninstall

自定义路径
默认安装在/opt/alist,要自定义安装路径,添加安装路径为第二个参数,必须是绝对路径(路
径以alist结尾时直接安装到给定路径,否则会安装在给定路径alist目录下),如安装到/root

 # 安装 curl -fsSL "https://nn.ci/alist.sh" | bash -s install /root
 # 更新 curl -fsSL "https://nn.ci/alist.sh" | bash -s update /root
 # 卸载 curl -fsSL "https://nn.ci/alist.sh" | bash -s uninstall /root 

手动安装

获取Alist

打开AList Release下载要部署的系统对应的文件,最新的版本前端已经与后端打包在一起,无需再次下载前端文件。

运行起来

Linux

# 解压下载对文件得到可执行文件:
tar -zxvf alist-xxxx.tar.gz
# 赋予程序执行权限:
chmod +x alist-xxxx
# 运行程序
./alist-xxxx

当看到输出start server @ 0.0.0.0:5244且之后没有报错后,就表示运行成功了,首次运行会
输出初始密码,程序默认监听5244端口,现在打开http://ip:5244就可以看见登陆页面了。

守护进程

vim /etc/systemd/system/alist.service添加以下内容,其中path_alist为alist所在的路径

[Unit]
Description=alist
After=network.target
[Service]
Type=simple
WorkingDirectory=path_alist
ExecStart=path_alist/alist-xxxx -conf data/config.json
Restart=on-failure
[Install]
WantedBy=multi-user.target

然后systemctl daemon-reload,现在你就可以使用这些命令来管理程序了:

  • 启动: systemctl start alist
  • 关闭: systemctl stop alist
  • 自启: systemctl enable alist
  • 状态: systemctl status alist
  • 重启: systemctl restart alist
    

反向代理

程序默认监听5244端口

nginx

在网站的配置文件的server字段中加入

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_redirect off;
 proxy_pass http://127.0.0.1:5244;
 # 上传的最大文件尺寸
 client_max_body_size 20000m;
}

如果你使用宝塔,请务必删除以下默认配置

  • location ~ ^/(.user.ini|.htaccess|.git|.svn|.project|LICENSE|README.md
  • location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
  • location ~ .*.(js|css)?$

    图片[1]-alist简易搭建教程-VIINAS博客

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容