<?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>70's Futurisitic Technology &#187; howto</title>
	<atom:link href="http://ozten.com/psto/tag/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://ozten.com/psto</link>
	<description>Programming focused drivel</description>
	<lastBuildDate>Wed, 09 Nov 2011 06:05:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to setup php-atompub-server</title>
		<link>http://ozten.com/psto/2009/01/25/6/</link>
		<comments>http://ozten.com/psto/2009/01/25/6/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 07:01:14 +0000</pubDate>
		<dc:creator>ozten</dc:creator>
				<category><![CDATA[research]]></category>
		<category><![CDATA[atompub]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://ozten.com/psto/?p=6</guid>
		<description><![CDATA[I am slowly hacking away at my identity faceting service and wanted to play with exposing facet history with atompub. I found Jeroen Hoekx&#8217;s php-atompub-server.
This post is how to setup an Atompub server using PHP5. This post assumes you are using (and are familiar with ) Apache2, PHP 5, and Linux. I will be doing [...]]]></description>
			<content:encoded><![CDATA[<p>I am slowly hacking away at my identity faceting service and wanted to play with exposing facet history with atompub. I found Jeroen Hoekx&#8217;s <a href="http://code.google.com/p/php-atompub-server/">php-atompub-server</a>.</p>
<p>This post is how to setup an Atompub server using PHP5. This post assumes you are using (and are familiar with ) Apache2, PHP 5, and Linux. I will be doing this on an Ubuntu VM which I&#8217;ve hardcoded into my /etc/hosts file as ofaceatom.ubuntu. I&#8217;ll walk you through what I did to get the test app up and running, but you might want to read  php atompub server&#8217;s wiki <a href="http://code.google.com/p/php-atompub-server/wiki/Overview">Overview</a> and then <a href="http://code.google.com/p/php-atompub-server/wiki/HTTPServer">HTTPServer</a> for more background.</p>
<p>Pick a place to install. I will refer to this as $DEV_PATH<br />
cd $DEV_PATH<br />
svn checkout http://php-atompub-server.googlecode.com/svn/trunk/ php-atompub-server-read-only</p>
<p>On your development machine, map an apache2 VirtualHost&#8217;s DocumentRoot to $DEV_PATH/php-atompub-server-read-only</p>
<p>Edit $DEV_PATH/php-atompub-server-read-only/app/start/start.php<br />
$base_uri = new URI(&#8220;http://ofaceatom.ubuntu/app&#8221;);</p>
<p>Create a .htaccess file in $DEV_PATH/php-atompub-server-read-only/app/<br />
RewriteEngine On</p>
<p>RewriteRule ^(.+) start.php</p>
<p>DirectoryIndex start.php</p>
<p>chmod go+w $DEV_PATH/php-atompub-server-read-only/app</p>
<p>The server will create &#8217;store&#8217;, &#8216;lists&#8217;, and &#8216;cache&#8217; directories under the app directory, but mkdir will fail in appfilestore.php if apache doesn&#8217;t have permission to write here&#8230;</p>
<p>Make a request to http://ofaceatom.ubuntu/tools/ an ensure that you get a directory list of<br />
data1.xml<br />
manager<br />
postatom.html</p>
<p>If you point your browser to http://ofaceatom.ubuntu/app/ you will see the output<br />
&lt;service&gt;<br />
−<br />
&lt;workspace&gt;<br />
&lt;atom:title&gt;PHP AtomPub Server&lt;/atom:title&gt;<br />
−<br />
&lt;collection href=&#8221;test/&#8221;&gt;<br />
&lt;atom:title&gt;AtomPub Test: Test&lt;/atom:title&gt;<br />
&lt;accept&gt;*/*&lt;/accept&gt;<br />
&lt;/collection&gt;<br />
−<br />
&lt;collection href=&#8221;news/&#8221;&gt;<br />
&lt;atom:title&gt;AtomPub Test: News&lt;/atom:title&gt;<br />
&lt;/collection&gt;<br />
−<br />
&lt;collection href=&#8221;media/&#8221;&gt;<br />
&lt;atom:title&gt;AtomPub Test: Media&lt;/atom:title&gt;<br />
&lt;accept&gt;*/*&lt;/accept&gt;<br />
&lt;/collection&gt;<br />
&lt;/workspace&gt;<br />
&lt;/service&gt;</p>
<p>or it may ask you to save a file, depending on your setup. (the mime-type is application/atomsvc+xml)</p>
<p><strong>Test Page</strong></p>
<p>http://ofaceatom.ubuntu/tools/postatom.html</p>
<p>is an HTML based Atom client which you can use to test the server.<br />
Change the URI feild to your hostname. For me that&#8217;s</p>
<p>http://ofaceatom.ubuntu/app/</p>
<p>Click Submit and you will see<br />
STATUS: 200 Ok</p>
<p>Date: Sat, 24 Jan 2009 02:46:00 GMT<br />
Server: Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.3 with Suhosin-Patch<br />
X-Powered-By: PHP/5.2.4-2ubuntu5.3<br />
Cache-Control: must-revalidate<br />
Etag: &#8220;21a609367f0b4ee98bba15771419be4d;gzip&#8221;<br />
Content-Encoding: gzip<br />
Vary: Content-Encoding<br />
Content-Length: 254<br />
Content-Type: application/atomsvc+xml</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />
&lt;service xmlns=&#8221;http://www.w3.org/2007/app&#8221;<br />
xmlns:atom=&#8221;http://www.w3.org/2005/Atom&#8221;<br />
&gt;<br />
&lt;workspace&gt;<br />
&lt;atom:title&gt;PHP AtomPub Server&lt;/atom:title&gt;</p>
<p>&lt;collection href=&#8221;test/&#8221;&gt;<br />
&lt;atom:title&gt;AtomPub Test: Test&lt;/atom:title&gt;<br />
&lt;accept&gt;*/*&lt;/accept&gt;<br />
&lt;/collection&gt;</p>
<p>&lt;collection href=&#8221;news/&#8221;&gt;<br />
&lt;atom:title&gt;AtomPub Test: News&lt;/atom:title&gt;<br />
&lt;/collection&gt;</p>
<p>&lt;collection href=&#8221;media/&#8221;&gt;<br />
&lt;atom:title&gt;AtomPub Test: Media&lt;/atom:title&gt;<br />
&lt;accept&gt;*/*&lt;/accept&gt;<br />
&lt;/collection&gt;<br />
&lt;/workspace&gt;<br />
&lt;/service&gt;</p>
<p>Clicking the Clean button will clear the output.</p>
<p>Notice that there is a &#8220;test&#8221; collection&#8230; lets look at it.<br />
Change the URI input to http://ofaceatom.ubuntu/app/test/<br />
And press Submit</p>
<p>We see an empty Atom feed.<br />
We&#8217;ve been using the GET  method, let&#8217;s create an item.</p>
<p>Change the METHOD input to POST and click submit.</p>
<p>STATUS: 201 Created</p>
<p>You&#8217;ll need to have a unique SLUG value for each post on the test collection.<br />
The item lives at http://ofaceatom.ubuntu/app/test/test.atomentry<br />
Using PUT on this url, you can change the contents of that item.</p>
<p>Now you can go back to the atom feed at</p>
<p>http://ofaceatom.ubuntu/app/test/</p>
<p>And your item is in the list. Once you create more than 10 items, this feed is paginated.</p>
<p>You can now play around with news and media collections just like test. Note that news requires the <a href="http://htmlpurifier.org/">http://htmlpurifier.org/</a> library to be installed as noted on the wiki at  <a href="http://code.google.com/p/php-atompub-server/wiki/SanitizingInput">SanitizingInput.</a></p>
<p>If you get tired of changing the URI, you can  edit line 11 of $DEV_PATH/php-atompub-server-read-only/tools/postatom.html to change the prefilled value for the atom service<br />
document.getElementById(&#8220;uri&#8221;).value = &#8220;http://ofaceatom.ubuntu/app/&#8221;;</p>
<p>All in all a very cool project from Jeroen. To learn more and play with exposing your data via atompub, next steps are to do some hacking, and read <a href="http://code.google.com/p/php-atompub-server/wiki/HowItWorks">HowItWorks</a>,  <a href="http://code.google.com/p/php-atompub-server/wiki/ExtensionModel">ExtensionModel</a> and then <a href="http://code.google.com/p/php-atompub-server/wiki/phpBBStore">phpBBStore</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ozten.com/psto/2009/01/25/6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

