序言
本篇文章将使用 Office 365 E5 开发者订阅搭配 VPS 安装 OneManager 自建一个网盘。
安装之前,假设已经拥有的一台能正常使用的 VPS,能正常使用表示拥有 Web 服务端,PHP等。当然我用的是 lnmp 集合包 。
注册应用
使用管理员登录微软 E5 开发者订阅 : https://admin.microsoft.com/#/homepage , 然后看图片操作:
注册的时候名称随便取,重定向 URI 选择 https://scfonedrive.github.io/ , 因为 OneManager 是这样要求的,最后点击注册 。
当然,还需要 Client Secret(我将多个图片叠加到一起了),不要复制到 Secret ID,我们需要的是值:
OK , 到此需要的信息已经拿到了,现在开始安装 OneManager 。
OneManager 安装
使用 lnmp 新建一个 vhost , 不需要数据库,只要能运行 PHP 代码即可 。
[root@liangz wwwroot]# lnmp vhost add
+-------------------------------------------+
| Manager for LNMP, Written by Licess |
+-------------------------------------------+
| https://lnmp.org |
+-------------------------------------------+
Please enter domain(example: www.lnmp.org): pan.liangz.org
Your domain: pan.liangz.org
Enter more domain name(example: lnmp.org *.lnmp.org):
Please enter the directory for the domain: pan.liangz.org
Default directory: /home/wwwroot/pan.liangz.org:
Virtual Host Directory: /home/wwwroot/pan.liangz.org
Allow Rewrite rule? (y/n) y
Please enter the rewrite of programme,
wordpress,discuzx,typecho,thinkphp,laravel,codeigniter,yii2 rewrite was exist.
(Default rewrite: other):
You choose rewrite: other
Enable PHP Pathinfo? (y/n) n
Disable pathinfo.
Allow access log? (y/n) y
Enter access log filename(Default:pan.liangz.org.log):
You access log filename: pan.liangz.org.log
Create database and MySQL user with same name (y/n) n
Add SSL Certificate (y/n) n
Press any key to start create virtul host...
Create Virtul Host directory......
set permissions of Virtual Host directory......
You select the exist rewrite rule:/usr/local/nginx/conf/rewrite/other.conf
Test Nginx configure file......
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
Reload Nginx......
Reload service php-fpm done
================================================
Virtualhost infomation:
Your domain: pan.liangz.org
Home Directory: /home/wwwroot/pan.liangz.org
Rewrite: other
Enable log: yes
Create database: no
Create ftp account: no
================================================
[root@liangz wwwroot]#
然后从 https://github.com/qkqpttgf/OneManager-php/releases 下载一个 release 版本的程序包,解压后放到上面设置的目录里面 , 比如我的在 /home/wwwroot/pan.liangz.org
。
然后修改 nginx config 文件,将 rewrite ^(.*) /index.php?/$1 last; 写入到相应的 vhost 的 conf 文件中 , 例如我的修改如下:
[root@liangz vhost]# cd /usr/local/nginx/conf/vhost/
[root@liangz vhost]# vim pan.liangz.org.conf
然后将 rewrite ^(.*) /index.php?/$1 last;
加入到 conf 文件中 。 修改域名解析后,可以直接通过域名访问并安装 OneManager 。
点击上图开始安装,下一步是选择语言,语言就自己选择了,然后让你测试伪静态,如果没通过,就是上面的一步没有完成
请将程序代码所在的目录的所有者修改为 www:www ,例如我的修改如下:
chown -R www:www pan.liangz.org/
正常情况下,执行上面的代码之后就可以了,但是如果还是不行,那就进入程序目录,给 .data/config.php 读取写入权限:
chmod 666 .data/config.php
然后点击管理添加 OneDrive ,标签与名称随便填写,但是 Client ID 和 Client Secret 必须是前文中的:
这就是为什么在申请应用的时候把 重定向 URI 选择 https://scfonedrive.github.io/ 的原因。点击确认后再用你的 E5 管理员账号确认授权就可以了。完成后的效果如下:
OK,这个网盘算是完成了
结语
可以更方便的将文件上传保存了。
如有错误,敬请指出,感谢指正! — 2021-05-22 23:32:26
最新评论
这个软件有bug的,客户端windows有些键不能用如逗号、句号
没有收到邮件通知
我的评论通知貌似坏掉了,定位一下问题
测试一下重新部署后的邮件功能
居然看到自己公司的MIB库,诚惶诚恐
那可能是RobotFramework-ride的版本问题。我装的1.7.4.2,有这个限制。我有空再尝试下旧版本吧,感谢回复。
你好!我在python2.7中安装RobotFramework-ride的时候提示wxPython的版本最高是2.18.12,用pip下载的wxPython版本是4.10,而且我在那个路径下没有找到2
真的太好了,太感谢了,在bilibili和CSDN上都找遍了,终于在你这里找到了