vps交流

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


我只是一个自己折腾的小白,大佬要是看到我写的直摇头的话请忽略我的方法

直接在兰空图床上设置阿里云盘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
[email protected][~]# 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 是兰空图床访问网址的根路径,根据自己修改,兰空设置与这里一样就行

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

六、设置兰空图床存储策略
[经验]  用兰空图床搭设阿里云盘图床

看到这么多字我就知道这篇帖子与我无关了
不错,回头试试
……
[经验]  用兰空图床搭设阿里云盘图床 一看就很牛逼。我不会