使用Alist搭建一个自己的云盘

由于我暂无云盘需求这里使用安卓模拟终端部署演示部署图文以及设置将在评论区展示。

如需部署至服务器请按下面的来
Linux一键脚本,以下脚本仅适用于Linux amd64/arm64 平台

安装
curl -fsSL \”



更新
curl -fsSL \”

卸载
curl -fsSL \”

手动安装
打开下面github链接下载待部署系统对应的文件


Linux/macOS
# 解压下载的文件,得到可执行文件:
tar -zxvf alist-xxxx.tar.gz
# 授予程序执行权限:
chmod +x alist
# 运行程序
./alist server
# 获得管理员信息
./alist admin

Windows
# 解压下载的文件,得到可执行文件:
unzip alist-xxxx.zip
# 运行程序
.\\alist.exe server
# 获得管理员信息
.\\alist.exe admin

win(scoop)
# 安装
scoop install alist
# 运行
alist server

xxxx 指的是不同系统/架构对应的名称,一般 Linux-x86/64 为 alist-linux-amd64。如果你的 glibc 版本太低,建议下载 musl 版本

守护进程(Linux)
使用任意方式编辑 /usr/lib/systemd/system/alist.service 并添加如下内容,其中 path_alist 为 AList 所在的路径
[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
然后,执行 systemctl daemon-reload 重载配置,现在你可以使用这些命令来管理程序:

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

反向代理
程序默认监听 5244 端口。如有修改,请一并修改下列配置中的端口号。如果你使用反向代理,建议你设置site_url,以帮助alist更好的工作。

#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_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;
}
注意
如果使用宝塔面板,请务必删除以下默认配置
– location ~ ^/(\\.user.ini|\\.htaccess|\\.git|\\.svn|\\.project|LICENSE|README.md
– location ~ .\\*\\.(gif|jpg|jpeg|png|bmp|swf)$
– location ~ .\\*\\.(js|css)?$

Apache
反向代理,由于帖子字数限制,后面的教程在评论区。

这是搭建成功的展示网站:http://yunpan.guyinga.top 未央资源网图片
未央资源网图片

© 版权声明
THE END
感觉文章不错请大大点赞分享一下吧
点赞24 分享
评论 抢沙发

请登录后发表评论

图片-未央资源网