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:
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.
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... ;)
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.)
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).
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 :)
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.
18 comments
[ 2.4 ms ] story [ 49.8 ms ] threadBut 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
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.
rfc2109 disagrees:
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... ;)
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.
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).
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.
If this seems interesting to anyone let me know, I'd love to chat about it or collaborate on it moving forward.