The Benefits Of RTFM(s)

6 commentsWritten on August 28th, 2011 by
Categories: Opinions

I've been unhappy with my hosting company for the past 2 years or so, but there was one thing that prevented me from moving somewhere else: I had no idea what i would have to do to get my site working on another host. I was using Dreamhost and they've always done everything for me. From the initial WordPress install on one of their shared servers, to the move to my first VPS, to the second, third, and fourth. They always took care of everything. And while i wanted to move, i always thought it would be a real pain in the ass to get everything working on a new host. That 'everything' is actually only Google Apps For Your Domain and Apache/PHP/MySQL/Wordpress.

This weekend i finally took the plunge. I signed up for a machine at Linode and first got started with my static company website, which is really just a placeholder at the moment until the nice-looking one is done. I knew that getting that up and running with Apache would be easy since it's just static content, but i also wanted to get URL redirection right. I have 2 domains for it: thatextramile.be and thatextramile.net. I wanted thatextramile.be to be the domain that hosts the website, and i wanted to make sure that all requests to www.thatextramile.be, www.thatextramile.net and thatextramile.net received a 301 redirect to thatextramile.be. The best way to do this is to use the mod_rewrite module of Apache, so i started reading its documentation and got that working pretty quickly. To do this, i also finally had to learn how to properly configure DNS records but that too turned out to be pretty easy.

After that i wanted to get a copy of my blog working on my new server, while still keeping DNS records pointed at the old one. So i started installing/configuring PHP and MySQL, imported a dump of my blog's MySQL Database and copied the WordPress installation from the old server to the new one. I modified my laptop's /etc/hosts file so it would resolve all requests to davybrion.com to the IP of my new server so i could properly test it. I wasted a bit of time here because of some file permissions, but once i noticed that everything just worked. And pretty fast too. I also made sure that all requests to www.davybrion.com were properly redirected to davybrion.com because Google tends to punish you in their rankings when they think you have 'duplicate content' and i don't want to reduce the traffic that Google sends my way.

At this point i was still waiting for Dreamhost to transfer the registration of my domain to DNSimple, which for whatever reason was taking a lot longer than the transfer of my thatextramile.net domain which was taken care of in just a few hours. While i was waiting i decided to compare the load times of requests to the blog on the new server with the time it took on the old server. I used YSlow and Google's Page Speed Chrome plugin for this. I was kinda hoping to get raw figures from those tools, but instead they both gave me a shitload of tips on how to improve the performance of the site. It certainly already felt faster than the previous server, but a big factor in that was probably the fact that the old server was located in California while the new one is located in the UK. But those tips got me to look into minification and combining of JavaScript and CSS files and putting it on a CDN with good future date expiration headers. That got me looking into the W3 Total Cache plugin for WordPress, in combination with using Amazon's CloudFront for static content. I haven't succeeded yet in getting every bit of JavaScript combined in one file because some plugins don't really play nice with the W3 Total Cache plugin, but in general most page-loads should cause far fewer HTTP requests and they should be dealt with more quickly than previously because of CloudFront.

So once all of that was working, i just wanted to 'turn the switch' and start using the new server for all requests, but the domain transfer still wasn't done. It then hit me that i could just change the DNS settings on the current registrar to point to the new server so i modified the A records for davybrion.com and www.davybrion.com to point to the IP of my new server. And that was all there was to it. Well, i also spent a bit of time in hardening the server but that didn't take long since i only have 2 publicly available services. Is it going to be totally secure? Of course not, but the number of ways to get in are limited enough.

So to recap: i did a lot of reading to understand what i needed to do, and i'm pretty happy with the results. I learned a lot of new things, finally moved everything to a new server that i have full control over, no longer have to deal with the shitty support from my previous host, and am paying the exact same monthly amount as i used to. Not to mention the not so unimportant part about the blog feeling a lot faster (though i'm not sure how fast it'll feel for non-european visitors). Sure, it could go down at any moment and it'll be up to me to fix it. At that point i'll read up on whatever i need to read up on and then just try to improve the situation.

The whole thing took me about 8 hours. Pretty sure it would've taken me longer if i hadn't taken my time on the reading parts because i would've spent more time troubleshooting the inevitable mistakes that i would've made.

Note: DNS changes are still propagating, so if you're reading this from a feed reader, the site may not work correctly yet for you. If you do happen to notice a problem, i'd appreciate it if you mailed me the details, preferably including the IP address that 'davybrion.com' resolves to on your machine and if possible, your local time + timezone info so i can look for matching elements in my logs :)

  • Pingback: The Benefits Of RTFM(s) : FRIENDDAT BLOG

  • Anonymous

    Have you considered using Octopress or Jekyl to generate a static html site?  I’m in the process of moving my blog there.  Wordpress is OK but I find it annoying.  Writing a blog with markdown and being able to imbed code from gists or the other jekyl code friendly developer pluggins make it very appealing.  You would need to migrate your existing posts though.

    • http://davybrion.com Davy Brion

      Haven’t considered those, but for a short while i was considering writing my own blog engine with node & express, also using markdown for the posts. I quickly gave up on that idea though, since it would take too much work and prove too few benefits, outside of it being quite fun to work on.

      For code snippets, i just use the SyntaxHighlighter plugin these days… Pretty happy with it.

  • http://davesquared.net David Tchepak

    +1 for Jekyll/Octopress. You can get it to format code using SyntaxHighlighter with Liquid Blocks too.

    If your existing posts are in HTML jekyll will be able to use them largely unchanged.

  • http://twitter.com/damienguard Damien Guard

    I tried a very similar setup but found that CloudFront was quite expensive and also not as fast as I’d hoped.

    Tried MaxCDN which was about $39 for 1TB/year whichever comes first. Performance was excellent too.

    [)amien

    • Tom

      I’ve used http://xtrahost.co.uk/ for the past 2yrs, no downtime. Pretty cheap also, £21 a month for Windows VPS… think £18 for Linux box. Also 24hr support by phone…(have used – as locked myself out of VPS early hours in the morning, very prompt response).

      P.S. (I don’t work for them, just think they are awesome)