Posterous theme by Cory Watilo

Filed under: app

How to host a site on Amazon AWS S3, step-by-step

This is a collection of tips and tricks I learnt whilst setting up a static site hosted on Amazon S3 lately for one of my apps. Now, in all the instructions, make sure you replace ‘mywebsite.com’ wherever you see it with your applicable domain of course :)

Buy your domain

First buy your domain (not hosting). This should cost $10/year roughly. People recommend godaddy, but i went with unlimited-space because they didn’t charge extra for WHOIS privacy. However, they don’t supply DNS hosting, so you have to set that up separately.

DNS

Go to zerigodns.com and grab an account. Go into the DNS management and create a new domain: mywebsite.com.

In this domain, create two hosts, one with an empty subdomain, and one with a ‘www’ subdomain. The setup for these two entries should be as follows:

mywebsite.com
Type: A
174.129.25.170 

www.mywebsite.com
Type: CNAME
www.mywebsite.com.s3-website-us-east-1.amazonaws.com

The IP address against the ‘A’ entry is used so that anyone who forgets the ‘www’ gets send to wwwizer (a free service that requires no account), who will forward them to the ‘www.mywebsite.com’ which will properly forward them to S3.

Unless you bought your domain from someone who packages it with DNS hosting, you’ll need to connect your domain registrar with zerigo. You’ll have to go to your domain registrar (ie unlimited-space in my case) and set your nameservers to:

a.ns.zerigo.net
b.ns.zerigo.net
c.ns.zerigo.net
d.ns.zerigo.net
e.ns.zerigo.net

S3

In the AWS S3 console, make a new bucket called ‘www.mywebsite.com’. Right click > Properties on this bucket, and set up the following:

Bucket policy

In the ‘Permissions’ tab, edit the bucket policy to make it publicly readable. Set the bucket policy as per on this blog on ariejan.net, as follows:

{
  "Version":"2008-10-17",
  "Statement":[{
    "Sid":"AllowPublicRead",
        "Effect":"Allow",
      "Principal": {
            "AWS": "*"
         },
      "Action":["s3:GetObject"],
      "Resource":["arn:aws:s3:::www.mywebsite.com/*"
      ]
    }
  ]
}

Make sure you replace the ‘www.mywebsite.com’ above to match your s3 bucket name.

Website

In the website tab of the bucket properties, select ‘enabled’, put in index.html as your index document, and `error.html`` as your error document.

You will see the endpoint in this tab as well. It should look like www.mywebsite.com.s3-website-us-east-1.amazonaws.com. Just double check that it’s the same as the CNAME entry you made in your DNS settings.

That should be it! You’ve now got a static website for a fraction of the price of typical hosting. My rough calculations indicate that this should cost me ~$2 a year. Brilliant.

Hacker News Reader

I'm creating this app as a learning exercise for me, and to 'scratch my own itch' so to speak - to have a nice simple way to read HN from my iphone while pushing my daughter on the swing: Available in the app store

Hn134

Available in the app store here

I also intended from the start open-sourcing this so that people can have a look and learn with a nontrivial demo app. The more people that know obj-c/UIKit, the merrier! https://github.com/chrishulbert/HackerNewsReader

Shot
Attributions:

* Icons by app-bits: http://app-bits.com/free-icons.html

* FMDB sqlite wrapper: https://github.com/ccgus/fmdb

* ConciseKit: https://github.com/petejkim/ConciseKit

* ASIHttp: https://github.com/pokeb/asi-http-request

 

Australian Baby Colours

Baby-colours-icon-134

Click here to view Australian Baby Colours on the App Store

 

Teach your child the colours of the rainbow, with an Australian accent! 

  • No ads, never will be - i believe ads don't belong on kids games! 
  • No button to accidentally take your child to a developers website 
  • Settings button automatically hides after 5 seconds, so your child won't tap it accidentally 
  • Settings to mute the voice, use solid colours or coloured wallpapers, and to auto-hide the settings button.

Screenshots:

(download)

Attributions:

 

Baby Allergy Tracker

Allergytracktrans
This app is aimed at helping you keep track of which foods you have fed your newborn child, so that you can pinpoint any potential allergies.

Available in the app store!

Screenshots

(download)

Untried foods

This is where you can view your 'to-do' list of foods that you haven't tried yet.

When you feed your child a food, tap it in this list and select 'Mark as tried'. The food will then be removed from this list and appear on the 'Tried foods' list.

To add a new food, tap the '+' button in the top right.

To remove a food, swipe across its and tap delete.

Tried foods

This is where you can see your list of foods that you have tried, and take notes if your child has a suspected reaction.

To take notes if you suspect your child has had a reaction to a food, tap it in this list and select 'Reaction notes'.

Any foods that you have made any notes against will appear orange in this list.

To remove a food from this list and return it to the untried foods list, tap it and select 'Move back to untried'.

Reaction list

This is for viewing just the foods that have reaction notes in a convenient list.

To view further details about any food, simply tap its name in this list.

Important

Remember that this app is no substitute for professional medical help. You must consult with your family doctor, pediatrician, or nurse if you suspect your child is having an allergic reaction, or if your family has a history of allergies.

About

This app was lovingly crafted by Chris Hulbert (Splinter Software) for his wife and soon-to-be child. You can get in touch via email with any suggestions for how to improve this app.

See my other apps.

Icon by Laura Design.

Toolbar icons from app-bits.