<?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>Giordano Scalzo&#039;s Personal Blog &#187; sinatra</title>
	<atom:link href="http://giordano.scalzo.biz/tag/sinatra/feed/" rel="self" type="application/rss+xml" />
	<link>http://giordano.scalzo.biz</link>
	<description>Just another useless weblog</description>
	<lastBuildDate>Mon, 09 May 2011 09:50:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Installing Sinatra on Site5</title>
		<link>http://giordano.scalzo.biz/2009/09/24/installing-sinatra-on-site5/</link>
		<comments>http://giordano.scalzo.biz/2009/09/24/installing-sinatra-on-site5/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 09:28:05 +0000</pubDate>
		<dc:creator>giordano scalzo</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[sinatra]]></category>
		<category><![CDATA[site5]]></category>

		<guid isPermaLink="false">http://giordano.scalzo.biz/?p=127</guid>
		<description><![CDATA[I think Rails is a wonderful framework that boosts the success of Ruby, but sometimes is a a little overkill. Enter Sinatra, a microframework in Ruby, aims to create simple web applications. As mentioned in a previous post, I own a shared access on a Site5, so I began to search any documentation to install [...]]]></description>
			<content:encoded><![CDATA[<p>I think Rails is a wonderful framework that boosts the success of Ruby, but sometimes is a a little overkill.<br />
Enter <a href="http://www.sinatrarb.com/">Sinatra</a>, a microframework in Ruby, aims to  create simple web applications.</p>
<p>As mentioned in a previous post, I own a shared access on a Site5, so I began to search any documentation to install a simple Sinatra  app on Site5.<br />
I didn&#8217;t find a lot of documentation, but a <a href="http://ostblog.sroegner.org/?p=99">post</a> gave some hints in the right direction.</p>
<p>First of all, it need to install locally Sinatra gem configuring <code>GEM_PATH</code> and <code>GEM_HOME</code>.<br />
Then we need to create a subdomain, i.e. <code>sinatra.scalzo.biz</code>, where we&#8217;ll implement Sinatra&#8217;s app. For an unknown reason, I&#8217;d to configure a subdirectory as document root:</p>
<p><img src="http://giordano.scalzo.biz/wp-content/uploads/2009/09/domain_config.png" alt="Domain Configuration" title="Domain Configuration" width="519" height="191" class="aligncenter size-full wp-image-133" /></p>
<p>The htaccess directory contains the file <code>.htaccess</code> that enables <a href="http://www.modrails.com/">Phusion Passenger</a>:</p>
<pre class='brush: bash'>
PassengerEnabled on
RackBaseURI /
</pre>
<p>In parent directory we write the <a href="http://www.modrails.com/">Phusion Passenger</a> configuration,  <code>config.ru</code>:</p>
<pre class='brush: ruby'>
ENV['GEM_PATH'] = "/home/USER/gems:/usr/lib/ruby/gems/1.8"
ENV['GEM_HOME'] = "/home/USER/gems"
require 'rubygems'
require 'sinatra'

require 'app'
run Sinatra.application
</pre>
<p>and  our Sinatra application (I call it <code>app</code>):</p>
<pre class='brush: ruby'>
get '/' do
  "Hello World!"
end
get '/hi' do
  "Hi World!"
end
</pre>
<p>That&#8217;s it!<br />
Now we can call the urls &#8216;<code>http://sinatra.scalzo.biz/</code>&#8216; and &#8216;<code>http://sinatra.scalzo.biz/hi</code>&#8216;.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/ruby' rel='tag' target='_self'>ruby</a>, <a class='technorati-link' href='http://technorati.com/tag/sinatra' rel='tag' target='_self'>sinatra</a>, <a class='technorati-link' href='http://technorati.com/tag/site5' rel='tag' target='_self'>site5</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://giordano.scalzo.biz/2009/09/24/installing-sinatra-on-site5/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

