<?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>Sean&#039;s Blog &#187; rack</title>
	<atom:link href="http://seanbehan.com/tag/rack/feed/" rel="self" type="application/rss+xml" />
	<link>http://seanbehan.com</link>
	<description>Web Programming, Ruby on Rails, Wordpress, PHP from Burlington, Vermont</description>
	<lastBuildDate>Wed, 18 Jan 2012 21:44:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Hello Rack</title>
		<link>http://seanbehan.com/ruby/hello-rack/</link>
		<comments>http://seanbehan.com/ruby/hello-rack/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 03:21:25 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[getting started]]></category>
		<category><![CDATA[rack]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=716</guid>
		<description><![CDATA[What is Rack? Rack provides a minimal, modular and adaptable interface for developing web applications in Ruby. By wrapping HTTP requests and responses in the simplest way possible, it unifies and distills the API for web servers, web frameworks, and software in between (the so-called middleware) into a single method call. - Rack API Docs [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fruby%2Fhello-rack%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Hello Rack" data-url="http://seanbehan.com/ruby/hello-rack/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>What is Rack?</p>
<blockquote><p>
Rack provides a minimal, modular and adaptable interface for developing web applications in Ruby. By wrapping HTTP requests and responses in the simplest way possible, it unifies and distills the API for web servers, web frameworks, and software in between (the so-called middleware) into a single method call.
</p></blockquote>
<p><a href="http://rack.rubyforge.org/doc">- Rack API Docs</a><br />
<br/><br />
Create and name your file config.ru If rack isn&#8217;t installed get it with this command</p>
<pre class="wp-code-highlight prettyprint">gem install rack</pre>
<p>In your config.ru file</p>
<pre class="wp-code-highlight prettyprint">
require 'rubygems'
require 'rack'

class HelloRack
  def call(env)
    [200, {&quot;Content-Type&quot; =&gt; &quot;text/html&quot;}, &quot;Hello Rack!&quot;]
  end
end

Rack::Handler::Mongrel.run HelloRack.new, :Port =&gt; 8888
</pre>
<p>Check out <a href="http://m.onkey.org/2008/11/17/ruby-on-rack-1">http://m.onkey.org/2008/11/17/ruby-on-rack-1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/ruby/hello-rack/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Deploy Sintra App on Ubuntu Using Apache2 and Phusion Passenger Module</title>
		<link>http://seanbehan.com/sinatra/deploy-sintra-app-on-ubuntu-using-apache2-and-phusion-passenger-module/</link>
		<comments>http://seanbehan.com/sinatra/deploy-sintra-app-on-ubuntu-using-apache2-and-phusion-passenger-module/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 20:23:10 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Sinatra]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[phusion]]></category>
		<category><![CDATA[rack]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=504</guid>
		<description><![CDATA[Check it out http://sinatra.seanbehan.com/ This assumes Apache2 and the Phusion Passenger module have already been installed. If not you can get up to speed w/ this resource http://seanbehan.com/ruby-on-rails/new-ubuntu-slice-apache-mysql-php-ruby-on-rails-git-and/ First you need Sinatra, so install the gem gem install sinatra We need a home for Frank, so create the minimum number of directories in our web [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fsinatra%2Fdeploy-sintra-app-on-ubuntu-using-apache2-and-phusion-passenger-module%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Deploy Sintra App on Ubuntu Using Apache2 and Phusion Passenger Module" data-url="http://seanbehan.com/sinatra/deploy-sintra-app-on-ubuntu-using-apache2-and-phusion-passenger-module/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>Check it out http://sinatra.seanbehan.com/<br />
This assumes Apache2 and the Phusion Passenger module have already been installed. If not you can get up to speed w/ this resource http://seanbehan.com/ruby-on-rails/new-ubuntu-slice-apache-mysql-php-ruby-on-rails-git-and/</p>
<p>First you need Sinatra, so install the gem</p>
<pre class="wp-code-highlight prettyprint">
gem install sinatra
</pre>
<p>We need a home for Frank, so create the minimum number of directories in our web directory. The public directory is where we&#8217;ll server images, stylesheets, javascript etc. The tmp directory will be where we control Passenger.</p>
<pre class="wp-code-highlight prettyprint">
cd /var/www/sinatra
mkdir myapp
mkdir myapp/tmp
mkdir myapp/public

cd myapp
vim index.rb
#in index.rb
get '/' do
  &quot;Fly me to the moon...&quot;
end
</pre>
<p>Next we need a configuration file for Rack, important the file extension is &#8220;.ru&#8221; not .rb!</p>
<pre class="wp-code-highlight prettyprint">
vim config.ru
require 'rubygems'
require 'sinatra'

Sinatra::Application.default_options.merge!(
  :run =&gt; false,
  :env =&gt; ENV['RACK_ENV']
)

require 'index'
run Sinatra.application
</pre>
<p>Set up the virtual host</p>
<pre class="wp-code-highlight prettyprint">
&lt;virtualHost *&gt;
  ServerName www.myapp.com
  DocumentRoot /var/www/sinatra/public
&lt;/virtualHost&gt;
</pre>
<p>Now you can restart the app if you make adjustments!</p>
<pre class="wp-code-highlight prettyprint">
touch tmp/restart.txt
</pre>
<p>Keep on singing :)</p>
<p>Inspired by http://blog.zerosum.org/2008/7/4/passenger-3-sinatra</p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/sinatra/deploy-sintra-app-on-ubuntu-using-apache2-and-phusion-passenger-module/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

