Bye Bye Wordpress

18 May 2014

I've finally made the move to jekyll for building this site. It is now hosted on github pages, comments are handled by disqus and my post source is written in markdown. My entire site is visible on github and revision control for post entries is handled there too.

What finally convinced me with the release of jekyll 2 was the introduction of native sass support. Originally, the prose theme I'm using for my site was using scss, which I later ported to a wordpress theme in order to blog with it. I had the scss for the original design available and therefore thought the jump to using jekyll wouldn't be that great (or so I thought - overlooking all the features jekyll doesn't support compared to wordpress). I'm going to blog individually about the pieces of the puzzle in other posts as there are number of things that tripped me up along the way.

But for now, I'd like to bid a fond farewell to wordpress - my go to blogging software for the last 10 years. You once were diminutive, got out of my way and let my voice be heard. That's no longer the case. These days the only time we speak is when you want me to update you. I've got better things to do. Theres a ton of features the length of my arm which I've never used and the majority of features which I use rarely. I long for those simpler days once again. You've served me well, but I've moved on.

Tagged jekyll, static sites, wordpress, | Leave a comment

Hosting an Octopress Blog on Amazon S3

09 Sep 2011

Octopress is a framework for blogging based on the static site generator jekyll. In short jekyll takes markdown and turns it into blog style html ready to be served straight away with Apache whilst Octopress dresses it up nicely with HTML5, responsive layout goodness and gives you a bunch of options for code formatting and the like. A perfect little blogging setup for hackers for those of us who typically won’t need all the bells and whistles on our blog I’m sure you’ll agree.

Using Octopress, you’d typically write your posts in markdown and process them locally. You’d then have a number of HTML pages to upload to your web server, which would appear no different than any other blog in terms of functionality.

The most interesting thing that coincincides with the creation of jekyll is that it is now possible to serve static websites straight from Amazon S3, meaning that it isn’t neccessary to have a web server to serve a Octopress blog. I’ve been playing a little and have been able to serve my own octopress blog which you can see over at www.ianwootten.com. Here’s how to do it:

Configure an S3 Bucket to Act as a Website

NB: If you want to use your own domain, then you’re going to need to create an S3 bucket from the AWS Console named the same as your domain (so for me I created a bucket called “www.ianwootten.com”.

To configure your bucket as a website, from the AWS Console, select the new bucket and click “Properties”. Choose the “Website” tab from the box that appears and check “enabled” and set the Index document as “index.html”. Click “Save”. Now move to the “permissions” tab and click “Add bucket policy”. Enter a policy as below, with “www.ianwootten.com” replaced with the name of the bucket you’re using.

<br /> {<br /> "Version": "2008-10-17",<br /> "Id": "",<br /> "Statement": [<br /> {<br /> "Sid": "PublicReadForGetBucketObjects",<br /> "Effect": "Allow",<br /> "Principal": {<br /> "AWS": "*"<br /> },<br /> "Action": "s3:GetObject",<br /> "Resource": "arn:aws:s3:::www.ianwootten.com/*"<br /> }<br /> ]<br /> }<br />

If you’ve opted not to use your own domain, then that’s it for S3. Your new bucket website will be available at a combination of the bucket name and the S3 storage location. In my case, this is http://www.ianwootten.com.s3-website-us-east-1.amazonaws.com/. There’s a list of endpoints on the “website endpoints” page in Amazons S3 website docs.

Configure DNS

If you’re wanting to use your own domain, then you’ll need to visit your domain registraar and edit some DNS entries. In my case, I added a CNAME entry “www” pointing to www.ianwootten.com.s3-website-us-east-1.amazonaws.com. You’ll need to use a tool like wwwizer in order to forward from the root of your domain to the www subdomain. e.g. “ianwootten.com” to “www.ianwootten.com”. To get that working, you’ll also need to modify the @ A record and point it to 174.129.25.170. Read this serverfault post if you’re interested to know why.

For more info on CNAME configuration and S3 see Amazons S3 website docs (Specifically the notes on virtual hosting).

Download Octopress and write some Markdown

Having successfully configured Amazon S3 to host your blog, you need to tackle the age old problem of writing some content for it. This was particularly hard for me, given my lack of knowledge about markdown! You may like to take a look at John Grubers explanation of markdown if you’re suffering like me. The Octopress blogging basics gives a good overview of how your new local blogging workflow will work. Essentially new posts are written in the ./_source/posts folder and when rake generate is executed, your entire websites content is output to the ./public folder. You can also run rake preview in order to preview on a local server.

TO publish your blog, it’s merely a matter of transferring your /public content to the S3 bucket you’ve generated.

Having done all that you’ve now no need to run your own server. You’re still dependent on those that operate at S3, wwwizer and your domain registraar, but you’ve removed your own from the equation. You may be interested in checking out Jerome Bernard’s tip on easily deploying Octopress blogs with s3cmd.

Tagged amazon, blog, blogging, godaddy, jekyll, octopress, s3, | Leave a comment