Hacker News new | past | comments | ask | show | jobs | submit login
Host Your Static Website on Amazon S3 (aws.typepad.com)
315 points by soamv on Feb 18, 2011 | hide | past | favorite | 92 comments



Couple this with tools like Jekyll or nanoc (with JavaScript-powered comments, perhaps) and you can easily roll out powerful static sites that are dynamic locally. I can see this getting a lot of use because it makes it so easy to rig up new sites right from the shell. It was already pretty easy but the ability to create a new "site" by merely creating a bucket on S3 reduces the friction even more.

(Perhaps too easy, even.. Rig up a domain registration API, content generator, and an S3 uploader and you could have a script pumping out auto-generated "content" sites all day without any hassles right from your terminal window.)


I think for many personal websites Jekyll[1] style static website generation is going to become very popular. Previously you were always limited by a few dynamic parts of your site such as comments, newsletter registration and questionnaires but now between services like Disqus, MailChimp and Google Docs, you really don't need to pay for any of that anymore. All the dynamic parts of your site are external.

The only cost now is hosting the website at S3 and those costs are substantially lower than competitors. NearlyFreeSpeech[2] is the closest web host to S3 that I can think of and their prices for storage are $10/GB ($0.01 per megabyte month) whilst S3 starts at $0.140 per GB. If your site gets hit incredibly heavily Amazon S3 will also handle the load transparently. If you find that your site is becoming popular in Europe or Asia than it's also supremely easy to push your site from S3 to CloudFront.

I wonder how far you can take this though? How complex a site can you set up using only static hosting and external dynamic services like Disqus, MailChimp and Docs?

[1] https://github.com/mojombo/jekyll/wiki [2] https://www.nearlyfreespeech.net/services/hosting

[EDIT] As TeHCrAzY said I ovestated the cost of bandwidth transfer but whilst bandwidth falls rapidly it still falls slower than S3 (at ~10TB of transfer it approaches S3's starting price). More importantly I realised I undestated the cost of storage - it's $10/GB and not $1/GB making it closer to 100 times more expensive than S3.


Thats a bit unfair on NearlyFreeSpeech: the first gigabyte is a dollar, but the second is $0.870, and it drops from there.

From [2] in the parent post: After you've transferred You get up to 1 GB 1GB / $1 ($1.00 / GB) 10 GB 2GB / $1 ($0.50 / GB) 100 GB 3GB / $1 ($0.33 / GB) 1,000 GB 4GB / $1 ($0.25 / GB) 10,000 GB 5GB / $1 ($0.20 / GB)

Check out https://www.nearlyfreespeech.net/services/bwcalc for a calculator.


Good catch, thank you.

I also noticed that I'd stated the storage cost as $1/GB whilst it's actually $10/GB (specifically $10.24/GB or $0.01 per megabyte per month) which means that S3 is really far ahead if your site has any substantial amount of content.


The downside to the simplicity of using Disqus for comments is that you lose all your SEO effect from the iframed-in comments - for many blogs the Google-friendlyness of the comments is what drive most of their non-family-and-friends traffic.


How about a service with js commenting that alerts a trusted server of the comment? Server grabs the static html, appends the comment, pushes the new html to s3, bada-bing-bada-boom.


You don't need to even do it with javascript you just need to have a form that submits to your server (like say through a cgi script) which then updates the static file on s3.


So we've gone full circle now.

Phase 1: Everyone has a static page, without JS, but with animated gifs, counters and guestbook scripts linked from other sites.

Phase 2: PHP becomes popular, static sites are suddenly 'lame', as everyone wants to show off their server-side skills. For some sites, even the CSS and JS, and images are generated dynamically on the fly.

Phase 3: Improvements to JavaScript make it possible to replace server side HTML, image and style generation with the same on the client side.

Phase 4 == 1: You don't need Javascript, simply re-generate the HTML and re-publish it on the site using a script. Sites integrate externals widgets, but somewhat less clunky than before by using JS tricks instead of iFrames.

We're back to the 90's :)


Hell we've even got sites like Gawker re-implementing frames in JS so they can get all that '90s annoying-ness while still telling themselves they're on the cutting edge.


    Previously you were always limited by a few dynamic 
    parts of your site such as comments, newsletter 
    registration and questionnaires but now between 
    services like Disqus, MailChimp and Google Docs, 
    you really don't need to pay for any of that 
    anymore. All the dynamic parts of your site are 
    external.
Is there any good external forum system (google group isn't it due to spam)?


You can just use HN with my little Ycomments hack:

http://will.m.aier.us/ycomments



Yeah but there's still a 100 bucket limit on accounts. That makes it hard if you want to extend this to a product of some sort.


You can create multiple AWS accounts and then link them together for billing purposes with the AWS Consolidated Billing feature.


I'm in the process of converting from Wordpress to Jekyll right now. This announcement made me VERY happy.


nice, let me know if you need any help. i did the same thing a month or two ago and wrote a guide about it.


would love to see the guide, if you're inclined to share it widely...


yeah sure: http://paulstamatiou.com/how-to-wordpress-to-jekyll

it was on HN not too long ago



I relied on Paul's guide for a lot (thanks paul!). The one difference is I exported the Wordpress posts to XML rather than grabbing the database.

Daniel Hoelbing's Importer.rb will do that for you. http://www.tigraine.at/2010/10/01/goodbye-wordpress/


Thanks, I'll definitely ping you if I run into an issue. Your guide is very comprehensive - I appreciate the help!


Pumping out content sites is easy enough. Terminal window would actually be a barrier to entry there :)


You've been able to do this for a while now with CloudFront serving your S3 buckets - I'd suggest the few extra cents per month for the CloudFront CDN service is probably a better way of managing static Amazon hosted sites...

(curiously, the domain name I experimented with this on late last year is strangely appropriate here: http://www.damhik.com/ )


That's not entirely true. With cloudfront, you were able to set that when you goto http://example.com that it would send you to http://example.com/index.html. However, it would not support you when you accessed http://example.com/dir/. That would not redirect to http://example.com/dir/index.html.


That sound you hear is the collective groan from every oversold cheapo shared hosting company owner.

Unlimited hosting for 5 bucks? How's world class with a CDN for 45 cents?


Plus, Amazon doesn't say "unlimited" and then turn around and say "haha oops there are pretty low limits after all!" when you get Slashdotted. Their pricing is transparent. The cheapo shared static hosting providers are now officially the living dead.


Unless they rebuild their cheap static hosting company on top of s3 with some value add. Worked for heroku very nicely.


Sorry if I sound naive about the term 'unlimited' here, but what are the implications of your comments [1]? I see that S3 does not offer a flat-fee, 'unlimited' model at all [2]. In fact, if my math is right 5 bucks only gives you $5/($0.1/GB) = 50GB of data transfer (forgetting about the other costs).

Edit: I didn't see the 'data in' vs. 'data out'. I think it's actually worse: the first 1GB out free, and 33.33GB extra at $0.150/GB. So 5 bucks doesn't quite give you 35GB!

[1] My guess is that with this 'unlimited' you'll never get even close to 50GB of monthly data transfer.

[2] http://aws.amazon.com/s3/#pricing


Are cheap static sites really that big of a break-through? Whether a site is 50 cents a month through Amazon or $20/month for dozens through Linode (with the option of non-static), doesn't seem to matter that much to me when most people spend well over $20/week for coffee. The lowest-paid programmer in the US can make $20 in an hour. Anyways, love all the services that Amazon puts out and this is definitely a nice option, but I don't see it as exciting news on an individual basis. Anybody agree?


Agreed. I think it's less about cost, and more about scaling. Not to have to worry about scaling is interesting.


Definitely, I can see the potential, particularly in terms of building services on top of this feature. Will be interesting to see how it is leveraged.


I think is this bigger news than it seems as this enables many other new services to now be built on top of S3.


Yep. Just wait until Dave Winer gets going with this :)



It's still impossible to host the root domain of your website on S3/CloudFront or serve it through an EC2 Elastic Load Balancer.

www.mycompany.com - OK mycompany.com - needs an EC2 instance and Elastic IP

This is because the only way to point your domain at Amazon is with a CNAME record and DNS does not support default CNAME records. It can only work if you add your CNAME record to the 'com.' top-level domain, which is impossible. See https://forums.aws.amazon.com/thread.jspa?threadID=32044


That is easily solved by doing a permanent redirect (301) from mycompany.com to www.mycompany.com. Many DNS providers such as Godaddy.com have a free redirect service just for that purpose.


Do they? I have to look for that, I've been sending all those to a server of mine for that purpose, but if that server goes down or shuts down or anything, my redirects will stop working. Thanks for the info!


See http://www.wwwizer.com/ , hosted on EC2 btw last I checked.


I'm thinking of making a paid version of this, with multiple IPs in each region. I registered rootredir.com. Are any of you interested in this? How much would it be worth to you per month?


Fantastic, thank you. I thought of making something like that, but now I don't have to!


Still a dealbreaker for me. I don't want people to bookmark or search engines to crawl my domain prefixed with "www". That seriously offends my sensibilities.


And this will be one big reason why I wont move any of my sites there. I prefer non-www to www.


May I say "awesome" and "finally"? That's awesome. Finally.


Speaking of finally, I wonder when they're going to add proper support for "Content-Encoding: gzip". Last I checked, people would upload gzipped content and add the Content-Encoding header on top, which is inconvenient and doesn't support browsers that can't handle gzipped responses.


Honest question: which browsers can't handle gzip'd responses?


IE6 has problems with cached Gzip files: basically it forgets they're Gzipped in the cache and then drops the Content-Encoding part of the file. So it loads garbage as far as the JS interpreter is concerned.


I've had issues with gzip and wget, though I don't know if that was just a mis-configured site or something (and wget isn't a browser).


I definitely want this feature as well. But I feel like it won't happen for a while because to make this happen Amazon incurs additional overhead for caching the gzipped version.


I'd like to reinforce the "finally". This has been requested on the AWS forums for years.

However, the fact that AWS crushes entire business models with every move they make relativizes their slow pace somewhat.


And I wouldn't say they're slow, on the contrary. They've been adding features to AWS like clockwork for like 6 years now. Every few months, they add something that a large amount of people love. And then it just works. That's awesome. They're running a marathon, not a sprint, and doing awesomely well so far.


So, who is going to be the first person to create a new static hosting provider built on top of S3?


Or use App Engine and get pretty URLs, stats, etc as well:

https://github.com/stochastic-technologies/static-appengine-...


Do they also give you the server logs? e.g. access.log


Yes, s3 buckets let you specify a bucket for logging and they include things you'd expect like IP address, referrer: http://docs.amazonwebservices.com/AmazonS3/latest/dev/Server...


s3 has provided access logs for a long time.

http://docs.amazonwebservices.com/AmazonS3/latest/dev/Server...


So now you could build a pretty serious web application with frameworks like Backbone.js and host it for pennies, very cool.


I ported my site to jekyll last night and moved to S3 for hosting. Then I realized that my .htaccess file wouldn't work so I couldn't redirect some links I wanted to keep.

I'm mostly a product guy, and the entire experience of setting up jekyll was exhilarating.

S3 was pretty easy to set up for hosting.

http://iamnotaprogrammer.com.s3-website-us-east-1.amazonaws....

But, I moved the site back to linode for htaccess to work. http://iamnotaprogrammer.com


Maybe this is a good place to ask about an idea I've been toying with, but I'm not sure about the security implications of.

I have an app that generates user content, little chunks of audio. I don't want to get into running some server infrastructure just to let users share their content on facebook/twitter/... so what about letting the app upload an html file to an s3 bucket, with the data embedded in the file and a bit of javascript for an audio player UI? Practical?


If the html file is self-contained, sure. Basically, if you can serve it from a static directory and have it work, it'll work on S3.


http://sociablelabs.com has been doing this for a little while now and I've been pretty happy with the performance,


This could be useful if your site has an extended outage one day. Create a bucket called "mysite.com" and another called "www.mysite.com" and put your failwhale page in it (set to be the root page). If your site goes down and you know it will be down for an extended period (ouch), you can change your domain's DNS entries to point to s3.amazonaws.com. Then at least your customers will have an explanation.


It would be great if someone could build a routing service (ala .htaccess on the cloud), so that we can make use of S3 without breaking the URLs.


How's www.mydomain.com vs. mydomain.com handled?

Do I need to create two S3 buckets with duplicated content?


Its pretty easy to redirect mydomain.com to www.mydomain.com (or the other way around) through your domain registrar these days.


...or you have your domain registrar doing the redirection for you automatically when setting up the DNS for S3:

http://iwantmyname.com/services/developer/setup-custom-domai...


This is awesome, but there is one thing I wish could be changed.

I currently host my (Jekyll-powered) site with S3/CloudFront. The error pages is awesome, but it only works if accessed through S3, not CloudFront.


The article talks about custom 4xx error pages - what more do you need?


If your site is accessed through CloudFront, those custom error pages don't come into effect... as I clearly said.


This is perfect for auto-scaled hosting a Cappuccino app, so the server cluster can be focused only on the backend.



I gotta give Amazon props for extending their products along the lines that their customers clearly want. The only problem is, given the wikileaks affair, I don't trust them.

Maybe this is silly. It is certainly not like they're likely to pull down any of my stuff. And I do have some largish files hosted there for convenience, but I'm wary about becoming dependent on them in any way.

(Wikileaks was hosting their webpage on amazon, not the leaked cables themselves. Amazon pulled their account without having gotten a court order or giving them any warning, and they weren't hosting anything illegal there anyway.)


I am not an Amazon supporter but come on, do you think if you were hosted on any other US service, rackspace or what have you, that they would keep hosting you while the us govt was pressuring them to shut you down?


For static websites? I'd expect http://nearlyfreespeech.net/ not to do so.


Thats the thing about integrity. You never know if someone has it until it is tested.

This same question could be asked about any hosting company that hasn't been presented with such a request.

I'd be interested in hearing about hosting companies that have, and that stood up to them.

The US is supposed to be a country of rule of law. They should need to get a court order.


Dreamhost has a reputation for being pro-free-speech, and there are some anecdotes online that support this. Their TOS are also on the more friendly side, from what I've seen. I've also been quite pleased with their hosting in every other respect.

(disclaimer: founder is an old college friend)


hosting companies probably don't see value in standing up to the govt -- lawyers are expensive!

how much would you pay for this feature?


I'm so sorry that companies do not exist to promote your moral agenda.


Aren't you the same guy that was "ecstatic" that Apple was taking a 30% cut of subscription revenue? Here you're worried about Amazon's easily-replaced static file hosting service, while having no problems becoming 100% dependent for key parts of your business on Apple. You criticize Amazon for censoring Wikileaks while Apple did the same (wikileaks app was pulled).

Sorry, I just had to point it out. :)


Exactly!

Sometimes I just want to create some static pages, but I was forced to use either CMS or things like wordpress.

Now I guess there is a solution which is also super reliable.

AWS is just amazing.


> Sometimes I just want to create some static pages, but I was forced to use either CMS or things like wordpress.

Wtf?! To create static pages, I open Emacs and type there. No need of a CMS or Wordpress to create an HTML page!

Then to host it:

  scp page.html me@srv.com:~/public_html/
and you're good to go.

Hosting a website on S3 is nice, but it's not simpler than what is already possible if you own a server. If you don't already own one, I'm not sure setting up an AWS account + client code is easier than creating a new VPS account. I surely would prefer to set up a Linux VPS, which is an environment I'm confortable with.

Regarding the costs, I rent one private (not virtual) server for 20 euros/month, and host several (static and dynamic) sites on it, so it's actually cheaper than going the AWS road. Uptime last time I logged: 560 days (aka reliable enough for me).


You misunderestimate the ineptitude of unwitting sysadmins such as myself. It takes me days to set up a VPS. It took me a good few weeks to figure out how to get Django working. I screwed up my latest VPS so badly that I had to scrap the thing and start again.

Some people really suck at these things.

> Regarding the costs, I rent one private (not virtual) server for 20 euros/month, and host several (static and dynamic) sites on it, so it's actually cheaper than going the AWS road. Uptime last time I logged: 560 days (aka reliable enough for me).

S3 will cost literally pennies for hosting a simple static website. A VPS is orders of magnitude more expensive.


The cost of S3 is around 0.1 euro per gigabyte. For the amount that you are currently paying per month, you could serve 200 gigabytes through S3. Of course, that doesn't include storage costs, but those should be negligible for static sites.


s3 is the new geocities:P


As entrepreneurs at what point do you decide that Amazon is "too big" and do you decide to stick with smaller service providers? Is your use of Amazon strictly a commodity provider?


What do you mean by "too big"? I guess what I'm wondering is what about that would motivate switching to smaller providers.


This probably deserves a separate discussion.

As an entrepreneur do you also use other entrepreneur's/start-up's services or just rely on the big (market share) players in the market? A startup is hard so do you go out of your way to help support other smaller service providers?

If you have an opportunity to support competition in the marketplace by not flocking to the lowest price(Walmart) but paying a bit more for a smaller service, do you make that sacrifice?

Knowing that NearlyFreeSpeech.Net appears to offer similar functionality, why choose a larger provider like Amazon if you have the mindset of a founder?


No part of the mindset of a founder requires you to select inferior alternatives out of empathy for the people who provide them.


Nah, the only reason to go with a startup is if it's better than the big guys, or you need personalized service, or you think they'll move much faster than the big guys, and it would block you otherwise.

If they're not much, much better than the incumbents they're competing with, they're going to go out of business, leaving you with a broken dependency.


Better customer service. Small companies usually make it possible to get to speak to a real (and knowledgeable) person quickly in case of a problem. They really value their customers because they have a problem when they leave.

Try doing that with juggernauts such as Google or Amazon.


When their service becomes unacceptable. It has nothing to do do with "bigness." We all use Google, after all.


Except when we use DuckDuckGo.


This is nuts. It's nice to see the internet being increasingly commoditized -- hell, Amazon has commoditized people.




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

Search: