PCに関する雑多な記録

PCに関する諸々の備忘録に変身。

ubuntu server で OpenSocial環境を作る その2 SNS partuzaを動かす

2011年06月14日 | ubuntu

shindigはそれ自身では、Gatewayでしかないので、それを登録するSNSがあった方がいいです。

ということで、PHPで動くFreeなSNSPartuzaを使うことにします。

http://code.google.com/p/partuza/

にpartuzaの説明があります。shindigのテストの為のSNSみたいな位置づけなようです。

http://tech.feedforce.jp/shindig-partuza-opensocial-2.html
にインストールの手順等があるのですが、1.0.0になってディレクトリ構成などがちょっと変わったので、その辺りも含めてメモしておきます。

http://code.google.com/p/partuza/downloads/list

からpartuza-1.0.0.tar.gz をダウンロードして、

/var/opensocial で展開します。

/var/opensoicla/partuza/

に展開されるので、shindig同様にVirutualHostの設定を行います。

 



<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName test-partuza
DocumentRoot /var/opensocial/partuza/html
<Directory /var/opensocial/partuza/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/partuza-error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/partuza-access.log combined
</VirtualHost>


 

な感じにします。

 partuzaはSNSなので、DBが必要です。MySQLがインストールされているはずなので、

/var/opensocial/partuza

に移動して、

$ mysqladmin -u root create partuza
$ mysql -u root -D partuza < partuza.sql<br />※手抜きでRootのパスワードを設定していません。パスワードを設定しているときは-pオプションを忘れずに。

これでDBが構築されます。

CentOSではopentagの設定が必要ですがubuntuはすでに設定されているので、
short_open_tag = On
の変更は不要です。

また、画像データを保存するディレクトリがであるのですが、パーミションの設定変更が必要です。

$ chmod 777 /var/opensocial/partuza/html/images/people

してください。

Shindig側にPartuzaの登録が必要です。

/var/opensocial/shindig/config/local.php を作成します。

中身は /var/opensocial/partuza/Shindig/README, http://code.google.com/p/partuza/w/list 辺りを参考にしてください。今回は以下の通りにしてみます。

 


<?php

$shindigConfig = array(
        'person_service' => 'PartuzaService',
        'activity_service' => 'PartuzaService',
        'app_data_service' => 'PartuzaService',
        'extension_class_paths' => '/var/opensocial/partuza/Shindig'

 

);


 

最後に、PartuzaにShindigサーバーの設定をします。

/var/opensocial/partuza/html/config.php

このファイルに、gadget_server=という行があるので、これを

'gadget_server' => 'http://test-shindig',

とします。

これで動くはずです。

 


ubuntu server で OpenSocial環境を作る その1 Apache Shindigを動かす

2011年06月14日 | ubuntu

Amazon EC2 上での ubuntu serverがやたら快適(起動が数十秒!)なので、ubuntu server上にOpenSocialが動く環境を作ってみたログ。

1. ubuntu-serverのインストール
 そのままだと何も入っていないので、LAMPとSSHは最低限入れておく。
 今回はPHPで動かすので
apt-get install php5 php5-curl php5-gd
はしておく。

2. Shindigのセットアップ
 OpenSocialの要,Apache Shindigのダウンロードとinstall。
Shindigのインストールは下記に詳しくあります。
http://tech.feedforce.jp/shindig-partuza-opensocial-1.html
でubuntuの場合VirtualHostの設定箇所とかが違うのでメモ
/etc/apache2/sites-enabled/000-default
なるファイルがあって、これがデフォルト設定。
 これは、そのままにしておいて、OpenSocial関連は別ディレクトリにインストールする予定なので、
/etc/apache2/sites-enabled/001-opensocial
なんてファイルをこしらえます。

 


<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName test-shindig
DocumentRoot /var/opensocial/shindig
<Directory /var/opensocial/shindig/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

ErrorLog /var/log/apache2/shindig-error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/shindig-access.log combined

</VirtualHost *:80>

な感じのファイルを作成します。DocumentRoot, ServerName, Directoryタグが肝かと。

 次に、そのままだとmod_rewriteが使えないので、

/etc/apache2/mods-enabled/で

ln -s ../mods-available/rewrite.load .

を実行して、moduleを読み込むようにしておきます。


shindigは
http://shindig.apache.org/download/index.html
から1.0.1をダウンロードします。partuzaと連携するので、新しすぎてもダメかも。

ここ にリンクをはっておきました。

ダウンロードしたshidig-1.0.1-php-tar.gzを展開すると、

shindig-1.0.1-php というディレクトリが作られてその中に展開されているので、このディレクトリごと

/var/opensocial/shindig

という名前にしてしまいます。これで、shindigの設定は終わり。

http://test-shindig/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml

なんてやると、画面にTODOメモが表示されるようになります。

※test-shindig というマシン名はブラウザを起動するマシンのhostsに正しいIPとともに設定してください。設定はそれぞれのOS毎に異なるので、割愛。