<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/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>Drinkingbird: Typo on Site5</title>
    <link>http://www.drinkingbird.net/blog/articles/2007/06/10/typo-on-site5</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Random keyboard peckings</description>
    <item>
      <title>Typo on Site5</title>
      <description>&lt;p&gt;I thought I&amp;#8217;d post a quick summary on what I went through to get Typo up and running on &lt;a href="http://www.site5.com"&gt;Site5&lt;/a&gt;, since it&amp;#8217;s a bit more tricky now that the SiteAdmin interface no longer contains an automatic install script.&lt;/p&gt;

&lt;p&gt;I decided to go the gem route on this, so that&amp;#8217;s the only way I&amp;#8217;m going to talk about. If you want to install from SVN trunk, you&amp;#8217;re on your own.&lt;/p&gt;

&lt;p&gt;First, you&amp;#8217;ll want to set up your account with a local gem installation directory, as detailed in this &lt;a href="http://forums.site5.com/showthread.php?t=11954"&gt;forum thread&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Then, ssh into your account (if you&amp;#8217;re not still there), and type:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;gem install typo&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;There&amp;#8217;s a good chance this will fail the first time, with an error on attempting to install the sqlite3-ruby gem. This can be solved by opening a ticket with Site5&amp;#8217;s support, and asking to have the sqlite-devel package installed on your server, then trying again.&lt;/p&gt;

&lt;p&gt;Once the gem is installed, you just need to run&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;typo &amp;lt;installation directory&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt; then manually kill the mongrel process it spaws immediately after installation (I&amp;#8217;d lay money on site5&amp;#8217;s servers doing this automatically if you don&amp;#8217;t anyway).

From here, it&amp;#8217;s all fairly easy:

Edit the environment.rb file in typo&amp;#8217;s config directory, and uncomment the line:
&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="constant"&gt;ENV&lt;/span&gt;&lt;span class="punct"&gt;['&lt;/span&gt;&lt;span class="string"&gt;RAILS_ENV&lt;/span&gt;&lt;span class="punct"&gt;']&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;production&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;and add the line:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="constant"&gt;ENV&lt;/span&gt;&lt;span class="punct"&gt;['&lt;/span&gt;&lt;span class="string"&gt;GEM_PATH&lt;/span&gt;&lt;span class="punct"&gt;']&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;/home/&amp;lt;your_username&amp;gt;/&amp;lt;path_to_gems&amp;gt;:/usr/lib/ruby/gems/1.8&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Create the file public/.htaccess in the typo directory as:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;# General Apache options
AddHandler fastcgi-script .fcgi
Options +FollowSymLinks +ExecCGI

RewriteEngine On

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

ErrorDocument 500 /500.html # You may want to edit this file&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Setup a mysql database for the blog&amp;#8217;s production db, and configure it in config/database.yml. Example config:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_yaml "&gt;&lt;span class="key"&gt;production&lt;/span&gt;&lt;span class="punct"&gt;:&lt;/span&gt;
  &lt;span class="key"&gt;adapter&lt;/span&gt;&lt;span class="punct"&gt;:&lt;/span&gt; mysql
  &lt;span class="key"&gt;database&lt;/span&gt;&lt;span class="punct"&gt;:&lt;/span&gt; username_blog
  &lt;span class="key"&gt;username&lt;/span&gt;&lt;span class="punct"&gt;:&lt;/span&gt; username_blog
  &lt;span class="key"&gt;password&lt;/span&gt;&lt;span class="punct"&gt;:&lt;/span&gt; secret
  &lt;span class="key"&gt;host&lt;/span&gt;&lt;span class="punct"&gt;:&lt;/span&gt; localhost&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then run &lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;rake db:migrate RAILS_ENV=production&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;to load the schema.&lt;/p&gt;

&lt;p&gt;If you installed your blog anywhere other than under your public_html directory, you&amp;#8217;ll need to create a symlink to the blog, e.g.&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;ln -s /path/to/typo/public public_html/blog&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Hopefully this ends up helping someone. If not, well at least it gave me an excuse to get to grips with some of typo&amp;#8217;s editing syntax. If I&amp;#8217;ve missed anything, please bitch at me, so I can fix it.&lt;/p&gt;</description>
      <pubDate>Sun, 10 Jun 2007 06:51:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:6d4ddb74-99b7-429e-b270-0433e34019e9</guid>
      <author>Chris</author>
      <link>http://www.drinkingbird.net/blog/articles/2007/06/10/typo-on-site5</link>
      <category>Typo</category>
      <category>Ruby on Rails</category>
    </item>
    <item>
      <title>"Typo on Site5" by tankdilla</title>
      <description>&lt;p&gt;I indeed found it helpful.  After a few hours of trying to debug my installation, your tutorial cleared up a few things.&lt;/p&gt;</description>
      <pubDate>Thu, 02 Aug 2007 18:36:57 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:53e1eed5-6841-43e6-b69e-597871d5d95f</guid>
      <link>http://www.drinkingbird.net/blog/articles/2007/06/10/typo-on-site5#comment-2</link>
    </item>
    <item>
      <title>"Typo on Site5" by trackstar</title>
      <description>&lt;p&gt;(in reverse order)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;ln -s /home/site5username/path/to/typo public_html/blog&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;make sure there is only one space on the indentations of the database.yml file&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;when making the local gem dir, on the site5 thread, do steps 1-7, then 11;
Then type 'gem install typo' (add -y to autoinstall dependencies);
do step 9 on the site5 thread.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;if typo isn't found, you can install an instance of this with ./gems/bin/typo &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;</description>
      <pubDate>Thu, 14 Jun 2007 03:16:30 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:4697e842-7f2b-4a1d-a0a5-4238c3eb2b42</guid>
      <link>http://www.drinkingbird.net/blog/articles/2007/06/10/typo-on-site5#comment-1</link>
    </item>
  </channel>
</rss>
