<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Blog of Aaron Theodore - Home</title>
  <id>tag:bat.id.au,2007:mephisto/</id>
  <generator version="0.7.3" uri="http://mephistoblog.com">Mephisto Noh-Varr</generator>
  <link href="http://bat.id.au/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://bat.id.au/" rel="alternate" type="text/html"/>
  <updated>2007-08-22T10:14:36Z</updated>
  <entry xml:base="http://bat.id.au/">
    <author>
      <name>aaront</name>
    </author>
    <id>tag:bat.id.au,2007-08-22:29</id>
    <published>2007-08-22T09:59:00Z</published>
    <updated>2007-08-22T10:14:36Z</updated>
    <category term="gigabit"/>
    <category term="solaris"/>
    <link href="http://bat.id.au/2007/8/22/solaris-jumbo-frames-intel-gigabit" rel="alternate" type="text/html"/>
    <title>Solaris + Jumbo Frames + Intel Gigabit</title>
<content type="html">
            &lt;p&gt;For a while I have been wanting to get Solaris working with jumbo frames on Intel gigabit ethernet (I have a PCI-X &lt;a href=&quot;http://www.intel.com/design/network/products/lan/controllers/82546.htm&quot;&gt;82546EB Dual Port Gigabit Ethernet Controller&lt;/a&gt;). Initially i wanted this for improved performance between my diskless workstation and Solaris server (NFS). Since moving state in January 2007, I never actually setup the diskless workstation again, so never bothered with jumbo frames, as my switched network was only 100mbit (diskless workstation connected to server via dedicated port).&lt;/p&gt;

&lt;p&gt;Anyhow, I still only have a 100mbit switched network, but I just purchased a ST Labs C-210 gigabit expresscard for my laptop and want to play with iSCSI. The plan was to have a direct gigabit connection from laptop to server dedicated to iSCSI.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://bat.id.au/assets/2007/8/22/st-labs-gb-expresscard.jpg&quot;&gt;&lt;img src=&quot;http://bat.id.au/assets/2007/8/22/st-labs-gb-expresscard_thumb.jpg&quot; alt=&quot;ST Labs C-210 gigabit expresscard&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To get the best performance out of iSCSI I needed to enable jumbo frame support at each end. In windows all i had to do is configure the driver to support 9k frames. In Solaris it was a bit more tricky&#8230;&lt;/p&gt;

&lt;p&gt;In my case my internal hostname will be tanker-int with an ip of 192.168.2.5, with a mtu of 9000 (as that is the largest frame the other end of the link (the ST Labs card) can support).&lt;/p&gt;

&lt;p&gt;Firstly added hostname to &lt;code&gt;/etc/hostname.e1000g0&lt;/code&gt; (e1000g0 being the particular port i was using)&lt;br /&gt;
&lt;code&gt;tanker-int mtu 9000 up&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;edit &lt;code&gt;/etc/inet/hosts&lt;/code&gt; to contain:&lt;br /&gt;
&lt;code&gt;tanker-int  192.168.2.5&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;edit /kernel/drv/e1000g.conf &lt;br /&gt;
Find The MaxFrameSize line and set to:&lt;br /&gt;
&lt;code&gt;MaxFrameSize=3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3;&lt;/code&gt;&lt;br /&gt;
to support 16k frames&lt;/p&gt;

&lt;p&gt;reboot&lt;/p&gt;

&lt;p&gt;A reboot shouldn&#8217;t be necessary, but even after unloading the kernel module reloading it and brining interface up, it would refuse to accept my driver config changes, so i just gave up and did a reboot.&lt;/p&gt;

&lt;pre&gt;
e1000g0: flags=1201000843&amp;lt;up&gt; mtu 9000 index 2
        inet 192.168.2.5 netmask ffffff00 broadcast 192.168.2.255
        ether 0:4:23:c3:f6:90 
&lt;/pre&gt;

&lt;p&gt;There are other tcp tuning params that seem to be a good idea to change like window size and receive/send buffers. I have yet to work this out, it should be a good post for the future when I work it out.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://bat.id.au/">
    <author>
      <name>aaront</name>
    </author>
    <id>tag:bat.id.au,2007-08-22:28</id>
    <published>2007-08-22T09:13:00Z</published>
    <updated>2007-08-22T09:16:24Z</updated>
    <category term="solaris"/>
    <link href="http://bat.id.au/2007/8/22/solaris-native-mode-driver-for-nvidia-sata" rel="alternate" type="text/html"/>
    <title>Solaris Native mode driver for Nvidia SATA</title>
<content type="html">
            &lt;p&gt;Finally, looks like &lt;a href=&quot;http://www.opensolaris.org&quot;&gt;OpenSolaris&lt;/a&gt; will finally get &lt;a href=&quot;http://www.opensolaris.org/os/community/on/flag-days/pages/2007081601/&quot;&gt;Native mode driver for Nvidia SATA&lt;/a&gt; in build 72.&lt;/p&gt;

&lt;p&gt;I have been wairing and hoping for this since i first started using OpenSolaris in September 2006. Hopefully I&#8217;ll get better performance and hotplug support.&lt;/p&gt;

&lt;p&gt;Pitty i only reinstalled my server to build 70 (from build 56), now i&#8217;ll have to attempt an update once build 72 comes out.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://bat.id.au/">
    <author>
      <name>aaront</name>
    </author>
    <id>tag:bat.id.au,2007-04-13:17</id>
    <published>2007-04-13T10:18:00Z</published>
    <updated>2007-04-13T10:34:39Z</updated>
    <category term="database"/>
    <category term="mysql"/>
    <link href="http://bat.id.au/2007/4/13/fixing-utf8-text-stored-as-latin1-in-mysql" rel="alternate" type="text/html"/>
    <title>Fixing utf8 text stored as latin1 in MySQL</title>
<content type="html">
            &lt;p&gt;UPDATE: After posting this i found a good blog post about the same issue &lt;a href=&quot;http://www.oreillynet.com/onlamp/blog/2006/01/turning_mysql_data_in_latin1_t.html&quot;&gt;Turning MySQL data in latin1 to utf8 utf-8&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While migraging an old PHP based web app to Ruby on Rails I came across an issue where the database and php were talking latin1 but the web interface outputted utf8 and forms posted were also in utf8. Part of the issue was the html the application was outputting had no meta tag such as:&lt;br /&gt;
&lt;code&gt;&amp;lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=ISO-8859-1&quot;/&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and the headers sent by apache were: &lt;br /&gt;
&lt;code&gt;Content-Type: text/html; charset=UTF-8&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After much trial and error i managed to work out how to migrate this data.&lt;/p&gt;

&lt;p&gt;Use &lt;code&gt;mysqldump&lt;/code&gt; on the table with the option &lt;code&gt;--default-character-set=latin1&lt;/code&gt; and output to a file.&lt;/p&gt;

&lt;p&gt;This file will have text encoded as utf8&lt;/p&gt;

&lt;p&gt;Then edit the table definition in the file and change the &lt;code&gt;DEFAULT CHARSET&lt;/code&gt; to utf8&lt;/p&gt;

&lt;p&gt;Its then a good idea to run the file though &lt;code&gt;iconv&lt;/code&gt; to drop corrupted characters&lt;/p&gt;

&lt;p&gt;&lt;code&gt;iconv -f utf-8 -t utf-8 table.sql -c -o table_fixed.sql&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It is also a good idea to set mysql to default to utf8 for everything, edit my.cnf&lt;/p&gt;

&lt;p&gt;under &lt;code&gt;[client]&lt;/code&gt; and &lt;code&gt;[mysqld]&lt;/code&gt; add: &lt;code&gt;default-character-set=utf8&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then can reimport the fixed data back into mysql.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mysql -u user -p -e &quot;source table_fixed.sql&quot; database&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Of course now you need to make sure anything talking to the database is doing so in utf8&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://bat.id.au/">
    <author>
      <name>aaront</name>
    </author>
    <id>tag:bat.id.au,2007-03-29:12</id>
    <published>2007-03-29T23:02:00Z</published>
    <updated>2007-03-29T23:03:04Z</updated>
    <category term="solaris"/>
    <category term="zfs"/>
    <link href="http://bat.id.au/2007/3/29/open-solaris-zfs-boot-support" rel="alternate" type="text/html"/>
    <title>Open Solaris ZFS boot support!</title>
<content type="html">
            &lt;p&gt;One of the things that really annoyed me with Open Solaris was not being able to use a ZFS filesystem to boot (well not not without major hacks). This looks like it will finally change now.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.opensolaris.org/os/community/on/flag-days/pages/2007032801/&quot;&gt;Heads-up: ZFS Boot support for the x86 platform&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blogs.sun.com/timf/entry/zfs_bootable_datasets_happily_rumbling&quot;&gt;ZFS Bootable datasets - happily rumbling&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It will be great to be able to have a Raid1 boot/root filesystem without having to resort to UFS and SVM.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://bat.id.au/">
    <author>
      <name>aaront</name>
    </author>
    <id>tag:bat.id.au,2007-03-28:9</id>
    <published>2007-03-28T22:31:00Z</published>
    <updated>2007-03-28T22:33:53Z</updated>
    <category term="internet explorer"/>
    <category term="web development"/>
    <link href="http://bat.id.au/2007/3/28/a-better-view-source-for-internet-explorer" rel="alternate" type="text/html"/>
    <title>A better view source for internet explorer</title>
<content type="html">
            &lt;p&gt;Reading my usual RSS feeds i came upon the following post in the IEBlog: &lt;a href=&quot;http://blogs.msdn.com/ie/archive/2007/03/28/ie7-in-vista-configuring-your-view-source-editor.aspx&quot;&gt;IE7 in Windows Vista: Configuring Your View Source Editor&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I don't run Vista, but what caught my eye was:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;If you are looking for a better View Source Editor option than Notepad, install &lt;a href=&quot;http://msdn.microsoft.com/vstudio/express/vwd/&quot;&gt;Microsoft Visual Web Developer 2005 Express Edition&lt;/a&gt; and add: &lt;/p&gt;
    
    &lt;p&gt;&lt;code&gt;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\VWDExpress.exe&lt;/code&gt; &lt;/p&gt;
    
    &lt;p&gt;to the following registry key: &lt;/p&gt;
    
    &lt;p&gt;&lt;code&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\View Source Editor\Editor Name&lt;/code&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Which means add the following to a .reg file and run it:&lt;/p&gt;

&lt;pre&gt;
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\View Source Editor]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\View Source Editor\Editor Name]
@=&quot;C:\\Program Files\\Microsoft Visual Studio 8\\Common7\\IDE\\VWDExpress.exe&quot;
&lt;/pre&gt;

&lt;p&gt;&lt;em&gt;Note: the actual download is quite large ~ 42mb, then a 30mb service pack for it. Quite hefty for just a view source editor&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Anyhow this all worked fine and dandy, the speed it loads is instant which is fantastic (i wish the same could be said for Dreamweaver or eclipse (RadRails)), So I think that I will keep it as my view source handler.&lt;/p&gt;

&lt;p&gt;The first issue I noticed when doing a view source of a ruby on rails application, Visual Web Developer wasn't sure what to do in the code highlighting department since the temp file it has opened had no extension.&lt;/p&gt;

&lt;p&gt;There is a simple fix to this:&lt;br /&gt;
&lt;code&gt;Tools -&amp;gt; Options -&amp;gt; 'Show all settings&lt;/code&gt;
&lt;code&gt;Text Editor -&amp;gt; File Extension -&amp;gt; Map extensionless files to: HTML Editor&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://bat.id.au/assets/2007/3/28/vwd-extensionless.png&quot;&gt;&lt;img src=&quot;http://bat.id.au/assets/2007/3/28/vwd-extensionless_thumb.png&quot; alt=&quot;VWD Dialog box&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://bat.id.au/">
    <author>
      <name>aaront</name>
    </author>
    <id>tag:bat.id.au,2007-03-27:8</id>
    <published>2007-03-27T04:19:00Z</published>
    <updated>2007-03-27T04:34:26Z</updated>
    <category term="rails"/>
    <link href="http://bat.id.au/2007/3/27/search-engine-friendly-urls-with-ruby-on-rails" rel="alternate" type="text/html"/>
    <title>Search Engine Friendly URL&#8217;s with Ruby on Rails</title>
<content type="html">
            &lt;p&gt;Sometimes it is nice to be able to show meaningful text in your URLs&lt;/p&gt;

&lt;p&gt;URLs like: &lt;code&gt;http://www.site.com/sports/1/teams/1;results&lt;/code&gt; &lt;br /&gt;
Although relatively short, don't have a lot of meaning&lt;/p&gt;

&lt;p&gt;&lt;code&gt;http://www.site.com/sports/cricket/teams/first-11;results&lt;/code&gt;&lt;br /&gt;
Has more meaning, but is not ideal from the web applications point of view.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;http://www.site.com/sports/1-cricket/teams/1-first-11;results&lt;/code&gt;&lt;br /&gt;
Is the best of both worlds, and surprisingly easy to achieve in ruby.&lt;/p&gt;

&lt;p&gt;In all the models you want a descriptive id, just overwrite the &lt;code&gt;to_params&lt;/code&gt; method. By default &lt;code&gt;model.to_params&lt;/code&gt; returns the value of the models  primary key.&lt;/p&gt;

&lt;p&gt;In my case the name field of all my models is the field i want to appear in the URL.&lt;/p&gt;

&lt;p&gt;The following will do that. Sets the name to lowercase and replaces spaces with -&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; 
  def to_param
    &quot;#{id}-#{name.downcase.gsub(/ /, '-'))}&quot;
  end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Unfortunately this is not ideal, what if you had non ascii characters in your name, you would end up with escaped characters and an ugly URL&lt;/p&gt;

&lt;p&gt;So i chose to make use of the &lt;a href=&quot;http://svn.techno-weenie.net/projects/plugins/permalink_fu/&quot;&gt;PermalinkFu&lt;/a&gt; plugin from Rick Olson&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; 
  def to_param
    &quot;#{id}-#{PermalinkFu.escape(name)}&quot;
  end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The PermalinkFu plugin will convert the string so it is suitable to be placed in the url, it uses Iconv to do a unicode translation to ascii. This means strings such as &lt;code&gt;café&lt;/code&gt; get translated to &lt;code&gt;cafe&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You might think that by overwriting to_params rails would get confused, but it dosn't. Well as long as you observe a simple rule:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When generating a url pass the model in where it expects an id&lt;br /&gt;
&lt;code&gt;:id =&amp;gt; model&lt;/code&gt; NOT &lt;code&gt;:id =&amp;gt; model.id&lt;/code&gt;
This works as rails automatically calls &lt;code&gt;to_params&lt;/code&gt; to get the id, if you call &lt;code&gt;model.id&lt;/code&gt; it will bypass &lt;code&gt;to_params&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After writing this i noticed &lt;a href=&quot;http://www.seoonrails.com/&quot;&gt;SEO on Rails&lt;/a&gt; posted about &lt;a href=&quot;http://www.seoonrails.com/even-better-looking-urls-with-permalink_fu&quot;&gt;Even better looking URLs with permalink_fu&lt;/a&gt;. I don’t think this is ideal since if you update the name/permalink anyone linking to your URLs will end up with a broken link. Also there is no way to ensure unique permalinks (unless you add extra code into your model which i will cover in a future post).&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://bat.id.au/">
    <author>
      <name>aaront</name>
    </author>
    <id>tag:bat.id.au,2007-03-24:7</id>
    <published>2007-03-24T05:00:00Z</published>
    <updated>2007-03-28T22:34:26Z</updated>
    <link href="http://bat.id.au/2007/3/24/too-many-rss-feeds" rel="alternate" type="text/html"/>
    <title>Too many RSS feeds!</title>
<content type="html">
            &lt;p&gt;I think it is safe to say i have WAY too many RSS feeds in FeedDemon!&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://bat.id.au/assets/2007/3/24/too-many-feeds.png&quot;&gt;&lt;img src=&quot;http://bat.id.au/assets/2007/3/24/too-many-feeds_thumb.png&quot; alt=&quot;Too many feeds&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://bat.id.au/">
    <author>
      <name>aaront</name>
    </author>
    <id>tag:bat.id.au,2007-03-22:4</id>
    <published>2007-03-22T04:11:00Z</published>
    <updated>2007-03-22T04:19:25Z</updated>
    <category term="rails,attachment_fu,image_science,debian,apache,mod_fcgid,fastcgi"/>
    <link href="http://bat.id.au/2007/3/22/imagescience-and-mod_fcgid" rel="alternate" type="text/html"/>
    <title>ImageScience and mod_fcgid</title>
<content type="html">
            &lt;p&gt;Recently converting a bunch of rails apps to AttachmentFu from ActsAsAttachment to make use of ImageScience i found that anything that refered to a model that has a: 'has_attachment' in it caused rails to fail with  a cryptic message:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ActionView::TemplateError (exit) on line #41 of app/views/pages/section_home.rhtml:
38:           &amp;lt;h2&amp;gt;Story&amp;lt;/h2&amp;gt;
39:           Scobie sponsors many of Tasmania's community organisations...
40:         &amp;lt;/div&amp;gt;
41:         &amp;lt;img src=&quot;/images/stories/1.jpg&quot; border=&quot;0&quot; alt=&quot;Story&quot; /&amp;gt;
42:       &amp;lt;/a&amp;gt;
43:     &amp;lt;/div&amp;gt;
44:     &amp;lt;div class=&quot;story&quot;&amp;gt;

/usr/lib/ruby/gems/1.8/gems/RubyInline-3.6.2/inline.rb:70:in `exit'
/usr/lib/ruby/gems/1.8/gems/RubyInline-3.6.2/inline.rb:70:in `rootdir'
/usr/lib/ruby/gems/1.8/gems/RubyInline-3.6.2/inline.rb:84:in `directory'
/usr/lib/ruby/gems/1.8/gems/RubyInline-3.6.2/inline.rb:257:in `so_name'
/usr/lib/ruby/gems/1.8/gems/RubyInline-3.6.2/inline.rb:291:in `load_cache'
/usr/lib/ruby/gems/1.8/gems/RubyInline-3.6.2/inline.rb:627:in `inline'
/usr/lib/ruby/gems/1.8/gems/image_science-1.1.1/lib/image_science.rb:84
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;etc...&lt;/p&gt;

&lt;p&gt;Error was quite bizare especially as line 41 refered to a static file that gets served up by apache, taking out that line would cause errors on other lines of the html.&lt;/p&gt;

&lt;p&gt;Anyhow after much debugging and looking through the source for ImageScience and RubyInline i noticed that RubyInline was not generating the shared object for ImageScience.&lt;/p&gt;

&lt;p&gt;The default in my case was:&lt;br /&gt;
&lt;code&gt;ENV['HOME']/.ruby_inline/Inline_ImageScience_aa58.so&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That seemed like it should work, i expected fastcgi would have the &lt;code&gt;HOME&lt;/code&gt; environment variable set.
I was wrong...&lt;/p&gt;

&lt;p&gt;as a quick test i edited &lt;code&gt;dispatch.fcgi&lt;/code&gt; to include:&lt;br /&gt;
&lt;code&gt;ENV['HOME'] = '/home/username'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Alas it worked!&lt;/p&gt;

&lt;p&gt;I didn't think it was ideal to have to edit dispatch.fcgi for each rails app, &lt;/p&gt;

&lt;p&gt;some quick research led me to find the Apache module &lt;a href=&quot;http://httpd.apache.org/docs/2.2/mod/mod_env.html&quot;&gt;mod_env&lt;/a&gt;.&lt;br /&gt;
&lt;code&gt;PassEnv&lt;/code&gt; directive which could be set in the global 'server config' looked usefull!&lt;/p&gt;

&lt;p&gt;But no...
Apache reported: &lt;code&gt;[warn] PassEnv variable HOME was undefined&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SetEnv&lt;/code&gt; also didnt work in any of the contexts (server config, virtual host, directory, .htaccess)&lt;/p&gt;

&lt;p&gt;Now because im running multiple clients and accounts on this server i use &lt;a href=&quot;http://httpd.apache.org/docs/2.2/suexec.html&quot;&gt;suexec&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It seems suexec blocks Environment variables that are not in its whitelist (which is compiled into it).&lt;/p&gt;

&lt;p&gt;I was already manually compiling suexec (to replace the one from the Debian package) so added the following:
&lt;code&gt;/usr/src/apache2-2.2.3/support/suexec.c&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    &quot;TZ=&quot;,
+    &quot;HOME=&quot;,
+    &quot;RAILS_ENV=&quot;,
    NULL
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;recompiled, coppied to correct place and reloaded apache&lt;/p&gt;

&lt;p&gt;&quot;That has to solve it&quot; I thought to myself...&lt;/p&gt;

&lt;p&gt;Wrong again!&lt;/p&gt;

&lt;p&gt;I had hit another brick wall, this time it was &lt;a href=&quot;http://fastcgi.coremail.cn/&quot;&gt;mod_fcgid&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It appeared it was blocking my attempts to set an environment variable in apache. The only option the module has for environment variables is: &lt;code&gt;DefaultInitEnv&lt;/code&gt; and that is done in the 'server config' context, which is useless for my needs.&lt;/p&gt;

&lt;p&gt;At this point i thought it May be posible to hack mod_fcgid to pass the environment variables i want, but i had already spent way too much time on this.&lt;/p&gt;

&lt;p&gt;So i will continue to set &lt;code&gt;ENV['HOME']&lt;/code&gt; in dispatch.fcgi till i find a better solution for my fastcgi rails apps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If anyone has a better solution to this i'd love to hear about it!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;FYI:&lt;/strong&gt; The majority of the rails apps on the server are run under mongrel, fastcgi is just used for the ones that don't get much traffic and/or are for testing.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://bat.id.au/">
    <author>
      <name>aaront</name>
    </author>
    <id>tag:bat.id.au,2007-03-22:3</id>
    <published>2007-03-22T03:01:00Z</published>
    <updated>2007-03-22T03:16:48Z</updated>
    <category term="rails,debian"/>
    <link href="http://bat.id.au/2007/3/22/how-not-to-upgrade-rubygems-on-debian" rel="alternate" type="text/html"/>
    <title>How not to upgrade rubygems on debian</title>
<content type="html">
            &lt;p&gt;I was having some issues with a certain rails site not working when run as fastcgi (worked as mongrel and webrick), in my process of debugging i realised the server i run the app on (Debian) didn&#8217;t have the latest rubygems.&lt;/p&gt;

&lt;p&gt;It had version 0.9.0 (at time of writing 0.9.2 was latest), naïvely i thought rubygems could be to blame!&lt;/p&gt;

&lt;p&gt;Unfortunately the newest Debian rubygems package was 0.9.0 (even in unstable!), for the life of me i could not locate a 3rd party .deb.&lt;/p&gt;

&lt;p&gt;No problems&#8230; compile from source it is!&lt;/p&gt;

&lt;p&gt;Now I&#8217;m getting even worse errors trying to run the fastcgi (how bizare)&lt;/p&gt;

&lt;p&gt;Try mongrel again&#8230;. Uh Oh!! doesn’t work!&lt;/p&gt;

&lt;p&gt;Yes i managed to break the rails hosting server i run for multiple clients, and new rails processes would not run.&lt;/p&gt;

&lt;p&gt;bit of debugging later.. Errr where did all the system gems go??&lt;/p&gt;

&lt;p&gt;What happened is..&lt;/p&gt;

&lt;p&gt;Debian rubygems stores its gem archive in: /var/lib/gems/1.8/  ,&lt;br /&gt;
whereas the compiled rubygems default was: /usr/lib/ruby/gems/1.8/&lt;/p&gt;

&lt;p&gt;I could have possibly symbolic linked or copied the files to new location, but to be on the safe side i just reinstalled them all&lt;/p&gt;

&lt;p&gt;NOW&#8230;  i REALLY have to get that virtual server setup at home so i can test system changes on a non production system!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://bat.id.au/">
    <author>
      <name>aaront</name>
    </author>
    <id>tag:bat.id.au,2007-03-22:1</id>
    <published>2007-03-22T02:33:00Z</published>
    <updated>2007-03-22T05:02:34Z</updated>
    <link href="http://bat.id.au/2007/3/22/ok-my-blog-is-finally-back" rel="alternate" type="text/html"/>
    <title>Ok my blog is finally back</title>
<content type="html">
            &lt;p&gt;Ok well my blog is finally back&#8230;&lt;/p&gt;

&lt;p&gt;I thought it was about time to set it up as i keep discovering things i should blog about, but to do so i would need to go though all the effort of setting up my blog again, so i never bother.&lt;/p&gt;

&lt;p&gt;This time i setup mephisto to test to see if it also had the same issue as my own rails app did with fastcgi, and it did!&lt;/p&gt;
          </content>  </entry>
</feed>

