<?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>Gilluminate &#187; WestHost</title>
	<atom:link href="http://www.gilluminate.com/tag/westhost/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gilluminate.com</link>
	<description></description>
	<lastBuildDate>Tue, 15 Jun 2010 02:50:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>WordPress pretty permalinks working on WestHost</title>
		<link>http://www.gilluminate.com/2008/03/19/wordpress-pretty-permalinks-working-on-westhost/</link>
		<comments>http://www.gilluminate.com/2008/03/19/wordpress-pretty-permalinks-working-on-westhost/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 03:58:40 +0000</pubDate>
		<dc:creator>Jason Gill</dc:creator>
				<category><![CDATA[Developer Blog]]></category>
		<category><![CDATA[WestHost]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.gilluminate.com/2008/03/19/wordpress-pretty-permalinks-working-on-westhost/</guid>
		<description><![CDATA[I had a hard time figuring out how to get the pretty url permalinks working for WordPress on WestHost, but I finally found the solution. It was weird at first because WordPress actually was writing to the .htaccess file correctly, but when I tried it out in a browser I was still getting 404&#8242;s. After [...]]]></description>
			<content:encoded><![CDATA[<p>I had a hard time figuring out how to get the pretty url permalinks working for <a href="http://wordpress.org/" title="WordPress">WordPress</a> on <a href="http://affiliates.westhost.com/z/14/CD1084/">WestHost</a>, but I finally found the solution. It was weird at first because WordPress actually was writing to the .htaccess file correctly, but when I tried it out in a browser I was still getting 404&#8242;s. After a long extensive search on the WordPress website, I finally found that I had to add the following to my httpd.conf file:</p>

<div class="wp_codebox"><table><tr id="p52692"><td class="code" id="p5269code2"><pre class="xml" style="font-family:monospace;">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Directory</span> /var/www/html/wordpress<span style="color: #000000; font-weight: bold;">&gt;</span></span>
        Options FollowSymLinks
        AllowOverride all
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Directory<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.gilluminate.com/2008/03/19/wordpress-pretty-permalinks-working-on-westhost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WestHost on Rails 2007 (for cheapskates)</title>
		<link>http://www.gilluminate.com/2007/07/24/westhost-on-rails-2007-for-cheapskates/</link>
		<comments>http://www.gilluminate.com/2007/07/24/westhost-on-rails-2007-for-cheapskates/#comments</comments>
		<pubDate>Tue, 24 Jul 2007 15:35:00 +0000</pubDate>
		<dc:creator>Jason Gill</dc:creator>
				<category><![CDATA[Developer Blog]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[WestHost]]></category>

		<guid isPermaLink="false">http://blog.gillumiante.com/2007/07/24/westhost-on-rails-2007-for-cheapskates</guid>
		<description><![CDATA[By Aaron Gustafson. Updated by Jason Gill While it is true that WestHost now offers Ruby on Rails, it&#8217;s only available on some of the packages and not all. If you are a cheapskate like me and want to add Ruby on Rails to the Personal Starter plan where RoR isn&#8217;t available, this tutorial is [...]]]></description>
			<content:encoded><![CDATA[<h3>By Aaron Gustafson. Updated by Jason Gill</h3>
<p>While it is true that <a href="http://affiliates.westhost.com/z/14/CD1084/">WestHost</a> now offers <a href="http://rubyonrails.org/">Ruby on Rails</a>, it&#8217;s only available on some of the packages and not all. If you are a cheapskate like me and want to add Ruby on Rails to the Personal Starter plan where RoR isn&#8217;t available, this tutorial is for you! This even works on packages that come with RoR for those of you who are unsatisfied with how limited WestHost&#8217;s install is. I&#8217;ve adapted <a href="http://www.easy-designs.net/articles/WesthostOnRails/">Aaron Gustafson&#8217;s tutorial</a> and updated it to be more relevant, more current, and (hopefully) more helpful for 2007.</p>
<p><strong>The Requisite Disclaimer:</strong> If you are on a different hosting company, I cannot guarantee this  tutorial will work for you (though it may be helpful in figuring out your issues). As always, before you make changes to critical files (http.conf, .bashrc, etc.),  do yourself a favor and make a backup copy; this tutorial offers  assistance, but no warranty, so if you mess something up during the  install, you&#8217;re on your own (but Westhost tech support should be helpful). Finally, this tutorial assumes some familiarity with the <em>Site Manager</em> from Westhost and some basic knowledge of the Linux shell. This tutorial uses <a href="http://en.wikipedia.org/wiki/Pico_(text_editor)">pico</a> as a text editor, but <a href="http://en.wikipedia.org/wiki/Vi">vi</a> is also an option and this tutorial assumes familiarity with inline text editors. I prefer <a href="http://en.wikipedia.org/wiki/Emacs">emacs</a>, but it&#8217;s not installed by default on WestHost servers.</p>
<p>Now  that I&#8217;ve had to muddle through it a few times, I decided that, for my  own sanity and to aid anyone else out there who may be going through  the same thing, I would put together a comprehensive tutorial on how to  install <a href="http://www.rubyonrails.com/">Ruby on Rails</a> at Westhost. The major problems that arise and could trip you up are</p>
<ol>
<li>Westhost now runs <a href="http://www.apache.org/">Apache 2.0</a></li>
<li><a href="http://www.fastcgi.com/">FastCGI</a> is not an option in some packages (and Rails will run incredibly slow without it), and</li>
<li>you cannot install applications in <em>/usr/bin</em>.</li>
</ol>
<p>This tutorial will get you up and running with a very simple Rails page on your Westhost VPS server using Apache 2.0 with FastCGI. For simplicity&#8217;s sake, I am going to set up the test Rails app on its own hostname (<em>demo.yoursitehere.com</em>).</p>
<h2>Required Site Applications</h2>
<p>Before we get started, log into your <em>Site Manager</em> (it can be found at <em>http://www.yoursitehere.com/manager</em>) and make sure the following are installed:</p>
<ul>
<li>MySQL 5.0.27 – because you&#8217;ll want a database</li>
<li>GNU Compiler Collection 1.0 – because we&#8217;ve got some compiling to do</li>
<li>Perl 5.8.8 – At present I can&#8217;t remember why, but I had problems without this installed.</li>
<li>FastCGI 2.4.0 (If available with your package).</li>
</ul>
<p>Now SSH into your site and we can get started.</p>
<h2>Step 1: Collect &amp; unpack</h2>
<p>First of all, make sure you are in your home directory</p>

<div class="wp_codebox"><table><tr id="p257447"><td class="code" id="p2574code47"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>your_username</pre></td></tr></table></div>

<p>or</p>

<div class="wp_codebox"><table><tr id="p257448"><td class="code" id="p2574code48"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~</pre></td></tr></table></div>

<p>and then we can start the downloading and unpacking. First we get Ruby (the latest is 1.8.6 as of this writing), unpack it, and remove the archive:</p>

<div class="wp_codebox"><table><tr id="p257449"><td class="code" id="p2574code49"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>rubyforge.org<span style="color: #000000; font-weight: bold;">/</span>frs<span style="color: #000000; font-weight: bold;">/</span>download.php<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">18421</span><span style="color: #000000; font-weight: bold;">/</span>ruby-1.8.6.tar.gz
<span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvzf</span> ruby-1.8.6.tar.gz
<span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> ruby-1.8.6.tar.gz</pre></td></tr></table></div>

<p>Next up is the latest Ruby Gem Manager (version 0.9.4 at present)</p>

<div class="wp_codebox"><table><tr id="p257450"><td class="code" id="p2574code50"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>rubyforge.org<span style="color: #000000; font-weight: bold;">/</span>frs<span style="color: #000000; font-weight: bold;">/</span>download.php<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">20989</span><span style="color: #000000; font-weight: bold;">/</span>rubygems-0.9.4.tgz
<span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvzf</span> rubygems-0.9.4.tgz
<span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> rubygems-0.9.4.tgz</pre></td></tr></table></div>

<p>then the latest FastCGI Developer&#8217;s Kit (version 2.4.0 at present)</p>

<div class="wp_codebox"><table><tr id="p257451"><td class="code" id="p2574code51"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.fastcgi.com<span style="color: #000000; font-weight: bold;">/</span>dist<span style="color: #000000; font-weight: bold;">/</span>fcgi-2.4.0.tar.gz
<span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvzf</span> fcgi-2.4.0.tar.gz
<span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> fcgi-2.4.0.tar.gz</pre></td></tr></table></div>

<p>and, finally, the FastCGI module for Apache (version 2.4.2 at present)</p>

<div class="wp_codebox"><table><tr id="p257452"><td class="code" id="p2574code52"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.fastcgi.com<span style="color: #000000; font-weight: bold;">/</span>dist<span style="color: #000000; font-weight: bold;">/</span>mod_fastcgi-2.4.2.tar.gz
<span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvzf</span> mod_fastcgi-2.4.2.tar.gz
<span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> mod_fascgi-2.4.2.tar.gz</pre></td></tr></table></div>

<h2>Step 2: Configure &amp; Install Ruby</h2>
<p>Starting in your home directory, get into the Ruby folder</p>

<div class="wp_codebox"><table><tr id="p257453"><td class="code" id="p2574code53"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">cd</span> ruby-1.8.6</pre></td></tr></table></div>

<p>We need to configure the source before we compile, letting it know that Ruby will be installed in <em>/usr/local/ruby</em> instead of <em>/usr/local</em>:</p>

<div class="wp_codebox"><table><tr id="p257454"><td class="code" id="p2574code54"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>ruby-1.8.6<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>ruby</pre></td></tr></table></div>

<p>Then go ahead and create the makefile and install Ruby.</p>

<div class="wp_codebox"><table><tr id="p257455"><td class="code" id="p2574code55"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>ruby-1.8.6<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp; <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div>

<p>If you get OpenSSL errors, you can compile without (assuming you don&#8217;t want to use ssl security):</p>

<div class="wp_codebox"><table><tr id="p257456"><td class="code" id="p2574code56"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>ruby-1.8.6<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>ruby <span style="color: #660033;">--without-openssl</span></pre></td></tr></table></div>


<div class="wp_codebox"><table><tr id="p257457"><td class="code" id="p2574code57"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>ruby-1.8.6<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp; <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div>

<p>As we will be working with Ruby from the command line, we need it as part of our PATH, which means editing our .bashrc file:</p>

<div class="wp_codebox"><table><tr id="p257458"><td class="code" id="p2574code58"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>ruby-1.8.6<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ pico <span style="color: #000000; font-weight: bold;">/</span>.bashrc</pre></td></tr></table></div>

<p>looking a few lines down from the top, you will see this line</p>

<div class="wp_codebox"><table><tr id="p257459"><td class="code" id="p2574code59"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$PATH</span>:/usr/local/apache/bin&quot;</span></pre></td></tr></table></div>

<p>Change it to read</p>

<div class="wp_codebox"><table><tr id="p257460"><td class="code" id="p2574code60"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$PATH</span>:/usr/local/apache/bin:/usr/local/ruby/bin&quot;</span></pre></td></tr></table></div>

<p>and  save as you exit. Make sure your current session is using the new  .bashrc file and then check your Ruby version (which will tell us if  Ruby is working):</p>

<div class="wp_codebox"><table><tr id="p257461"><td class="code" id="p2574code61"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>ruby-1.8.6<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">source</span> <span style="color: #000000; font-weight: bold;">/</span>.bashrc
<span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ ruby <span style="color: #660033;">-v</span>
ruby 1.8.6 <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">2007</span>-03-<span style="color: #000000;">13</span> patchlevel <span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>i686-linux<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></td></tr></table></div>

<h2>Step 3: Installing Ruby Gem Manager</h2>
<p>We  will be using the Ruby Gem Manager to install pretty much every other  Ruby or Rails component we need, so it is next on our list. First of  all, enter its folder</p>

<div class="wp_codebox"><table><tr id="p257462"><td class="code" id="p2574code62"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">cd</span> rubygems-0.9.4</pre></td></tr></table></div>

<p>and then install it using Ruby</p>

<div class="wp_codebox"><table><tr id="p257463"><td class="code" id="p2574code63"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>rubygems-0.9.4<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ ruby setup.rb</pre></td></tr></table></div>

<p>give gem a test run</p>

<div class="wp_codebox"><table><tr id="p257464"><td class="code" id="p2574code64"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>rubygems-0.9.4<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ gem list</pre></td></tr></table></div>

<p>We don&#8217;t have any gems installed yet (other than source), but that&#8217;s what we&#8217;re doing next.</p>
<h2>Step 4: Install Rails</h2>
<p>Now that we have the Gem Manager installed, the rest of the basic stuff is a snap. To install Rails, simply type the following</p>

<div class="wp_codebox"><table><tr id="p257465"><td class="code" id="p2574code65"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>rubygems-0.9.4<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ gem <span style="color: #c20cb9; font-weight: bold;">install</span> rails <span style="color: #660033;">--include-dependencies</span></pre></td></tr></table></div>

<p>If you get the error &#8220;Could not find rails (&gt; 0) in any repository&#8221; you just need to run the following command:</p>

<div class="wp_codebox"><table><tr id="p257466"><td class="code" id="p2574code66"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>rubygems-0.9.4<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>ruby<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ruby<span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>source_cache</pre></td></tr></table></div>

<p>now run</p>

<div class="wp_codebox"><table><tr id="p257467"><td class="code" id="p2574code67"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>rubygems-0.9.4<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ gem update</pre></td></tr></table></div>

<p>and run the gem install command again.</p>

<div class="wp_codebox"><table><tr id="p257468"><td class="code" id="p2574code68"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>rubygems-0.9.4<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ gem <span style="color: #c20cb9; font-weight: bold;">install</span> rails <span style="color: #660033;">--include-dependencies</span></pre></td></tr></table></div>

<p>This could take a little while, but should complete within a few minutes.</p>
<p>Now that we&#8217;ve done that, we can test our Rails install:</p>

<div class="wp_codebox"><table><tr id="p257469"><td class="code" id="p2574code69"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>rubygems-0.9.4<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www
<span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>www<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ rails demo
<span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>www<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">cd</span> demo
<span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>demo<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ ruby script<span style="color: #000000; font-weight: bold;">/</span>server</pre></td></tr></table></div>

<p>Open web browser to <em>http://www.yoursitehere.com:3000/</em> and look what you did. Congratulations, you&#8217;ve put Ruby on Rails!</p>
<h2>Step 5: Getting FastCGI up on Apache 2.0</h2>
<p><em>(If  you have a hosting package from WestHost with FastCGI, you can just  install it using the manager and skip step 5 altogether. Then again, if  you have that package, you can probably install Rails from there also  and you aren&#8217;t in need of this tutorial in the first place.)</em></p>
<p>OK,  all of that stuff was pretty easy, but know things get just a little  more complex. Be  warned that it gets very tedious from here on in.</p>
<p>First off, return to your home directory:</p>

<div class="wp_codebox"><table><tr id="p257470"><td class="code" id="p2574code70"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>demo<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~</pre></td></tr></table></div>

<p>We need to install the FastCGI Dev Kit. To do that, enter its directory, configure and install it similarly to how we did Ruby:</p>

<div class="wp_codebox"><table><tr id="p257471"><td class="code" id="p2574code71"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">cd</span> fcgi-2.4.0
<span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>fcgi-2.4.0<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>fcgi
<span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>fcgi-2.4.0<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000; font-weight: bold;">&amp;</span>amp; <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div>

<p>Next on the agenda is getting Apache2 to understand FastCGI. To do this, we need to compile and install the DSO for Apache, which uses a slightly different process:</p>

<div class="wp_codebox"><table><tr id="p257472"><td class="code" id="p2574code72"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>fcgi-2.4.0<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">cd</span> ..<span style="color: #000000; font-weight: bold;">/</span>mod_fastcgi-2.4.2
<span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>mod_fastcgi-2.4.2<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">cp</span> Makefile.AP2 Makefile
<span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>mod_fastcgi-2.4.2<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #007800;">top_dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>httpd
<span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>mod_fastcgi-2.4.2<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #007800;">top_dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>httpd</pre></td></tr></table></div>

<p>That put FastCGI in Apache&#8217;s modules directory, but not in the config file, so we&#8217;ll need to edit it.</p>

<div class="wp_codebox"><table><tr id="p257473"><td class="code" id="p2574code73"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>mod_fastcgi-2.4.2<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ pico <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>httpd.conf</pre></td></tr></table></div>

<p>We need add the following in the list of already present modules</p>

<div class="wp_codebox"><table><tr id="p257474"><td class="code" id="p2574code74"><pre class="bash" style="font-family:monospace;">LoadModule fastcgi_module   modules<span style="color: #000000; font-weight: bold;">/</span>mod_fastcgi.so</pre></td></tr></table></div>

<p>Finally, create an instance of our demo app near the bottom of the httpd.conf file:</p>

<div class="wp_codebox"><table><tr id="p257475"><td class="code" id="p2574code75"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># FastCGI</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>IfModule mod_fastcgi.c<span style="color: #000000; font-weight: bold;">&gt;</span>
FastCgiIpcDir <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>fcgi_ipc
FastCgiServer <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>demo<span style="color: #000000; font-weight: bold;">/</span>public<span style="color: #000000; font-weight: bold;">/</span>dispatch.fcgi <span style="color: #660033;">-processes</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-idle-timeout</span> <span style="color: #000000;">60</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>IfModule<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span>VirtualHost <span style="color: #000000; font-weight: bold;">*&gt;</span></pre></td></tr></table></div>

<p><strong>Processes:</strong> Why only one process? Well, 1 is usually enough for most applications. If you are getting <em>really heavy</em> traffic, you could bump it up to 2, but FastCGI can be a bit resource hungry. It is even worse if you run multiple FastCGI servers on a single box. For instance, according to a tech at WestHost,  4 server instances running a large number of processes (say 15) each  will frequently cause over 400MB of RAM and 1GB of swap to be used on the server, resulting in the cyclic behavior of freeing and reallocating memory. This is <em>very</em> resource intensive and it causes the server&#8217;s load to spike, which is problematic for any other users on the same server (in a VPS situation).</p>
<h2>Step 6: Configuration</h2>
<p>Go into <em>Domain Management</em>, set up a new Sub Domain Name: for your domain using the following values:</p>
<ul>
<li>Sub Domain Name:: <em>demo</em></li>
<li>Root directory for the new sub domain will be: <em>/var/www/demo</em></li>
</ul>
<p>Now configure your virtual host so that</p>

<div class="wp_codebox"><table><tr id="p257476"><td class="code" id="p2574code76"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>VirtualHost <span style="color: #000000; font-weight: bold;">*&gt;</span>
ServerName demo.mysite.com
ServerAlias www.demo.mysite.com
DocumentRoot <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>demo<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>VirtualHost<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>becomes</p>

<div class="wp_codebox"><table><tr id="p257477"><td class="code" id="p2574code77"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>VirtualHost <span style="color: #000000; font-weight: bold;">*&gt;</span>
ServerName demo.mysite.com
ServerAlias www.demo.mysite.com
DocumentRoot <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>demo<span style="color: #000000; font-weight: bold;">/</span>public<span style="color: #000000; font-weight: bold;">/</span>
ErrorLog <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>demo<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>server.log
<span style="color: #000000; font-weight: bold;">&lt;</span>Directory <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>demo<span style="color: #000000; font-weight: bold;">/</span>public<span style="color: #000000; font-weight: bold;">/&gt;</span>
Options ExecCGI FollowSymLinks
AllowOverride all
Allow from all
Order allow,deny
<span style="color: #000000; font-weight: bold;">&lt;/</span>Directory<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>VirtualHost<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>Save the file as you exit and then test it to make sure you didn&#8217;t screw anything up before restarting Apache:</p>

<div class="wp_codebox"><table><tr id="p257478"><td class="code" id="p2574code78"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>mod_fastcgi-2.4.2<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ apachectl configtest
Syntax OK
<span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>mod_fastcgi-2.4.2<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ apachectl restart</pre></td></tr></table></div>

<p>Hang in there, we&#8217;re almost done. To set up Rails to use FastCGI, we need to edit the .htaccess file in your public folder:</p>

<div class="wp_codebox"><table><tr id="p257479"><td class="code" id="p2574code79"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>mod_fastcgi-2.4.2<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ pico <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>demo<span style="color: #000000; font-weight: bold;">/</span>public<span style="color: #000000; font-weight: bold;">/</span>.htaccess</pre></td></tr></table></div>

<p>In that file, change</p>

<div class="wp_codebox"><table><tr id="p257480"><td class="code" id="p2574code80"><pre class="bash" style="font-family:monospace;">RewriteRule ^<span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>$ dispatch.cgi <span style="color: #7a0874; font-weight: bold;">&#91;</span>QSA,L<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></td></tr></table></div>

<p>to read</p>

<div class="wp_codebox"><table><tr id="p257481"><td class="code" id="p2574code81"><pre class="bash" style="font-family:monospace;">RewriteRule ^<span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>$ <span style="color: #000000; font-weight: bold;">&lt;</span>strong<span style="color: #000000; font-weight: bold;">&gt;</span>dispatch.fcgi<span style="color: #000000; font-weight: bold;">&lt;/</span>strong<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>QSA,L<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></td></tr></table></div>

<p>Then save when you exit.</p>
<p>Finally, we need to set up the Ruby-FastCGI Gem</p>

<div class="wp_codebox"><table><tr id="p257482"><td class="code" id="p2574code82"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>mod_fastcgi-2.4.2<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ gem <span style="color: #c20cb9; font-weight: bold;">install</span> fcgi <span style="color: #660033;">--with-fcgi-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>fcgi</pre></td></tr></table></div>

<h2>Step 7: Let&#8217;s get rolling</h2>
<p>Finally  we are in a position to test our install. To do so, we&#8217;ll add a simple  controller to our demo Rails install. We start by moving into the demo  folder</p>

<div class="wp_codebox"><table><tr id="p257483"><td class="code" id="p2574code83"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>mod_fastcgi-2.4.2<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>demo</pre></td></tr></table></div>

<p>and then we use the Generator to make us a controller:</p>

<div class="wp_codebox"><table><tr id="p257484"><td class="code" id="p2574code84"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>demo<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ ruby script<span style="color: #000000; font-weight: bold;">/</span>generate controller Say</pre></td></tr></table></div>

<p>That doesn&#8217;t do a whole lot since we have no actions. Let&#8217;s define an empty one:</p>

<div class="wp_codebox"><table><tr id="p257485"><td class="code" id="p2574code85"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>demo<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ pico app<span style="color: #000000; font-weight: bold;">/</span>controllers<span style="color: #000000; font-weight: bold;">/</span>say_controller.rb</pre></td></tr></table></div>

<p>Edit the file to read</p>

<div class="wp_codebox"><table><tr id="p257486"><td class="code" id="p2574code86"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> SayController <span style="color:#006600; font-weight:bold;">&lt;</span> ApplicationController
<span style="color:#9966CC; font-weight:bold;">def</span> hello
<span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>and save as you exit.</p>
<p>Now that&#8217;s all well and good, but we get an error if we try to surf to <em>http://demo.yoursitehere.com/say/hello</em> because there is no view associated with it. That&#8217;s easy enough to remedy, we&#8217;ll create one.</p>

<div class="wp_codebox"><table><tr id="p257487"><td class="code" id="p2574code87"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>demo<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ pico app<span style="color: #000000; font-weight: bold;">/</span>views<span style="color: #000000; font-weight: bold;">/</span>say<span style="color: #000000; font-weight: bold;">/</span>hello.rhtml</pre></td></tr></table></div>

<p>Type out something simple, such as</p>

<div class="wp_codebox"><table><tr id="p257488"><td class="code" id="p2574code88"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Hello World<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Hello from Rails!<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>The current time is <span style="color: #009900;">&lt;%= Time.now %<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>and then revisit <em>http://demo.yoursitehere.com/say/hello</em>. Now you&#8217;re rolling. Good luck and enjoy.</p>
<h2>Step 8 : What? You want MySQL?</h2>
<p>Okay,  so you want to hook up Rails to your MySQL database now. To do this,  there&#8217;s a few hoops you need to jump though. First of all, you&#8217;ll need  to edit your database configuration file.</p>

<div class="wp_codebox"><table><tr id="p257489"><td class="code" id="p2574code89"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>yourusername<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>demo<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ pico config<span style="color: #000000; font-weight: bold;">/</span>database.yml</pre></td></tr></table></div>

<p>Fill  in your database names for the development, test and production  environments and the username and password for each. Then add the  socket path:</p>

<div class="wp_codebox"><table><tr id="p257490"><td class="code" id="p2574code90"><pre class="ruby" style="font-family:monospace;">development:
&nbsp;
adapter: mysql
socket: <span style="color:#006600; font-weight:bold;">/</span>var<span style="color:#006600; font-weight:bold;">/</span>lib<span style="color:#006600; font-weight:bold;">/</span>mysql<span style="color:#006600; font-weight:bold;">/</span>mysql.<span style="color:#9900CC;">sock</span>
database: your_development_db
host: localhost
username: root
password: your_password
&nbsp;
<span style="color:#008000; font-style:italic;"># Warning: The database defined as 'test' will be erased and</span>
<span style="color:#008000; font-style:italic;"># re-generated from your development database when you run 'rake'.</span>
<span style="color:#008000; font-style:italic;"># Do not set this db to the same as development or production.</span>
&nbsp;
test:
&nbsp;
adapter: mysql
socket: <span style="color:#006600; font-weight:bold;">/</span>var<span style="color:#006600; font-weight:bold;">/</span>lib<span style="color:#006600; font-weight:bold;">/</span>mysql<span style="color:#006600; font-weight:bold;">/</span>mysql.<span style="color:#9900CC;">sock</span>
database: your_test_db
host: localhost
username: root
password: your_password
&nbsp;
production:
&nbsp;
adapter: mysql
socket: <span style="color:#006600; font-weight:bold;">/</span>var<span style="color:#006600; font-weight:bold;">/</span>lib<span style="color:#006600; font-weight:bold;">/</span>mysql<span style="color:#006600; font-weight:bold;">/</span>mysql.<span style="color:#9900CC;">sock</span>
database: your_production_db
host: localhost
username: root
password: your_password</pre></td></tr></table></div>

<p>and save as you exit. Without the socket information, Rails will never find MySQL, which sucks.</p>
<p>(This information licensed under a <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons</a> License.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gilluminate.com/2007/07/24/westhost-on-rails-2007-for-cheapskates/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
