Adventures in the Cloud

So, I recently signed up for a Rackspace Cloud Server and Rackspace Cloud Files, and Amazon AWS S3 and Amazon CloudFront in order to serve my files on a CDN. So now all of the files on this blog are being served via Amazon S3 and the web hosting is being handled by my own Rackspace Cloud Server, which I configured myself (Apache, PHP, Firewall, etc). This is because I was tired of admining my closet server and worrying if a power outage or cat in the middle of the night would disconnect it from its power supply.

I’ve spoken about cloud hosting before, but now (despite the rocky road I went down) I am very much a fan of super fast cloud served sites. It was a little bit of hassle to get started, especially moving all of my content off of my original site and editing the database. Move over Dropbox?

This post isn’t intended to be a full-scale tutorial on how to get up and running with a CDN on a WordPress blog, more just a few things to “note” along the way in your quest for super fast (super cheap?), media rich, CDN hosted site. So, you could actually just use Dropbox‘s “Public” folder to host all of your media files on a CDN. It’s easy to do, and there’s lots of good tutorials out there on how to do it. There are even plugins for WordPress that one can use to automate the whole process.

For me though, I found that Dropbox did go down more often than I wanted it to and while it was still a cloud service (I don’t know which backbone they piggyback on) it was still a little slow (for a CDN). Beggers can’t be choosers though, it is a free service :) and it’s not even really intended to be used in the way that I was using it. It is easy to update a site’s files from your desktop/Dropbox folder and it would always guess the mime-type of a file with good accuracy. I’d like to delve into that last point a little bit.

If you’re using HTML5 video tag on your site, you already know that your video file is delivered straight to the user’s browser and it’s up to the user’s browser to handle the playing of said file. This is different from using a player (like Flash) to play/embed a video file on a site. You may also know that some browsers will play the video codec H264 and others like open source codecs like WebM and that there isn’t a browser out there that plays both codecs. So, we must serve two video files with two different codecs and let the browser choose which one it wants to play. The key is in the headers of the video file. They must be sent correctly (particularly for FireFox) in order for the file to play. Rackspace does not do this and Amazon S3 trys but doesn’t always manage. Hopefully the video below will help me explain myself (provided you can all view it correctly! ;)

I found this to be a real pain when using Rackspace to serve my video files as I’m sure others have as well. The situation is a bit better over at Amazon (but still not as good as Dropbox which never failed me). With Amazon, one must go into the Amazon control panel and make sure the file is being served with the correct mime-type from time to time.

The other thing to “note” about my adventures in the cloud is speed in which the edge servers update. I have found it rather annoying updating say a CSS file only to have it populate to the cloud over 24 hours later. This is fine once the file is up and running in the cloud, but very annoying for development. I recommend putting everything in the cloud when you are ready to go live and develop JS and CSS files locally.

Lastly, file permissions: at least both Rackspace and Amazon have a tool that allows you to select all of the files in a “bucket” or “container” and make them publicly available (so that they may be served on the web). Still, it did take me a few minutes to figure that one out coming from the land of Dropbox. :) The wording of the errors helped. Whenever the mentioned permissions, I just went into the control area in Rackspace’s tool and changed the permissions to publicly available.

I hope that this helps somebody from pulling their hair out! :) Have a great day. I need to get off the computer and out in the mountains!!!

» 3180 days deep