Unexpected downtime

Posted by Tom Moertel Sat, 17 Jun 2006 22:49:00 GMT

My blog and the Community Projects site were down for about twelve hours yesterday. Both were hosted on one of my few non-RAID servers. As happens to servers from time to time, the poor beast suffered a hard-drive failure.

After a bit of diagnosing, I decided to decommission the server rather than repair it. Keeping a non-RAID system going isn’t worth the effort these days. Hard drives fail too often, and restoring from backup is too time consuming.

Most of downed server’s duties are now handled by one of its beefier, RAID-served brethren. I have opted not to move some of the low-priority services (e.g., the LectroTest mailing list) over just now. A new server should be arriving in a few days, and it will make a more logical home for these jobs.

Posted in
no comments
no trackbacks
Reddit Delicious

A simple Apache recipe for migrating blog articles to a new host

Posted by Tom Moertel Mon, 06 Feb 2006 22:52:00 GMT

In Everything old is new again, I wrote that I was moving articles from my old blog over to my new Typo-powered blog (here). Now that the process is underway, I need to make sure that people looking for my old articles can find them at their new home. To solve this problem, I am using a simple Apache httpd recipe to redirect requests for the old articles to the corresponding updated articles on my new blog. In case you need to do something similar some day, here is the recipe.

First, set up a mapping file

Create a two-column mapping file that you can use to map each article’s old location to its corresponding new location. If there are any parts of the locations that never change, you can factor them out to reduce clutter.

For example, the article “My New Radio VCR” has the following old and new locations (the constant parts are emphasized):

Old = http://community.moertel.com/ss/space/2004-02-20
New = http://blog.moertel.com/articles/2004/02/20/my-new-radio-vcr

Its entry in my mapping file looks like this:

# File: /path/to/conf/old-blog-to-new.txt
# Map articles from old blog to new blog.
#
# OLD LOCATION    NEW LOCATION
# .../ss/space/X  http://blog.moertel.com/Y

...               ...
2004-02-20        articles/2004/02/20/my-new-radio-vcr
...               ...

Second, configure Apache to use the mapping file

Edit the Apache configuration that controls the old locations. Add a set of mod_rewrite rules to match requests for the old locations and redirect them to the corresponding new locations, using the mapping file as a reference. For example, here is my configuration:

# in Apache's configuration for community.moertel.com

RewriteEngine on
RewriteMap blogmap txt:/path/to/conf/old-blog-to-new.txt
RewriteCond ${blogmap:$1|NOT-FOUND} !=NOT-FOUND
RewriteRule ^/ss/space/(.+) http://blog.moertel.com/${blogmap:$1} [R=301,L]

The first line makes sure that mod_rewrite is active.

The second line tells Apache to load the mapping file. Apache will cache the mapping file’s contents for speed, but it is smart enough to reload the file when modified. That means you can add new entries to the mapping file at any time, and Apache will act on them immediately, no restart or reload required. Every time I moved an article over to the new blog, for example, I just edited the mapping file, and the new location “went live,” replacing the old.

The third line says that the recipe is conditional upon there being a matching entry in the mapping file. If no entry exists, the recipe will not apply, and the request will be handled as usual.

The final line defines the rewrite rule. In this example, it tries to match requests that start with ”/ss/space/X_”, where _X is any suffix. (The prefix “http://community.moertel.com” is implied because this configuration is for the community.moertel.com site.) If the request matches, X is stored in the $1 variable. Then – and this is one of those things that makes mod_rewrite seem tricky – the condition defined in the previous line is tested using the current value of $1. If the condition is satisfied, the request is redirected to http://blog.moertel.com/Y_, where _Y is the corresponding location for X, according to the mapping file.

The [R=301,L] part of the rewrite rule is important. It specifies that redirects should be of the 301-Permanent variety. This advertises to the world that the new locations are intended to replace the old locations. Using permanent redirects also ensures that any Google juice that may have accumulated for my articles follows them to their new home.

Third, activate the new configuration

This part is easy: restart Apache to make sure it turns on the rewrite engine and activates the new configuration directives.

Finally, test it out

To see if everything is working properly, visit an article’s old location to see if you are redirected to the corresponding new location. For example:

If you click on this link, you should be redirected to blog.moertel.com.

And that’s the recipe.

Posted in ,
no comments
no trackbacks
Reddit Delicious

Everything old is new again: moving content over from my old blog.

Posted by Tom Moertel Sat, 21 Jan 2006 21:04:00 GMT

As you may know, a few months ago I moved my blog from its old system, powered by SnipSnap over to a new system, powered by the delightful and easier-to-hack-on Typo. Now that everything has been running comfortably for a few months, I am going to move some of my old blog’s content over to Typo.

At first I planned on writing a program to handle the move for me. It would pull from SnipSnap’s database, convert the markup of the articles, and drop the results into Typo’s database. After reviewing my old content, however, I have changed my plans.

My new plan is to cherry-pick the most interesting stuff and move it over. Some of the old stuff is too out of date or too tied to SnipSnap’s integrated wiki to be sensibly extracted and integrated into the new blog.

I’m starting the move today. If you see a “new” article that has an old date, you’ll know why.

Cheers,
Tom

Posted in
no comments
no trackbacks
Reddit Delicious

Top-ten weblog usability mistakes: My blog's scorecard

Posted by Tom Moertel Wed, 26 Oct 2005 20:51:00 GMT

Jakob Nielsen’s Alertbox for 17 October 2005 is Weblog Usability: The Top Ten Design Mistakes. In other words, it’s a top-ten list of things not to do on your blog if you care about usability.

Since I care about usability, I decided to test my own weblog against Jakob’s top-ten list. How did I fare?

Let’s see:

Top Ten Weblog Usability Mistakes
  1. No author biography: Fail. Oops, got me there. While I have a bio on the Community Projects site, I don’t even link to it from my blog.
  2. No author photo: Fail. Oops, again. I don’t have a photo of myself on the blog, nor on any other site (that I know of).
  3. Nondescript posting titles: Pass. I generally give my posts informative titles such as How to change symlinks atomically and Simple data formats are not going away. Only rarely do I use cutesy titles such as On the effortless cultivation of humility, where readers are forced to guess what the post is about.
  4. Links don’t say where they go: Pass. As a reader, I find “click here” links to be annoying, and so I avoid the practice in my writing.
  5. Classic hits are buried: Pass. I link to popular topics in the Popular Topics sidebar.
  6. The calendar is the only navigation: Pass. My posts are organized by topic as well as by date. Further, the ever-present live search makes finding posts by content easy.
  7. Irregular publishing frequency: Fail. I don’t have a regular posting schedule. When work gets heavy, for example, I rarely post.
  8. Mixing topics: Semi-Pass. I do mix up topics somewhat, but almost all of my topics fall into the category of “stuff programming geeks like” and in that regard are fairly consistent.
  9. Forgetting that you write for your future boss: Pass. I don’t think there is anything on my blog that a future employer would find troubling or even unprofessional. (Since I am a consultant, I have lots of “employers,” and so far none of them seem to mind what I post. Some – the crazy ones – even enjoy my blog.)
  10. Having a domain name owned by a weblog service: Pass. Since 1996 I have been keeping it real on moertel.com. My blog’s home is blog.moertel.com, which seems like the natural place for it.

In sum, I made three of Jakob’s top-ten weblog usability mistakes:

  1. I don’t have an author bio.
  2. I don’t have an author photo.
  3. I don’t post regularly.

The first two are easy to fix, and I’ll fix them right away. The third – posting regularly – is more difficult, owing to the ever-varying demands of my work load, but I’ll make an effort to pick up the pace. Hopefully, my blog will 100 percent “Jakob compliant” in the next day or so.

Do you have a weblog? If so, how many weblog usability mistakes do you make? Grab Jakob’s top-ten list and find out.

Posted in , ,
no comments
no trackbacks
Reddit Delicious

I have moved my blog over to Typo

Posted by Tom Moertel Thu, 25 Aug 2005 20:41:00 GMT

SnipSnap no longer makes me happy, and I am switching my weblog over to the Typo weblog system and moving it to blog.moertel.com. I like Rails, and Typo is Rails-based coding at its finest. And Typo has a future. Besides, I want another opportunity to take a perfectly good website theme and destroy it with my utter lack of design acumen.

As far as content goes, I will move my old posts over as time permits. For now, you can read them on the old site, which will remain up. (The Community Projects are still hosted there.)

If you are subscribed to my old feeds, don’t worry: Apache trickery will automagically redirect your RSS reader to my new feeds here. If fact, if you are reading this, you are already getting the new stuff.

—Tom

Posted in ,
6 comments
no trackbacks
Reddit Delicious

Older posts: 1 2