个人网盘分享·Alist的安装配置和使用

简介

Alist 是一款非常强大的开源个人文件管理软件,它的功能非常多。

对我来说,它可以让我基于自己的服务器自由的分享自己的文件给亲人或者朋友,而不是依赖第三方平台,但是它强大也强大在可以依赖各个云盘实现共享而不占用自己服务器,官方支持的云盘如下:

  • 本地存储
  • 阿里云盘
  • OneDrive / SharePoint(国际版, 世纪互联,de,us)
  • 天翼云盘 (个人云, 家庭云)
  • GoogleDrive
  • 123云盘
  • FTP / SFTP
  • PikPak
  • S3
  • 又拍云对象存储
  • WebDAV(支持无API的OneDrive/SharePoint)
  • Teambition(中国,国际)
  • 分秒帧
  • 和彩云 (个人云, 家庭云)
  • Yandex.Disk
  • 百度网盘
  • 夸克网盘
  • 迅雷网盘
  • 蓝奏云
  • 阿里云盘分享
  • 谷歌相册
  • Mega.nz
  • 一刻相册

官方Demo

我的Alist

安装

安装也非常简单,根据官方指导文件,可以分为下面两种:

一键脚本

仅适用于 Linux amd64/arm64 平台。

安装

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

更新

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

卸载

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

默认安装在 /opt/alist 中,个人建议根据实际路径情况自行添加路径:

比如我安装在 /var/www/alist 路径。

# Install
curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s install /var/www/alist
# update
curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s update /var/www/alist
# Uninstall
curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s uninstall /var/www/alist

可以直接执行以下命令:

启动: systemctl start alist

关闭: systemctl stop alist

配置开机自启: systemctl enable alist

取消开机自启: systemctl disable alist

状态: systemctl status alist

重启: systemctl restart alist

手动安装

手动安装我也试了一下,感觉没有区别,步骤为:

1. 获取 AList

打开 AList Release 下载待部署系统对应的文件。最新版的前端已经和后端打包好了,不用再下载前端文件了。

2. 运行

Linux&MacOS

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

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

当你看到 start server@0.0.0.0:5244 的输出,之后没有报错,说明操作成功。 第一次运行时会输出初始密码。程序默认监听 5244 端口。 现在打开 http://ip:5244 可以看到登录页面。

3. 守护进程

使用任意方式编辑 /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-xxxx server
Restart=on-failure

[Install]
WantedBy=multi-user.target

附上我的配置:

[Unit]
Description=alist
After=network.target

[Service]
Type=simple
WorkingDirectory=/var/www/alist
ExecStart=/var/www/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

配置

Nginx为例:

修改 /etc/nginx/sites-enable/alist.conf 文件:

server {
    listen 80;
    listen [::]:80;
    server_name file.luxiyue.com;   #你的域名
        location / {
        proxy_redirect          off;
        proxy_set_header        Host            $host;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header        X-Forwarded-Proto $scheme;
        proxy_pass http://localhost:5244/;
    }
}

保存后载入配置:

systemctl reload nginx

打开你的域名就可以访问了。

这边简单配置一下存储,以本地Local为例:

更多存储添加可以查看: 官方文档

最后

其实服务器篇到这边已经基本结束了,针对个人网站/博客该有的都有了。

接下来更多的其实是想学习 VueLaravel

0 0 投票数
文章评分
订阅评论
提醒
guest
0 评论
内联反馈
查看所有评论
0
希望看到您的想法,请您发表评论x
滚动至顶部