程序下载:https://github.com/donwa/oneindex/archive/master.zip
上传到网站目录,还有绑定域名,这个都不说了。
上传完解压,直接打开绑定的域名就可以安装了,不用设置权限。
gegehost的那个空间肯定是支持的。
![](http://upload-images.jianshu.io/upload_images/13232710-6bdea92a603a2968.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1000/format/webp)
点击下一步后出现如下界面,借用原程序作者的 gif 图展示:
![](http://upload-images.jianshu.io/upload_images/13232710-04661e2220e65951.gif?imageMogr2/auto-orient/strip%7CimageView2/2/w/950/format/webp)
至此程序基本安装完毕,此时访问自己的域名,就可以看到 OneDrive 目录下的所有文件啦。
进去之后先修改密码,然后重建所有缓存。
如果你跟我一样介意?那么可以上传一个文件到根目录。
![](http://upload-images.jianshu.io/upload_images/13232710-b8e532f15aca8dc8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/576/format/webp)
官网上有https://github.com/donwa/oneindex/blob/master/.htaccess
直接下载下来就行。
代码如下:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php?/$1 [L]
第2,3句是强制https的,如果不开启可以不用添加。
再次重建所有缓存就可以了。
上面显示的所有文件
![](http://upload-images.jianshu.io/upload_images/13232710-b3aaa55c21281547.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1000/format/webp)
就是你onedrive里面的目录和文件哦
![](http://upload-images.jianshu.io/upload_images/13232710-a36262be74d7b98f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/870/format/webp)
经过下载速度测试,发现我现在用的教育账号比个人账号的下载速度更快,果断更换教育账号,5T容量哦。
有需要的朋友可以留言,免费提供,但是不保证长期有效。
如果要更改title,只需要找到controller目录下的IndexController.php里面的title就可以了。
具体如下图所示:
![](http://upload-images.jianshu.io/upload_images/13232710-dc61038225e39dec.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1000/format/webp)
至于如何设置crontab定时刷新缓存
可以参考:
![](http://upload-images.jianshu.io/upload_images/13232710-bcb11a358e10fbe0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/950/format/webp)
找到后台显示的命令,复制下来。
然后进入cPanel面板,在高级里面找到Cron作业
![](http://upload-images.jianshu.io/upload_images/13232710-06b48169823e9a8a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/772/format/webp)
![](http://upload-images.jianshu.io/upload_images/13232710-af5f330234d82a13.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1000/format/webp)
选一个时间,把命令复制过来,注意要把前面的*/10 * * * * 删掉哦
点击添加新Cron作业就可以了。
文件夹加密的用法如下:
在onedrive里面的文件夹下面放入.password的文件,.password里面写入密码就可以了。
![](http://upload-images.jianshu.io/upload_images/13232710-f3be7c13f06bf186.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/605/format/webp)
因为使用的不是个人版Onedrive,所以我们可以修改文件管理的链接。
具体更改如下图所示:
把https://onedrive.live.com/改成自己企业的登录地址,比如说是https://XXX-my.sharepoint.com
![](http://upload-images.jianshu.io/upload_images/13232710-c0d625827b37cbf8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/363/format/webp)
文件是view/admin下的layout.php
![](http://upload-images.jianshu.io/upload_images/13232710-c41dcb5462a42eea.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1000/format/webp)
至此大功告成,小伙伴们可以测试一下。
刚刚遇到ju.tn被屏蔽的问题,解决方法:
找到AdminController.php
删除下面的这段代码,成功显示出来。
我还以为是啥问题了,重装了N遍。。。
if($_SERVER[‘HTTP_HOST’] == ‘localhost’){
$redirect_uri = ‘http://’.$_SERVER[‘HTTP_HOST’].get_absolute_path(dirname($_SERVER[‘PHP_SELF’]));
}else{
// 非https,调用ju.tn中转
$redirect_uri = ‘https://ju.tn/‘;
}
作者:OnePieceing
链接:https://www.jianshu.com/p/752e14de8fa4
來源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。
评论前必须登录!
注册