用兰空图床搭设阿里云盘图床

134次阅读

共计 3108 个字符,预计需要花费 8 分钟才能阅读完成。

我只是一个自己折腾的小白,大佬要是看到我写的直摇头的话请忽略我的方法
直接在兰空图床上设置阿里云盘 webdav 的话用不了(可以上传,但是在论坛引用地址的话没图片,这是我试的,其他人直接在兰空设置 webdav 能直接用的话当我没说,我水平有限),所以先挂载为本地硬盘就行。
一、在服务器上搭设 docker 版阿里云盘 webdav
docker run -d –name=aliyundrive-webdav –restart=unless-stopped -p 8080:8080
-v /etc/aliyundrive-webdav/:/etc/aliyundrive-webdav/
-e REFRESH_TOKEN=’your refresh token’
-e WEBDAV_AUTH_USER=admin
-e WEBDAV_AUTH_PASSWORD=admin
messense/aliyundrive-webdav
二、安装 rclone
curl https://rclone.org/install.sh | sudo bash
三、配置 rclone
root@truenas[~]# rclone config
2022/01/18 14:12:40 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found – using defaults
No remotes found – make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> aliyundriver
Option Storage.
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value.
39 / Uptobox
"uptobox"
40 / Webdav
"webdav"
41 / Yandex Disk
"yandex"
Storage> 40
Option url.
URL of http host to connect to.
E.g. https://example.com.
Enter a string value. Press Enter for the default ("").
url> http://10.0.0.10:8080/ #阿里云盘 webdav 地址,就是你的服务器的地址 + 端口
Option vendor.
Name of the Webdav site/service/software you are using.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value.
1 / Nextcloud
"nextcloud"
2 / Owncloud
"owncloud"
3 / Sharepoint Online, authenticated by Microsoft account
"sharepoint"
4 / Sharepoint with NTLM authentication, usually self-hosted or on-premises
"sharepoint-ntlm"
5 / Other site/service or software
"other"
vendor> 5
Option user.
User name.
In case NTLM authentication is used, the username should be in the format ‘DomainUser’.
Enter a string value. Press Enter for the default ("").
user> admin
Option pass.
Password.
Choose an alternative below. Press Enter for the default (n).
y) Yes type in my own password
g) Generate random password
n) No leave this optional password blank (default)
y/g/n> y
Enter the password:
password: #用户名账号和密码我自己是设置的和 webdav 一样的,也许可以随便设置,我没尝试
Confirm the password:
password:
Option bearer_token.
Bearer token instead of user/pass (e.g. a Macaroon).
Enter a string value. Press Enter for the default ("").
bearer_token>
Edit advanced config?
y) Yes
n) No (default)
y/n> n
——————–
[alidriver]
type = webdav
url = http://10.0.0.10:8880/
vendor = other
user = admin
pass = *** ENCRYPTED ***
——————–
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:
Name Type
==== ====
aliyundriver webdav #记住你设置的 name
e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c)remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q
四、挂载
1、建立目录
mkdir /mnt 系统没 mnt 目录就先建立
mkdir /mnt/aliyundriver 一步一步来
2、创建挂载点
rclone mount rclone 配置文件 name: 目录 /mnt/aliyundriver –cache-dir /tmp –allow-other –vfs-cache-mode writes –allow-non-empty &
所以我的是
rclone mount aliyundriver:/ /mnt/aliyundriver –cache-dir /tmp –allow-other –vfs-cache-mode writes –allow-non-empty &
这样就挂载到服务器成为本地硬盘了。
五、nginx 设置
编辑 /www/server/nginx/conf/nginx.conf 文件
server 项添加
location /tu {
root/mnt/aliyundriver/ 图床;# 定义服务器的默认网站根目录位置
index index.html index.php index.htm;# 定义首页索引文件的名称
/tu 是兰空图床访问网址的根路径,根据自己修改,兰空设置与这里一样就行
用兰空图床搭设阿里云盘图床
六、设置兰空图床存储策略
用兰空图床搭设阿里云盘图床

看到这么多字我就知道这篇帖子与我无关了不错,回头试试……一看就很牛逼。我不会我也不会我干过 甚至建站都试过 卡的一批 不仅有防盗链而去还封号阿里云盘请求量大了直接封号的不怕封号的嘛用这个搭建的图床,是不是等到 阿里云封号之后,便是图床跑路之时用兰空图床搭设阿里云盘图床这样没意义,反而打开图片需要从阿里云盘下载到服务器再给用户,可以试试你这个方案加上 alist 票了六年的良心清凉无忧做图床不好?

正文完
 0