Archive for the 'Uncategorized' Category

Keeping an Amazon Elastic Compute Cloud (EC2) Instance Up with Chef and Auto Scaling – Omnibus Update

Feb. 8th 2013

This post details how to use the Chef Omnibus chef-client install with an AWS auto scaling group. This allows a Ubuntu Precise image to bootstrap with chef and then follow the run list you provide.
In 2011, I wrote a version of this which installs ruby and the required dependencies. Just recently, this started failing for me because of dependency conflicts with net-ssh. For a year now, Opscode have been providing an omnibus version of chef which installs the exact version of the dependencies you need.
The procedure is the same as for the original post but the user data is different. Note, also, that this version pins the chef version to 10.18.2. This is so your setup doesn’t fail when it attempts to start an instance with the very latest version of chef – which happens to be incompatible with your cookbooks. Keeping the chef-client version pinned is a very good idea.

Posted by Edward Sargisson | in Uncategorized | No Comments »

Converting Jazz IBM Rational Team Concert (RTC) Work Items to GitHub Issues

Feb. 2nd 2012

I have recently been converting my source code control and work item management from IBM Rational Team Concert (Jazz) to GitHub.

I originally used Jazz because I’d heard about when I worked for IBM New Zealand and thought it was a very good idea. The source code control is nice and the integration with work items and their flow works well. However, now I feel I’m in a bit of a backwater. Sharing code with Chef cookbooks is hard; with git I can pull down the upstream changes and merge them with what I’m doing. We’re starting to use git at my current employer and I want to build up some experience.

I needed a way to get my work items from Jazz into GitHub’s Issue system. I wrote a Ruby script to do just that. This script may be a useful starting point for you if you need to do any access to Jazz’s REST API or to do the conversion I did.


Posted by Edward Sargisson | in Uncategorized | No Comments »

Using satellite or mini sites for SEO – a bad idea

Sep. 22nd 2011

I recently heard Patrick Mackenzie on the Stack Exchange podcast extolling the virtues of exact match domains. Google gives a little boost in the page rankings of sites where the domain name, without hyphens, exactly matches the user’s query. My idea was to have exact match domains for the two trails that get the most traffic in the hopes of getting more traffic. The idea didn’t work out.

As an experiment, I setup and I had it so that the links on my main site would 301 Redirect straight to those sites. This was important because Google will penalize duplicate content. A 301 Redirect tells Google that the content has now moved.

A few days after I submitted these URLs to Google I saw a very nice spike in traffic where I got ~150 visits more than normal. Then the traffic went away.

I then realised that I’d screwed the pages up and there were 404 Not founds everywhere. I fixed those up and resubmitted to Google. Then I saw that Google was finding my content on a shorter URL. Requests to /trails/blah/blah/trail/ will resolve just as well as /trail/blah/blah/blah/trail/. I fixed that by detecting if a more specific url should be used and redirecting to that.

I then used a trial of SEOMoz (great site!) to see what happened to my keyword rankings after a week. I wanted to compare how my exact match domains were comparing with my main domain.

keyword Mini domain Main domain
Google CA Bing en-CA Yahoo CA Google CA Bing en-CA Yahoo CA
baden powell map not in top 50 5 not in top 50
baden powell trail not in top 50 15 12 not in top 50 not in top 50 not in top 50
baden powell trail map not in top 50 12 15 35 not in top 50 not in top 50
baden-powell trail map not in top 50 12 21
grouse grind not in top 50 30 not in top 50 not in top 50 not in top 50 not in top 50
grouse grind map 46 12 15
grouse grind trail map not in top 50 6 14 32 45 not in top 50
the grouse grind not in top 50 30 not in top 50
the grouse grind trail map not in top 50 6 14 34 46 not in top 50

I’ve also basically decided that the experiment with exact match
domains ( and was a bad one.
Just got the keywork ranking results for this week:

Conclusions does not rank anywhere in the top 50 on google for various combinations of trail and map. It does rank as high as 5 on Bing. gets to 46 for ‘grouse grind map’ on google and is 6 for ‘grouse grind trail map’ on Bing. For comparison: has ‘grouse grind trail map’ at 32 and ‘baden powell trail map’ is 35.

I did some research in the SEOmoz Q&A site and found the opinion appears to be against the idea.

So I’ve now switched the satellite sites off. The domains now 301 Redirect back to the main site and I’ve told Google to go crawl them. Bing and Yahoo can come and crawl in their own time.

Posted by Edward Sargisson | in Uncategorized | No Comments »

Setting up a WordPress blog with a Tomcat web application

Apr. 24th 2011

This site now had a WordPress blog beside the Tomcat application server that runs itself. The setup was a little complex so I will detail it below.

My aim in setting up these blogs was to provide some quality content so that people share the content and Google sends visitors to the site. Therefore, I wanted to setup the blogs to be below the domain.

WordPress runs on PHP and typically uses Apache as the webserver. The original configuration of Tomcat had Tomcat listening to ports 80 and 443 and Apache wasn’t used at all.

I have just started using Opscode Chef to manage my infrastructure. I started with the cookbook for WordPress as that would do most of the work for me. I modified the cookbook to:

  • Install into /var/www/blog so that the resulting blogs would be at
  • Install WordPress 3.1.1 instead of the default 3.0.x

The blog-server role is this:

name "blog-server"
description "Wordpress Blog Server"
default_attributes ( {"mysql" => { "server_root_password" => "password" }, "wordpress" => { "version" => "3.1.1", "checksum" => "aa2ea71a34596a6d53c653c00a549e2abd190a7cb3e80812e63b6e9444500a9b", "dir" => "/var/www/blog" }})

Because we are now using Apache as the front end server we need to communicate from Apache to Tomcat. The way to do this is to use AJP. Hence the wordpress.conf file in /etc/apache2/sites-enabled has:

JkMount / ajp13
JkMount /* ajp13
JkUnMount /blog* ajp13

This means that the default context (/) and everything below it is given to the mod_jk plugin to send to Tomcat. The JkUnMount means that /blog is left for Apache to deal with.
In /var/lib/tomcat6/conf/server.xml the Connector element for port 80 is commented out and the Connector element for AJP/1.3 on port 8009 is commented in. I left the Connector for 443 (HTTPS) in for Tomcat because I decided that I didn’t want to deal with the details of connecting SSL through Apache to Tomcat and I don’t yet need it.
You will also need to setup the /etc/apache2/mods-available/jk.conf to configure mod_jk. Rajeev Sharma’s instructions work perfectly. Lastly, you will need symlinks in /etc/apache2/mods-enabled to both jk.conf and jk.load.

I used the WordPress instructions for creating a network so that I could have two blogs. The way to do this is to setup the root blog at /blog following the normal instructions. You then create the network blogs (/blog/site and /blog/technical in this case). The problem is that you now have a blog at /blog that you may not want. To fix that I added the following rules to /etc/apache2/sites-available/wordpress.conf to redirect traffic for /blog and /blog/ to /blog/site.

RewriteRule /blog/$ /blog/site [R=301]
RewriteRule /blog$ /blog/site [R=301]

I wanted to use the Google FeedBurner service to track the blog subscribers and all the other useful things that service provides. I burnt the feeds for my blogs at Feedburner and then used the MyBrands service so that the resulting links are and so on. The FeedBurner FeedSmith plugin works great to change all your public links to point to the new feeds. For a network install you have to Network Activate it and then go to each blog to activate it there.

Lastly, I used ThemesPress to create a theme from my existing HTML (hat tip to Patrick McKenzie for that). That’s why the header on the blog matches the hedear on the main site (except for Cufon not getting the fonts right, grrr)

Posted by Edward Sargisson | in Uncategorized | No Comments »


Apr. 20th 2011

Welcome to the Technical Blog.

On this blog I will be talking about matters that software developers my find interesting. I have in mind posts about using StringTemplate and Spring, how to set up these blogs, etc.

For all other news about the site or the business please see the Site Blog.

Posted by Edward Sargisson | in Uncategorized | No Comments »
  • Get Trail Mapping Tips

    1 email every 1-2 months
    * = required field