<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Enjoying Rails &#187; passenger</title>
	<atom:link href="http://blog.erichsen.net/tag/passenger/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.erichsen.net</link>
	<description>I really do...</description>
	<lastBuildDate>Sun, 08 May 2011 07:35:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.erichsen.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Enjoying Rails &#187; passenger</title>
		<link>http://blog.erichsen.net</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.erichsen.net/osd.xml" title="Enjoying Rails" />
	<atom:link rel='hub' href='http://blog.erichsen.net/?pushpress=hub'/>
		<item>
		<title>Automatic Rails on Ubuntu 8.04 LTS</title>
		<link>http://blog.erichsen.net/2008/10/16/automatic-rails-on-ubuntu-804-lts/</link>
		<comments>http://blog.erichsen.net/2008/10/16/automatic-rails-on-ubuntu-804-lts/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 20:32:11 +0000</pubDate>
		<dc:creator>enjoyingrails</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://enjoyingrails.wordpress.com/?p=17</guid>
		<description><![CDATA[A couple of weeks ago there was a post on the FiveRuns blog about automatically installing the Rails stack on an Ubuntu 8.04 VPS. I prefer to use Passenger and Ruby Enterprise Edition when running my Rails app, so inspired by the FiveRuns script I wrote my own version &#8211; here is the gist on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.erichsen.net&amp;blog=1936559&amp;post=17&amp;subd=enjoyingrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A couple of weeks ago there was a <a href="http://blog.fiveruns.com/2008/9/24/rails-automation-at-slicehost">post</a> on the FiveRuns blog about automatically installing the Rails stack on an Ubuntu 8.04 VPS.</p>
<p>I prefer to use Passenger and Ruby Enterprise Edition when running my Rails app, so inspired by the FiveRuns script I wrote my own version &#8211; here is the <a href="http://gist.github.com/16225">gist on github</a>.</p>
<p><code><br />
#!/bin/bash<br />
# Inspired by http://blog.fiveruns.com/2008/9/24/rails-automation-at-slicehost</p>
<p>apt-get update<br />
apt-get upgrade -y<br />
apt-get -y install build-essential libssl-dev libreadline5-dev zlib1g-dev<br />
apt-get -y install mysql-server libmysqlclient15-dev mysql-client<br />
apt-get -y install ruby ruby1.8-dev irb ri rdoc libopenssl-ruby1.8 </p>
<p>RUBYGEMS="rubygems-1.3.0"<br />
wget http://rubyforge.org/frs/download.php/43985/$RUBYGEMS.tgz<br />
tar xzf $RUBYGEMS.tgz<br />
cd $RUBYGEMS<br />
ruby setup.rb<br />
cd ..</p>
<p># Install Ruby Enterprise Edition<br />
wget http://rubyforge.org/frs/download.php/41040/ruby-enterprise-1.8.6-20080810.tar.gz<br />
tar xvzf ruby-enterprise-1.8.6-20080810.tar.gz<br />
yes '' | ./ruby-enterprise-1.8.6-20080810/installer</p>
<p># Install Passenger<br />
/usr/bin/gem1.8 install -v=2.0.3 passenger --no-rdoc --no-ri<br />
apt-get -y install apache2-mpm-prefork apache2-prefork-dev<br />
yes '' | passenger-install-apache2-module </p>
<p># Create sample Rails app<br />
/usr/bin/gem1.8 install rails --no-rdoc --no-ri<br />
cd /var/www<br />
rails -d mysql hello<br />
cd hello<br />
./script/generate controller welcome hello<br />
echo "Hello World" &gt; app/views/welcome/hello.html.erb<br />
rake db:create RAILS_ENV=production</p>
<p># Create the Apache2 Passenger module files<br />
cat &gt;&gt; /etc/apache2/mods-available/passenger.load &lt;&gt; /etc/apache2/mods-available/passenger.conf &lt;&lt;-EOF</p>
<p>  PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3<br />
  PassengerRuby /opt/ruby-enterprise-1.8.6-20080810/bin/ruby</p>
<p>EOF<br />
a2enmod passenger</p>
<p># Create a site file for the sample Rails app<br />
IP_ADDRESS=`ifconfig eth0 | sed -n 's/.*dr:\(.*\)  Bc.*/\1/p'`<br />
cat &gt;&gt; /etc/apache2/sites-available/hello &lt;&lt;-EOF</p>
<p>      ServerName www.yourhost.com<br />
      DocumentRoot /var/www/hello/public</p>
<p>EOF<br />
a2ensite hello</p>
<p># That's it!<br />
reboot<br />
</code></p>
<p>The script assumes that you have ssh access as root to a clean Ubuntu 8.04 install.</p>
<p>The script will install</p>
<ul>
<li>Ruby 1.8.6</li>
<li>RubyGems 1.3.0</li>
<li>Passenger 2.0.3</li>
<li>Ruby Enterprise Edition 20080810</li>
<li>Apache 2.2.8</li>
<li>MySQL 5.0.51a</li>
<li>A sample Rails app</li>
</ul>
<p>Note that the Passenger installer will install the latest Rails (2.1.1) and a bunch of other useful gems.</p>
<p>Assuming that your server IP address is 192.168.185.128 you can run it like this:<br />
<code><br />
ssh root@192.168.185.128 "wget -O - http://gist.github.com/raw/16225/a6a16b3a38cd3486679b96fa0f3446e58f3b8423 | sed -e s/$'\r'//g &gt; install.sh; /bin/bash install.sh; rm install.sh"<br />
</code><br />
Sit back and enjoy &#8211; in less than ten minutes you will have the full Rails stack and a sample Rails app running. Take a look at it on <a href="http://192.168.185.128/welcome/hello">http://192.168.185.128/welcome/hello</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/enjoyingrails.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/enjoyingrails.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/enjoyingrails.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/enjoyingrails.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/enjoyingrails.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/enjoyingrails.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/enjoyingrails.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/enjoyingrails.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/enjoyingrails.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/enjoyingrails.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/enjoyingrails.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/enjoyingrails.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/enjoyingrails.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/enjoyingrails.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.erichsen.net&amp;blog=1936559&amp;post=17&amp;subd=enjoyingrails&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.erichsen.net/2008/10/16/automatic-rails-on-ubuntu-804-lts/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2047f0076ea63c7d1a35373bac6f9841?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">enjoyingrails</media:title>
		</media:content>
	</item>
	</channel>
</rss>
