Fork me on GitHub

其他技术 ---- Cloudreve 个人公,私有网盘搭建

Cloudreve 个人公,私有网盘搭建

环境

Golang version = 1.13

yum install golang

MySQL version >= 5.7

安装

安装之前需要有golang 的环境,这里不讨论sqllite 的方式

下载安装文件

Releases · cloudreve/Cloudreve (github.com)

去上面下载地址下载对应版本,这里我选择的是amd64 这个版本。

解压安装文件

#解压获取到的主程序
tar -zxvf cloudreve_VERSION_OS_ARCH.tar.gz

# 赋予执行权限
chmod +x ./cloudreve

添加配置文件

创建一个conf.ini 的配置文件

nano /home/cloud/config.conf

编写配置文件

  1. 使用MySQL
[Database]
; 数据库类型,目前支持 sqlite/mysql/mssql/postgres
Type = mysql
; MySQL 端口
Port = 3306
; 用户名
User = root
; 密码
Password = root
; 数据库地址
Host = 127.0.0.1
; 数据库名称
Name = v3
; 数据表前缀
TablePrefix = cd
; 字符集
Charset = utf8
  1. 使用redis
[Redis]
Server = 127.0.0.1:6379
Password = your password
DB = 0
  1. 启用https
[SSL]
Listen = :443
CertPath = /home/fullchain.pem
KeyPath = /home/privkey.pem

首次启动

使用MySQL 方式启动,配置完成后第一次启动会有一个管理员账号,密码

cloudreve -c /home/cloud/config.conf

此时会有一个初始的管理员账号密码,最好记录下来。

开放5212端口,此时就可以访问了。

登录后第一次最好修改管理员密码。

配置开机自启动

  • 创建工作目录

mkdir /home/cloud

  • 编辑 /usr/lib/systemd/system/cloudreve.service
[Unit]
Description=Cloudreve
Documentation=https://docs.cloudreve.org
After=network.target
Wants=network.target

[Service]
# cloudreve 文件的存放路径,跟上面的一样,请根据自己的情况设置,默认储存策略的文件会储存在其中
WorkingDirectory=/home/cloudreve

# 如果你是mysql,请使用这个
ExecStart=/home/cloud/cloudreve -c /home/cloud/config.conf

Restart=on-abnormal
RestartSec=5s
KillMode=mixed

StandardOutput=null
StandardError=syslog

[Install]
WantedBy=multi-user.target
  • 更新systemctl systemctl daemon-reload
# 更新配置
systemctl daemon-reload

# 启动服务
systemctl start cloudreve

# 设置开机启动
systemctl enable cloudreve

# 取消开机启动
systemctl disable cloudreve

#查看cloudreve的运行状态
systemctl status cloudreve

安装离线下载Aria2

Aria2一键安装管理脚本(可用于Cloudreve网盘离线下载) - 清酒踏月 (lkxin.cn)

wget -N --no-check-certificate https://www.lkxin.cn/Aria2/aria2.sh && chmod +x aria2.sh && bash aria2.sh

配置离线下载

进入管理面板>离线下载节点>编辑

image

image

配置RPC 服务器地址,授权令牌,临时下载绝对路径

授权令牌需要查看aria2 的配置文件/usr/local/caddy/www/aria2/Download

image

最后记得测试aria2通信

以上安装就完成了

posted @ 2022-01-19 17:25  Banana_Fish  阅读(292)  评论(0编辑  收藏  举报