Hacker News new | past | comments | ask | show | jobs | submit login
Deploy Websites on Amazon S3 using Jekyll and Git (openfoo.org)
78 points by soren on Feb 20, 2011 | hide | past | favorite | 17 comments



This is a very useful writeup.

But using S3 for static sites comes with a big caveat: You can't host root domains on it because you need to use a CNAME to point to S3. And a CNAME must be a subdomain; it can't be a root domain.

I set up a petition to Amazon to point out the problem:

http://act.ly/34u


Put WWW. on it and as a temp fix use someone like Nearly Free Speech to host the root domain with nothing but a redirect on.


I don't want a www. on it.


OK, don't then. I was just suggesting a temporary fix as its unlikely Amazon will fix this any time soon.

Also be aware that their are benefits to hosting your site on www. - its not just for historical reasons. e.g. the ability to restrict cookies to the subdomain - which you can't do with root domains as it affects all subdomains also.

Not to mention people will some people will still go to www. by default anyhow so you're always going to have to have a www.


which you can't do with root domains as it affects all subdomains also.

rfc2109 disagrees:

  A is a FQDN string and has the form NB, where N is a non-empty name
  string, B has the form .B', and B' is a FQDN string.  (So, x.y.com
  domain-matches .y.com but not y.com.)


That's his point, setting a cookie on the root "domain.com" will mean it's sent to "www.domain.com" or "blog.domain.com" as well. You mostly do not want this.


Ahem, the text states the opposite of his point.

However, I was a little tongue-in-cheek there. The RFC disagrees, but browsers have been doing it wrong for as long as I can remember. So, in practice he's right... ;)


Why not?


The plan of having every single website in the world get its own elastic IP address is just downright silly, and is totally untenable in a universe where IPv4 is depleted and we still don't have IPv6. This isn't just a limitation of S3, or even of other Amazon products like CloudFront or Elastic Load Balancer: this same limitation exists when you graduate to "big boy" status and start messing with things like Akamai.

Look: the technology was designed in a certain way, and in this ecosystem (which you can't fix) you need to have a www. on your hostname. People need to learn to deal with this, and to get over their arbitrary hatred for "www." (a string that user studies, for the record, show really helps normal end users understand that this weird thing they are looking at is actually something they can type into a web browser).


Hi Luigi, this is what we call the "zone apex" issue. We're working on it

See my Route 53 post at http://aws.typepad.com/aws/2010/12/amazon-route-53-the-aws-d... from last December when I first mentioned this.


I setup a so-called naked domain and pointed it at an Amazon S3 CNAME just fine.

I believe the big downside is that I'll never be able to use email on that domain because of the CNAME. Which, for me, wasn't a big deal.


Email works just fine because mail uses an MX record (http://en.wikipedia.org/wiki/MX_record). (Sort of related: You can also CNAME the records that MX records point too.)


I just set up something very similar last night, without git. I used http://s3tools.org/s3cmd in a simple bash script, which nicely replaced my previous rsync setup. Should be about $0.01 a month to run :)


Thanks for the pointer to s3cmd - very useful.


This host-your-site-on-s3 stuff inspired me to write a simple static site generator that I can evolve with my needs. I've been using soywiki a lot, so I built it to use a "site" namespace in my soywiki and am using watchr to figure out when to regenerate the changed pages and send off to s3. Here's the page that is generated: http://zackhamcom.s3-website-us-east-1.amazonaws.com/

If this seems interesting to anyone let me know, I'd love to chat about it or collaborate on it moving forward.


BTW, since you just remove the clone of the repo right after copying the working tree, consider using 'git archive' piped to tar instead.


Dr. Jekyll and Mr. Git? I guess at least it brings out the contrast more clearly than Stevenson's original title




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: