For I Like Juice, I posted episodes here on the blog, which for simplicity is using WordPress. For Montreal Sauce, however, I wanted to do some experimentation.
This is going to get technical.
In a future post, I’ll go into the actual audio gear I use, but suffice to say I follow fairly closely with Dan Benjamin’s Podcasting Handbook. Here I’m going to go into something the handbook doesn’t yet cover – hosting and distribution.
There are a lot of great options out there – Libsyn and SoundCloud come to mind immediately. I’m a programmer by day, and my tendency is to want to control the stack, so I thought I’d try to go a little lower level.
- Amazon S3
- Amazon CloudFront
- Amazon Route 53
- PieCrust with a few special modifications of my own
- And a couple little shell scripts that tie stuff together.
I use S3 to store the entire website at montrealsauce.com. It basically acts as the origin server for CloudFront. CloudFront then hosts the actual website: I use Route 53 to point the montrealsauce.com domain name at a CloudFront distribution.
CloudFront is a high-speed, rock solid CDN (Content Delivery Network). It’s ideal for the task of deploying web content like RSS feeds and MP3 files, which is everything I need to produce a podcast. Storage and bandwidth are very cheap using this combo of S3, CloudFront, and Route 53.
However, this setup does have a disadvantage: S3 (where I post all the “original” files) is for hosting static files. That means you can’t just up and run a script-driven, dynamic website like a WordPress blog or a Ruby on Rails app on S3: it won’t actually execute any of those scripts to generate content. Essentially the content needs to be “frozen” before S3 can do anything with it.
This is where PieCrust comes in.
PieCrust is a static website generator and lightweight CMS that’s all managed with text files. No complex setup, databases, or administrative panels. Simple, beautiful, and yummy. — Piecrust documentation
I use PieCrust to generate all the files, in the proper structure, for montrealsauce.com. PieCrust comes with a tool called “
chef“, which runs on the command line. When I’m ready to get a new episode posted to the site, I run:
chef prepare post this-is-my-post-title
chef creates a new file for the post in the proper place, and fills it in with some basic information like episode name, date, time of post, etc.
I then take that file and fill in the show notes, add the name of the MP3 file (for the RSS feed and the HTML5 audio player on the site), and then I preview things using:
This command takes my site’s configuration and post files, and creates a locally running web server program. Safari opens automatically and shows me a preview of my site, which I can click around and verify everything is set up correctly.
If I like how things look at this point, then I’m ready to deploy the site to S3. The steps to do that are:
chef bake– This creates a new folder that contains all the static files my website needs.
[s3sync](http://s3sync.net/wiki.html)– This command takes that folder and syncs everything up to the S3.
And that’s it: the latest episode will now be published.
The last few things I have automated. Because I’ve customized PieCrust slightly, and I have different configurations for the live website and the preview mode, I have a script called “
deploy.sh” that actually manages chef baking the site and deploying it out to S3.
There’s one other disadvantage of using CloudFront to host the site, and that has to do with the caching nature of CloudFront. In order to keep the site fast and save on bandwidth, CloudFront does not automatically go check to see if the S3 version of a file has changed recently. So when I publish a site, I have to tell CloudFront that a couple of files (index.html, and feed.rss, specifically) are new and that it should go fetch them.
CloudFront will do this eventually if I leave it to its own devices – I’ve got it configured to expire things within 24 hours. But eventually I’ll set up my
deploy.sh script to also tell CloudFront about the new files – automation is a lovely thing.
Here’s what my script currently looks like:
chef bake -c live -o _kitchen/montrealsauce.com
s3cmd sync --delete-removed --exclude '.DS*' --add-header="Cache-Control:public;max-age=28800" _kitchen/montrealsauce.com/ s3://montrealsauce.com/
It should be noted, as well, that if I wanted to, I could use WordPress with CloudFront. This would remove the S3 part of the equation, but I could host the site on a standard WordPress host and point CloudFront at that instead. I’d get many of the same speed benefits, and I wouldn’t need to use PieCrust.
I like PieCrust, though, and I like the advantages of using a static website: things are extremely fast on almost any host, it’s really hard to bring down because it doesn’t do anything complicated, and you can host it practically anywhere.
I’ve really enjoyed podcasting, and this experiment with hosting Montreal Sauce has been really fun. We’ll see where it goes as I expand my library of podcasts: doing a second one I may not go precisely this route.
Thanks for reading, and feel free to ping me on Twitter if you have questions or comments.