OwnCloud 介绍

csslayer | 2011/06/22

其实最近大家可能在提交摘要上看到不少次这家伙出镜,这次就来稍微介绍一下。

简单来说就是一个基于Php的自建网盘。基本上是私人使用这样,因为直到现在开发版本也没有暴露注册功能。

我自己搭建了一个来玩,官方配置是说Apache,我这边是用nginx配置的,顺便也补充一下配置经验。

地址:https://www.csslayer.tk/owncloud/ 一个可以用的用户名密码是:ikde,ikde。

也支持通过webdav访问,我这里是https,于是就是

webdavs://www.csslayer.tk/owncloud/files/webdav.php/ (1.2版本的webdav地址和它不同)

可以直接用dolphin打开,也可以在dolphin的网络那里添加网络文件夹,注意选择加密。

总之这个地址仅供试用,不要滥用。

nginx配置如下:

location /owncloud {
 index  index.php;
 try_files $uri $uri/ @webdav;
 }

location @webdav { fastcgi_split_path_info ^(.+.php)(/.*)$; fastcgi_param  SCRIPT_FILENAME  /var/www/html/$fastcgi_script_name; include fastcgi_params; fastcgi_param HTTPS on; fastcgi_pass   127.0.0.1:9000; }

fastcgi_params的内容网上到处都有,下面是个例子,注意其中路径需要按照你自己的路径做对应改变。
fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name; fastcgi_param  REQUEST_URI        $request_uri; fastcgi_param  DOCUMENT_URI       $document_uri; fastcgi_param  DOCUMENT_ROOT      $document_root; fastcgi_param  SERVER_PROTOCOL    $server_protocol;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1; fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr; fastcgi_param  REMOTE_PORT        $remote_port; fastcgi_param  SERVER_ADDR        $server_addr; fastcgi_param  SERVER_PORT        $server_port; fastcgi_param  SERVER_NAME        $server_name;

PHP only, required if PHP was built with --enable-force-cgi-redirect

fastcgi_param  REDIRECT_STATUS    200;

配置的是git里面的2.0开发版,功能也仅限预览图片,文件管理而已。

如果想要用Android访问的话,给出的建议是采用android的webdav客户端。

http://owncloud.org/index.php/WebDAV_clients_for_Android

直接挂载的话,可以参考这里的链接,简单来说就是采用dav2fs。

http://owncloud.org/index.php/Mount_WebDAV_on_Linux

第一次配置会有个安装向导,包括创建帐号,配置数据库,数据库支持mysql或者sqlite。

既然已经是php实现的了,其实使用发行版提供的包也没什么太大必要。

客户端的地址在这里

http://gitorious.org/owncloud-sync-client/owncloud-sync-client

似乎开发停滞中,纯Qt,我这里测试也失败了,可能并不好用。

2.0已经和opendesktop.org 做了插件集成,http://apps.ownclouds.com 不过插件库还空空如也。

总之,对于想要自建网盘的人来说,是个还算不错的选择,也能很好的支持https。Webdav作为访问方式也相当通用,相信在其他操作系统上也可以很方便的访问。

Tags:

10 FEEDBACKS

  1. 刚刚装好这玩意儿,就看到这文章。。。 帮你测试下~

  2. 有个bug,就是webdav无法创建中文文件夹(web上面倒是可以),中文文件名反而可以,真诡异。。。

  3. 博客主题在Opera autopatch扩展中简直无法回复

  4. @muxueqz 我觉得这是正常的……我测试了一下,意外的页面没有支离破碎,只不过一口气必须加载到头……

  5. nilsja

    i dont understand chinese so i try it in english: did you manage to install owncloud 2.x on an nginx webserver? thanks, nils

  6. @nilsja Yes, do you meet some problem? And, you can use “Translate” at the top.

  7. nilsja

    @csslayer yes, i am running ubuntu 11.04 and i don’t get the webdav support running. How did you manage that your nginx understands all important webadv methods?

    Can you up-, download and move files in your owncloud with for example nautilus?

    Thank you very much!

    nils

  8. @nilsja All my configuration has been listed above (Though you can’t read chinese, but I think you can find it 🙂 ) As you can see in the post, I put my owncloud at https://www.csslayer.tk/owncloud/ So the location is /owncloud and https is on. Then I use try_files to redirect the request to the correct uri. So that’s it. I don’t know how you configure your nginx and php, but I use fastcgi, so that’s all my config for owncloud in nginx, added to my “server” section.

  9. nilsja

    thank you very much. but what are all the fastcgi_params for? owncloud also works without them here… to precise with just these here:
    location ~ .php$ { include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/public_html/$fastcgi_script_name; }

Leave a Reply

Your email address will not be published. Required fields are marked *

Note: Commenter is allowed to use '@User+blank' to automatically notify your reply to other commenter. e.g, if ABC is one of commenter of this post, then write '@ABC '(exclude ') will automatically send your comment to ABC. Using '@all ' to notify all previous commenters. Be sure that the value of User should exactly match with commenter's name (case sensitive).