全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1312|回复: 12
打印 上一主题 下一主题

[经验] 用兰空图床搭设阿里云盘图床

[复制链接]
跳转到指定楼层
1#
发表于 2022-5-3 11:21:04 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我只是一个自己折腾的小白,大佬要是看到我写的直摇头的话请忽略我的方法

直接在兰空图床上设置阿里云盘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 'Domain\User'.
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 是兰空图床访问网址的根路径,根据自己修改,兰空设置与这里一样就行




六、设置兰空图床存储策略





推荐
发表于 2022-5-3 11:25:23 来自手机 | 只看该作者
看到这么多字我就知道这篇帖子与我无关了
3#
发表于 2022-5-3 11:25:37 来自手机 | 只看该作者
不错,回头试试
5#
发表于 2022-5-3 11:51:41 | 只看该作者
一看就很牛逼。我不会
7#
发表于 2022-5-3 12:39:45 来自手机 | 只看该作者
我干过 甚至建站都试过 卡的一批 不仅有防盗链而去还封号
8#
发表于 2022-5-3 12:59:11 | 只看该作者
阿里云盘请求量大了直接封号的
9#
发表于 2022-5-3 13:59:48 | 只看该作者
不怕封号的嘛
10#
发表于 2022-5-3 18:00:21 | 只看该作者
用这个搭建的图床,是不是等到 阿里云封号之后,便是图床跑路之时
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-6-16 00:48 , Processed in 0.065489 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表