LoginSignup
5
4

More than 5 years have passed since last update.

ownCloud Proxyって何?

Last updated at Posted at 2015-12-20

この記事は、ownCloud Advent Calendar 2015 12月21日の内容です。
http://qiita.com/advent-calendar/2015/owncloud

ownCloud Proxyの概要

インターネットに接続していないローカル環境のowncloudに、インターネットからアクセスできるようにするプラグインです。

仕組みとしては、PageKiteという海外のサービスをプロキシとして利用して、ownCloudにアクセスします。

ownCloudのHTTP/HTTPSアクセスをAnywhereにしていないような場合でも、PageKite経由でブラウザでownCloudにアクセスすることができます。

実際には、https://XXXXXXXXXXX.pagekite.meというURLでアクセスできます。更にサブドメインを追加したりもできます。

実際に使う場合は、PageKite用にアカウントが必要です。

app_owncloudproxy001.png

使い方

PageKiteのアカウント登録

ownCloudの管理画面からアカウントを登録します。
最後に「Accept the Terms of Service」にチェックを入れます。

そうすると下記のような、PageKiteからアカウントのアクティベーションメールが届きます。

Welcome to PageKite!
Someone, hopefully you, signed up for a PageKite account using your e-mail address: xxxxxxxxxxxx@xxxxxx.jp
In order to activate your account, please click the following link or paste it into your web-browser:

https://pagekite.net/home/?u=xxxxxxxxxxx%40xxxxxxx.jp&a=xxxxxxxx

If not activated, your account will automatically be deleted in 10 days. So if you believe this was all a mistake, just delete this message and you won't hear from us again. Sorry to have bothered you!

Your account details:

account type:   Trial
e-mail address:     xxxxxxxxxxxx@xxxxxx.jp
password:   xxxxxxxxxxxx
domain name:    xxxxxxxxx.pagekite.me

Thank you for giving PageKite a try, we sincerely hope it will prove useful to you. If you have any questions or comments, feel free to reply to this e-mail. Alternately, you can take advantage of our on-line tech support at: https://pagekite.net/support/
Kind regards,
 The PageKite team
 https://pagekite.net/

文中のリンクをクリックするとPageKiteの管理画面にログインします。
******.pagekite.meとなっているのが割り当てられたPageKite用のURLです。

app_owncloudproxy002.png

登録アカウントの詳細です。
登録しているメールアドレスや鍵情報などを確認できます。

app_owncloudproxy003.png

作業履歴です。
アカウントのパスワードを変えたり、サブドメインを作成したりしたことが履歴として記録されます。
app_owncloudproxy004.png

PageKiteツールのインストール

次に、ownCloud側にPageKite用のツールをインストールする必要があります。

ownCloudにインストールするマニュアルがPageKite側で用意されています。
https://pagekite.net/wiki/Howto/GNULinux/OwnCloud/

# Install pagekite.py to /usr/local/bin:
$ curl -s https://pagekite.net/pk/ | sudo bash

# Fire it up!
$ pagekite.py 80 YOUR-NAME-HERE.pagekite.me

Voila! Your ownCloud will be publicly visible as: https://YOUR-NAME-HERE.pagekite.me/owncloud/.

上記手順をownCloudが動いているサーバ上で実行すると、下記のように対話形式のウィザードが始まります。

ここから、PageKiteの設定を行っていきます。
>>> Creating kite: xxxxxxxxxx.pagekite.me                   [CTRL+C = Cancel]

    Welcome to PageKite!

    Please answer a few quick questions to
    create your first kite.

    By continuing, you agree to play nice
    and abide by the Terms of Service at:
    - https://pagekite.net/humans.txt

 => Use the PageKite.net service? [Y/n] (Yを入力)


PageKiteに登録したメールアドレスを入力します。
>>> Creating kite: xxxxxxxxxx.pagekite.me                   [CTRL+C = Cancel]

    We need to be able to contact you
    now and then with news about the
    service and your account.

    Your details will be kept private.

 => What is your e-mail address? (PageKiteに登録しているメールアドレスを入力)


パスワードを入力します。
>>> Creating kite: xxxxxxxxxx.pagekite.me                   [CTRL+C = Cancel]

*** Signup failed!
***
*** You already have an account. Log in to continue.

    By logging on to PageKite.net,
    you will be able to use this kite
    with your pre-existing account.

    Please log on ...
 => Password: xxxxxxxxxx (PageKiteに設定しているアカウントパスワードを入力)

>>> Creating kite: xxxxxxxxxx.pagekite.me                   [CTRL+C = Cancel]

*** Success!


設定を保存するかどうかです。
保存すると次回以降、パスワードの入力などをスキップできます。
 => Save settings to /root/.pagekite.rc? [Y/n] (Y/nどちらでも)

これで完了しました。
>>> Hello! This is pagekite.py v0.5.8a.                         [CTRL+C = Stop]
    Connecting to front-end XXX.XXX.XXX.XXX:443 ...
     - Protocols: http http2 http3 https websocket irc finger httpfinger raw
     - Protocols: minecraft
     - Ports: 79 80 443 843 2222 3000 4545 5222 5223 5269 5670 6667 8000 8080
     - Ports: 8081 9292 25565
     - Raw ports: 22 virtual
    Quota: You have 2557.04 MB, 31 days and 5 connections left.
~<> Flying localhost:80 as https://xxxxxxxxxx.pagekite.me/
    221.244.127.226 < http://xxxxxxxxxx.pagekite.me:443 (localhost:80)
 << pagekite.py [flying]   Kites are flying and all is well.

ということで、これで、owncloudにどこからでも、PageKite経由でアクセスできるようになりました。

終了するには、Ctrl+Cです。

アクセス確認

実際に、ファイアウォールで特定IPからのアクセスだけ許可したownCloudに、PageKiteからアクセスできるか確認してみます。

割り当てられたURL「xxxxxxxxxx.pagekite.me」にアクセスしてみると、確かにPageKiteのURLでownloudにアクセスできました。
app_owncloudproxy005.png

信頼できるドメイン

アクセス時に今回の「xxxxxxxxxx.pagekite.me」をownCloudの「信頼できるドメイン」に登録する必要があります。

config/config.php
  'trusted_domains' =>
  array (
    0 => '既存設定(あれば)', 2 => 'xxxxxxxxxx.pagekite.me',
  ),

注意点

プロキシ経由なのでレスポンスは、やはり遅くなります。
今回はPageKiteのフリートライアルの期間中で試しただけですが、free trial が終われば、お金を払わないと利用できなくなると思われます。

よかった点

  • SSL証明書を用意しなくてもSSLでアクセスできます。
  • PageKiteが謳っている通り、ローカル環境でも簡単にアクセスできます。

その他

PageKite自体は、MOONGIFTさんでも紹介されていますね。
オープンソースで実現。オンラインからローカルコンピュータにつなぐ「Pagekite」

5
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4