Using Amazon S3 hosting with Wordpress

I want to provide downloadable and streaming videofiles to visitors, but my current hosting only provides me 1000mb. I could switch to a service with unlimited storage but I’m pretty sure those services slow down when there’s a lot of streaming traffic. After some research the best option I found was using Amazon S3. (Simple Storage Service) It’s scales with my needs, I can quit anytime, it’s reliable, fast and most importanly: I only pay what I use. On top of that I can make it look like it comes from my own server with CNAME records.

If you plan to use Amazon S3 as media hosting for your Wordpress blog, this article will show you everything you need to setup the hosting, and use a plugin to integrate S3 in Wordpress.

S3 Server Setup

  • sign up for Amazon S3
  • look up your Access Key ID and Secret Access Key
  • use S3Fox or another tool to create a bucket, use all-lowercase e.g. “media.vknt.be” of “turbo.vknt.be” or “s3.vknt.be”
  • add a cname record: ALIAS “media” POINTS TO “media.vknt.be.s3.amazonaws.com”
  • upload files

If this goes too fast read the detailed setup article, and more on virtual hosting.

Integrate S3 into Wordpress with a plugin.

With TanTan S3 you can upload files just like you normally would. You can use the wp-uploader, the media library and the gallery feature. Just one quirk: it can’t upload directly to s3. This means you still need an “uploads” folder, and you have to delete those files manually. The plugin duplicates the folder structure from your wp-settings, so I changed my upload folder from “wp-content/uploads” to “wp”. (Change this folder in WP Admin > Settings > Miscellaneous) That way my media content looks like this: http://media.vknt.be/wp/2009/02/myfile.jpg.

What’s next?

This setup can be optimized even further by using CloudFront. If you feel your website needs some extra punch, is suggest this introduction to complement your media server with CloudFront.

One Response to “Using Amazon S3 hosting with Wordpress”

  1. Stijn says:

    I did a little bit research about the Amazon Storage Service for a client a while ago. It’s most definitely one of the best and professional high-volume storage services on the web nowadays!

Leave a Reply

 

Copyright Valentijn Kint - All Rights Reserved