- A+
[callout class="info" title=""]【环球科技报道 周涛】继UC网盘、新浪微盘、金山快盘、腾讯微云等多家网盘停止存储服务后,华为网盘也宣布停止服务。华为网盘发布公告称,为配合国家有关部门积极开展网盘涉黄、涉盗版内容的清查工作,华为网盘的服务内容即日起将予以相应调整:停止用户数据存储分享服务,所有用户数据将保留到2016年6月30日止;7月1日起,DBank华为网盘免费永久空间资格将被终止。[/callout]
新闻链接:http://www.techweb.com.cn/column/2016-05-04/2326912.shtml
这真是个悲伤的故事,国内排名前十的网盘已有六家宣布停止服务,下一个会是百度云?还是360云盘?谁也说不清楚。想了想还是觉得自己动手,丰衣足食。
OwnCloud是什么?它是一套开源的网盘系统,搭配上对应的客户端可以实现绝大多数网盘功能,包括同步、上传、下载、外链分享统统不在话下!
OwnCloud官网:https://owncloud.org/
安装方法与步骤
如果你使用纯净服务器安装,可直接使用官方提供的一键脚本安装LAMP环境。(小内存服务器慎用,并且注意选择操作系统版本)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
//CentOS_6 owncloud-8.2.2-1 rpm --import https://download.owncloud.org/download/repositories/stable/CentOS_6/repodata/repomd.xml.key wget http://download.owncloud.org/download/repositories/stable/CentOS_6/ce:stable.repo -O /etc/yum.repos.d/ce:stable.repo yum clean expire-cache yum install owncloud //CentOS_7 owncloud-8.2.2-1 rpm --import https://download.owncloud.org/download/repositories/stable/CentOS_7/repodata/repomd.xml.key rpm -Uhv http://dl.fedoraproject.org/pub/epel/7/$(uname -i)/e/epel-release-7-5.noarch.rpm wget http://download.owncloud.org/download/repositories/stable/CentOS_7/ce:stable.repo -O /etc/yum.repos.d/ce:stable.repo yum clean expire-cache yum install owncloud //Debian_7.0 owncloud-8.2.2-1.1 wget -nv https://download.owncloud.org/download/repositories/stable/Debian_7.0/Release.key -O Release.key apt-key add - < Release.key sh -c "echo 'deb http://download.owncloud.org/download/repositories/stable/Debian_7.0/ /' >> /etc/apt/sources.list.d/owncloud.list" apt-get update apt-get install owncloud //Debian_8.0 owncloud-8.2.2-1.1 wget -nv https://download.owncloud.org/download/repositories/stable/Debian_8.0/Release.key -O Release.key apt-key add - < Release.key sh -c "echo 'deb http://download.owncloud.org/download/repositories/stable/Debian_8.0/ /' >> /etc/apt/sources.list.d/owncloud.list" apt-get update apt-get install owncloud //Ubuntu_14.04 owncloud-8.2.2-1.1 wget -nv https://download.owncloud.org/download/repositories/stable/Ubuntu_14.04/Release.key -O Release.key apt-key add - < Release.key sh -c "echo 'deb http://download.owncloud.org/download/repositories/stable/Ubuntu_14.04/ /' >> /etc/apt/sources.list.d/owncloud.list" apt-get update apt-get install owncloud |
以上提供的是LAMP方法,对于配置有一定要求,如果你已经有搭建好的LNMP环境,请继续阅读。
创建好lnmp虚拟主机:lnmp vhost add
首先下载好最新的源码包,速度很慢的话在本地下载好在上传也行:
1 2 3 4 5 |
cd /home/wwwroot/cloud.xlinblog.net wget https://download.owncloud.org/community/owncloud-9.0.2.tar.bz2 tar zxvf owncloud-9.0.2.tar.bz2 |
修改conf设置,以下是未开启SSL版本,若需开启SSL可参考[技术]子霖博客全站开启SSL https访问手记 WordPress如何开启全站https?修改配置文件。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
upstream php-handler { server 127.0.0.1:9000; #下面注意sock地址是否正确 #server unix:/var/run/php5-fpm.sock; } server { listen 8080; server_name cloud.example.com; # Path to the root of your installation root /usr/share/nginx/html/owncloud/; # set max upload size client_max_body_size 10G; fastcgi_buffers 64 4K; # Disable gzip to avoid the removal of the ETag header gzip off; # Uncomment if your server is build with the ngx_pagespeed module # This module is currently not supported. #pagespeed off; rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect; rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect; rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect; index index.php; error_page 403 /core/templates/403.php; error_page 404 /core/templates/404.php; location = /robots.txt { allow all; log_not_found off; access_log off; } location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){ deny all; } location / { # The following 2 rules are only needed with webfinger rewrite ^/.well-known/host-meta /public.php?service=host-meta last; rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last; rewrite ^/.well-known/carddav /remote.php/carddav/ redirect; rewrite ^/.well-known/caldav /remote.php/caldav/ redirect; rewrite ^(/core/doc/[^\/]+/)$ $1/index.html; try_files $uri $uri/ /index.php; } location ~ \.php(?:$|/) { fastcgi_split_path_info ^(.+\.php)(/.+)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_pass php-handler; } # Optional: set long EXPIRES header on static assets location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ { expires 30d; # Optional: Don't log access to assets access_log off; } } |
大功告成!如果需要同步客户端之类的可前往https://owncloud.org/install/下载!