<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>notkeepingitreal.com: Rails Deployment on Shared Hosts - Geoffrey Grosenbach</title>
    <link>http://notkeepingitreal.com/articles/2006/06/25/rails-deployment-on-shared-hosts-geoffrey-grosenbach</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Rails Deployment on Shared Hosts - Geoffrey Grosenbach</title>
      <description>&lt;ul&gt;
	&lt;li&gt;The nubyonrails.com guy&lt;/li&gt;
		&lt;li&gt;This session is about therapy. If you have had problems with shared hosting in the past, &lt;strong&gt;it&amp;#8217;s not your fault&lt;/strong&gt;.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;So why do people choose to use shared hosting? It&amp;#8217;s cheap and it&amp;#8217;s easy.&lt;/p&gt;


	&lt;p&gt;And why is it such a big struggle? There are many pigs sucking at the same teet.&lt;/p&gt;


	&lt;h3&gt;Recommendations&lt;/h3&gt;


	&lt;ul&gt;
	&lt;li&gt;Keep your app small. Use less resources.&lt;/li&gt;
		&lt;li&gt;Cache &amp;#8211; page caching tends to work great in a shared hosting environment, assuming it can work for your app.&lt;/li&gt;
		&lt;li&gt;Don&amp;#8217;t use typo &lt;em&gt;(whoops)&lt;/em&gt;&lt;/li&gt;
		&lt;li&gt;Don&amp;#8217;t use Lighttpd &amp;#8211; Apache is usually the default, and the systems guys tend to like the defaults.&lt;/li&gt;
		&lt;li&gt;Use capistrano.
 &lt;pre&gt;
 * set :checkout, :export
 * set :restart_via, :run
 * set :use_sudo, false
 &lt;/pre&gt;
 * redefine the :restart task so it reaps the proper dispatch.fcgi, etc&lt;/li&gt;
		&lt;li&gt;Write tests!&lt;/li&gt;
		&lt;li&gt;Use the reaper (possibly on a crontab &amp;#8211; don&amp;#8217;t let those dispatches explode)&lt;/li&gt;
		&lt;li&gt;Monitor that stuff (some sites include &lt;a href="http://easymonitor.com"&gt;easymonitor&lt;/a&gt; and &lt;a href="http://montastic.com"&gt;montastic&lt;/a&gt;)&lt;/li&gt;
		&lt;li&gt;Possibly just avoid shared hosting alltogether and go with a virtual private server.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h3&gt;Troubleshooting&lt;/h3&gt;


	&lt;ul&gt;
	&lt;li&gt;The same stuff always goes wrong&lt;/li&gt;
		&lt;li&gt;Check you shebang line (the top line of any ruby script, especially in dispatch.fcgi)&lt;/li&gt;
		&lt;li&gt;./script/server to see if the app can even load in webrick&lt;/li&gt;
		&lt;li&gt;./script/console to see if you can even hit your database&lt;/li&gt;
		&lt;li&gt;tail -f your logs&lt;/li&gt;
		&lt;li&gt;And if none of that works&amp;#8230;just wait, someone else may be screwing with something&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Buy my book: Rails Deployment from the pragmatic programmers.&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;This &lt;a href="http://geoffreygrosenbach.com"&gt;Geoffrey&lt;/a&gt;, representing properly.&lt;/em&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 25 Jun 2006 13:05:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:75d498d3-0560-4305-8ea8-883c36af2234</guid>
      <author>Kevin</author>
      <link>http://notkeepingitreal.com/articles/2006/06/25/rails-deployment-on-shared-hosts-geoffrey-grosenbach</link>
      <category>Railsconf</category>
      <trackback:ping>http://notkeepingitreal.com/articles/trackback/19</trackback:ping>
    </item>
  </channel>
</rss>
