Going down? @edfladung cars are just bullshit. Everytime you turn the engine over it depreciates in value. But at least you can exchange ownership. in reply to edfladung 8 hrs ago
Tags: , , , , , ,

So there’s been a lot of design around here lately. Some would say “too much.” So to balance it out, here’s some geek talk to keep the nerds happy.

Do you think Amazon’s S3 service is the best thing since sliced bread? A lot of people do, including myself. It cheaply and efficiently powers some of the biggest players on the internet including 37 Signal’s properties (Basecamp, Highrise, Campfire, etc) as well as Twitter.

For pennies a month, you can store gigs of your data in Amazon’s cloud, which they will then redundantly backup and distribute across the globe for quick access.

A little while ago, I started storing the images and resources that I use in posts on S3. My biggest gripe was that the URL or path was really long and ugly. So I decided to remap a subdomain of this site (http://s3.elihorne.com) to point to my S3 bucket (http://s3.elihorne.com.s3.amazonaws.com). I think we can both agree my path is better. It is very easy, and I’m going to show you how to do it too.

First of all, you need the ability to alter the DNS records for your domain. Almost all hosts allow this, but their user interfaces might differ. For the sake of consistency (and because it is what I use), my screen shots will be from Media Temple’s admin panel. Secondly, I’m going to assume that you already have an S3 account, and that you know how to create a “bucket.”

Step 1: Create your bucket.
This is going to be named exactly what you want your S3 path to be. If you want images.your-domain.com/image.jpg to work, then your bucket name HAS to be called “images.your-domain.com“. The upside to this is that also S3 bucket names have to be unique, across their entire site, so by appending your domain name, you are almost guaranteed that the name will be available (with very rare exceptions). I use Transmit from Panic to do this, but you can also use S3fox or the client of your choosing.

Step 2: Upload something so we can test it.
Upload an image or text file to the bucket so that we can make sure everything works.

Step 3: Change your DNS settings.
Add a record, and choose CNAME as the type. The port should be preset by your host, but mine is 43200. The name should be the subdomain you want to remap (ex: images.your-domain.com), and the data should be s3.amazonaws.com.

Media Temple DNS settings

Note that the trailing period is important. Media Temple automatically provides it for you, but if yours doesn’t, make sure it is there. Ok, hit “SAVE”.

Step 4: You wanted a step 4? Too bad, we are done.

It’s time to test! Fire open your favorite browser, type in the new subdomain we just remapped, plus the path to the test file you put on S3. For instance, if you stuck test.txt right inside your bucket, your path might be http://images.your-domain.com/test.txt.

Remember that you can create folders and directories inside your bucket, so you can keep your stuff organized. Since I remaped “s3.elihorne.com“, I have /img and /assets so that things don’t get wooly. You can also create an unlimited number of buckets, and remap other subdomains.

Go crazy!

Leave a Reply