<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>forever 5 years old blog &#187; OpenSocial</title>
	<atom:link href="http://www.f5yo.net/archives/tag/opensocial/feed" rel="self" type="application/rss+xml" />
	<link>http://www.f5yo.net</link>
	<description>今年も 5 歳になりました</description>
	<lastBuildDate>Wed, 29 Apr 2009 01:32:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP 版の Apache Shindig を試してみる</title>
		<link>http://www.f5yo.net/archives/147</link>
		<comments>http://www.f5yo.net/archives/147#comments</comments>
		<pubDate>Tue, 14 Apr 2009 14:11:39 +0000</pubDate>
		<dc:creator>ihara</dc:creator>
				<category><![CDATA[いろいろ]]></category>
		<category><![CDATA[OpenSocial]]></category>
		<category><![CDATA[Shindig]]></category>

		<guid isPermaLink="false">http://www.f5yo.net/?p=147</guid>
		<description><![CDATA[前もやったことある気がしますが、OpenSocial の RESTful API のサポートが追加されている？みたいなのでまたやってみます。
手元の MacBook にとりあえず apache と php をインストー [...]]]></description>
			<content:encoded><![CDATA[<p>前もやったことある気がしますが、OpenSocial の RESTful API のサポートが追加されている？みたいなのでまたやってみます。</p>
<p>手元の MacBook にとりあえず apache と php をインストール。以下 zsh で auto_cd しています。</p>


<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">[Masahiro@masahiro.local:~] sudo port -d install php5 +apache2 +pear</pre></div></div>




<p>apache の設定。VirtualHost の設定ファイルを読むようにして、PHP を有効に。<p>


<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">[Masahiro@masahiro.local:~] $ /opt/local/apache2/conf
[Masahiro@masahiro.local:/opt/local/apache2/conf] $ sudo cp httpd.conf httpd.conf.bak
[Masahiro@masahiro.local:/opt/local/apache2/conf] $ sudo vi httpd.conf
[Masahiro@masahiro.local:/opt/local/apache2/conf] $ diff -u httpd.conf.bak httpd.conf
--- httpd.conf.bak      2009-04-14 22:30:16.000000000 +0900
+++ httpd.conf  2009-04-14 22:38:59.000000000 +0900
@@ -157,7 +157,7 @@
 #
 # If your host doesn't have a registered DNS name, enter its IP address here.
 #
-#ServerName www.example.com:80
+ServerName localhost:80
&nbsp;
 #
 # DocumentRoot: The directory out of which you will serve your
@@ -470,7 +470,7 @@
 #Include conf/extra/httpd-info.conf
&nbsp;
 # Virtual hosts
-#Include conf/extra/httpd-vhosts.conf
+Include conf/extra/httpd-vhosts.conf
&nbsp;
 # Local access to the Apache HTTP Server Manual
 #Include conf/extra/httpd-manual.conf
@@ -492,3 +492,7 @@
 SSLRandomSeed startup builtin
 SSLRandomSeed connect builtin
 &lt;/IfModule&gt;
+
+# PHP
+LoadModule php5_module modules/libphp5.so
+Include conf/extras-conf/mod_php.conf</pre></div></div>




<p>VirtualHost の設定。</p>


<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">[Masahiro@masahiro.local:/opt/local/apache2/conf] $ extra
[Masahiro@masahiro.local:/opt/local/apache2/conf/extra] $ sudo cp httpd-vhosts.conf httpd-vhosts.conf.bak
[Masahiro@masahiro.local:/opt/local/apache2/conf/extra] $ sudo vi httpd-vhosts.conf</pre></div></div>




<p>以下の感じに編集しておきます。</p>


<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">Listen 8080
&nbsp;
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any &lt;VirtualHost&gt; block.
#
&lt;VirtualHost 127.0.0.1:8080&gt;
    ServerName shindig.localhost
        DocumentRoot /opt/local/apache2/htdocs/shindig/php
&lt;/VirtualHost&gt;
&nbsp;
&lt;Directory /opt/local/apache2/htdocs/shindig/php&gt;
    AllowOverride All
&lt;/Directory&gt;</pre></div></div>




<p>ホスト名を shindig.localhost でアクセスするつもりなので、/etc/hosts に以下を追加しておきます。</p>


<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">127.0.0.1 shindig.localhost</pre></div></div>




<p>PHP の設定。.html でも動くように。</p>


<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">[Masahiro@masahiro.local:/opt/local/apache2/conf/extra] $ ..
[Masahiro@masahiro.local:/opt/local/apache2/conf] $ extras-conf
[Masahiro@masahiro.local:/opt/local/apache2/conf/extras-conf] $ sudo cp mod_php.conf mod_php.conf.bak
[Masahiro@masahiro.local:/opt/local/apache2/conf/extras-conf] $ sudo vi mod_php.conf
[Masahiro@masahiro.local:/opt/local/apache2/conf/extras-conf] $ diff -u mod_php.conf.bak mod_php.conf
--- mod_php.conf.bak    2009-04-14 23:00:12.000000000 +0900
+++ mod_php.conf        2009-04-14 23:00:39.000000000 +0900
@@ -1,6 +1,6 @@
 &lt;IfModule mod_php5.c&gt;
&nbsp;
-AddType  application/x-httpd-php         .php
+AddType  application/x-httpd-php         .html .php
 AddType  application/x-httpd-php-source  .phps
&nbsp;
 &lt;/IfModule&gt;</pre></div></div>




<p>さて Shindig のインストール。<a href="http://incubator.apache.org/shindig/developers/php/build.html">Shindig &#8211; Building and running Shindig for PHP</a> の通りにやります。</p>


<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">[Masahiro@masahiro.local:/opt/local/apache2/conf/extras-conf] $ /opt/local/apache2/htdocs
[Masahiro@masahiro.local:/opt/local/apache2/htdocs] $ sudo mkdir shindig
[Masahiro@masahiro.local:/opt/local/apache2/htdocs] $ shindig
[Masahiro@masahiro.local:/opt/local/apache2/htdocs/shindig] $ sudo svn co http://svn.apache.org/repos/asf/incubator/shindig/trunk/ .</pre></div></div>




<p>上記のページにある通り、http://shindig.localhost:8080/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml にアクセスしてみる。</p>


<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">Not Found
&nbsp;
The requested URL /gadgets/ifr was not</pre></div></div>




<p>なんつって怒られるときは shindig/php/.htaccess が効いていなそうなので、apache の設定の AllowOverride を確認します。</p>

<p>で、再度 http://shindig.localhost:8080/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml を見てみると、それっぽいモジュールが表示されるはず。</p>

<p>ここまではまだまだ準備段階。フー</p>]]></content:encoded>
			<wfw:commentRss>http://www.f5yo.net/archives/147/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
