We've added some new features to Amazon S3 to make it even better at hosting static websites.
Customers have been hosting their images and video for their websites on Amazon S3 for a long time. However, it was not that easy to host your entire website on S3. Why? If a user enters a site address (www.example.com) and the CNAME in the site's DNS record resolves to the root of an S3 bucket (www.example.com.s3.amazonaws.com), Amazon S3 would list the contents of the bucket in XML form. In order to work around this, customers would host their home page on an Amazon EC2 instance. This is no longer necessary.
You can now host an entire website on Amazon S3.
You can now configure and access any of your S3 buckets as a "website." When a request is made to the root of your bucket configured as a website, Amazon S3 returns a root document. Not only that, if an error occurs your users receive an HTML error document instead of an XML error message. You can also provide your own error documents for use when a 4xx-class error occurs.
Here's more detail on the new features...
Website Endpoints
To access this website functionality, Amazon S3 exposes a new website endpoint for each region (US Standard, US West, EU, or Asia Pacific). For example, s3-website-ap-southeast-1.amazonaws.com is the endpoint for the Asia Pacific Region. Existing buckets and endpoints continue to work the same way they always have.
Root and Index Documents
When you configure your bucket as a website, you can specify the index document you want returned for requests made to the root of your website or for any subdirectory. For example, a GET request made to the following URI (either direct or via a CNAME):
mywebsitedomain.s3-website-us-east-1.amazonaws.com/images/subdirectory/
Will return the following S3 object
mywebsitedomain.s3.amazonaws.com/images/subdirectory/index.html
Error Document
When you access a website-configured bucket through the new website endpoint, and an error occurs, Amazon S3 now returns a new HTML error page instead of the current XML error. Also, you can now specify your own custom error page when a 4XX error occurs.
You can use the S3 tab of the AWS Management Console to enable your bucket as a website.
The CloudBerry S3 Explorer includes support for this cool new feature:
The newest version of Bucket Explorer also supports website hosting:
And (added post-release) the S3 Browser also supports it:
Also added post-release, CloudBuddy Personal has added support, as described in this blog post:
The AWS Java, .NET, and PHP SDK’s support this new feature; for more information, consult the Amazon S3 Developer Guide. As always, we also encourage developers of libraries and tools to add support for this as well. If you are such a developer, leave me a comment or send me some email (awseditor@amazon.com) once you are ready to go.
I'm pretty excited by this new feature and hope that you are too. I think that it will be pretty cool to see website owners simply and inexpensively gain world class performance by hosting their entire website on Amazon S3. In fact, Amazon CTO Werner Vogels is already doing this! Check out his post, New AWS feature: Run your website completely from Amazon S3, for more information.
-- Jeff;





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.
Posted by: expert | February 17, 2011 at 04:55 PM
The missing link is now just something like S3 which also runs PHP5.3 scripts. Imagine how awesome that would be. Deploy app code to "phpS3", deploy database to RDS and have a pure awesome web application stack. Pleeeeaaaase! :-)
Posted by: Joshua | February 17, 2011 at 05:42 PM
This is awsome!!
Just wondering will S3 enable gzip/deflate for static content delivery in the future? This will reduce the bandwidth/cost as well as speeding up site loading.
Posted by: Angus Li | February 17, 2011 at 05:47 PM
This is a great little a addition to AWS services. I don't see myself using it for any practical reason just yet, but I can already imagine a few pretty cool uses.
Posted by: Ed at Red Bridge | February 17, 2011 at 06:12 PM
I wonder if you can configure Wordpress to use S3?
Posted by: Peter Filias | February 17, 2011 at 06:14 PM
That is just awesome! I've been looking for this for a long time, but didn't expect it so soon. ;) Wonderful job guys!
@Peter: You can configure WordPress to use S3 to store the static data such as images, videos, attachments, etc. Just upload them on to your S3 bucket and link them to your WP powered blog/website. HTH. I hope you didn't mean to install WordPress on S3. ;-)
Posted by: Pothi | February 17, 2011 at 06:45 PM
@Peter - Wordpress needs something to process the php scripts and relies heavily on .htaccess rewrite rules - so you need at least a micro instance & apache for that but you can pull static images & videos, etc from S3 - we do it all the time... there are also ways to mount an S3 bucket so that apache can write to it directly (you can have apache read from it too but that defeats the purpose)- and provided it has the right security. See: http://LogicWizards.NET/mounting-an-s3-bucket-on-ubuntu-lucid/ for more info...
Posted by: Joe Negron ~ NYC | February 17, 2011 at 07:11 PM
I can imagine writing rich client-side applications in something like SproutCore (http://www.sproutcore.com/) or Cappuccino (http://cappuccino.org/), and hosting them purely in S3. Amazing how a seemingly simple feature enables so much.
Posted by: Mase | February 17, 2011 at 07:13 PM
This sounds like it will be great with static site generators like Jekyll https://github.com/mojombo/jekyll
Posted by: DD | February 17, 2011 at 08:19 PM
I've been working on a tool for creating websites on S3 (https://github.com/kylefox/kirby) and these additions are the final pieces I needed :)
One small thing -- is there a way to get the endpoint URL for a bucket through the API? Unless I've overlooked something, it doesn't look like this is currently possible.
Posted by: Kylefox | February 17, 2011 at 09:22 PM
Certainly great news. But there is a caveat...
It would seem that you still can't serve a site from root ("domain.com") in this fashion because a CNAME record cannot (or should not, because it breaks RFC) be applied to the root. You could certainly serve "www.domain.com" with s3 Website functionality, but "domain.com" would still need to point to a DNS "A" record.
So, if root domain is desired as the s3 Website address, it seems the only alternative would be to redirect all requests to "domain.com" to "www.domain.com". That means, still, a single point of failure for "domain.com", and a no go for sites that are established on search engines at the root level. Bummer.
I hope I'm wrong on this. Maybe there is an Amazon Route 53 solution, or something that I'm missing?
From RFC1034 section 3.6.2:
If a CNAME RR is present at a node, no other data should be present; this ensures that the data for a canonical name and its aliases cannot be different.
http://www.faqs.org/rfcs/rfc1034.html
Eric P
Posted by: Eric P | February 17, 2011 at 09:55 PM
Cool idea. However, there's still no way to serve a site that doesn't use a CNAME, right? For example, example.com. Something would have to redirect example.com to www.example.com, which would be a CNAME to S3. I'd love for someone to correct me if I'm wrong.
Posted by: Edward Dale | February 17, 2011 at 11:56 PM
Bummer! It has just been days that I put my blog http://inside.glnetworks.de behind CloudFront but could not use S3 as the origin without the now provided default directory object feature. Thanks for adding this feature! If I may: Configurable Redirects and/or Rewrites would be another great thing to have in either S3 or CloudFront.
Posted by: Klickmich | February 18, 2011 at 12:02 AM
This is a huge step and something we have been waiting for quite some time now. Two remaining questions:
Is this integrated with Cloudfront as well?
Can we expect SSL support (with own certificates like on the elastic loadbalancer) any time soon?
Posted by: Mennoabbink | February 18, 2011 at 01:24 AM
Will this also work for CloudFront to deliver whole websites via a CDN? Would love to see ESI added to CloudFront, then we'd have the ability to take advantage of epic speed (CloudFront), reliability (S3/CloudFront multiple locations) and flexibility (CloudFront ESI -> EC2 hosting the dynamic content).
Posted by: Ryan Townsend | February 18, 2011 at 01:37 AM
Finally! Awesome. I'm sure i'll use this for hosting microsites.
Posted by: john adams | February 18, 2011 at 01:44 AM
Sounds great. Thanks AWS!
Posted by: Niall | February 18, 2011 at 01:57 AM
Good news. I hope we get the A-NAME record thing soon, then this will be really useful.
Posted by: Martin | February 18, 2011 at 02:31 AM
Has anyone had any luck with setting up this new Static WebHosting feature for their site? I've set up an index.html in the root of my bucket and it is styled with a CSS file located in the '/css' subdirectory but I am struggling to get the CSS file to style the index page. Any thoughts?
Amazon adding the static hosting feature is great, but until they implement more support for server-side scripting such as PHP, the service seems limited to simple HTML sites from the 90's! Thank you AWS, but you can do better! Until then, I'll eagerly await further advancements with this service.
Posted by: Kyle | February 18, 2011 at 06:24 AM
I've been using Cloudfront and S3 to do this for a couple of months. Cloudfront felt like overkill to just set a default root object. Thanks AWS!
Posted by: Joel | February 18, 2011 at 06:34 AM
Seems to me this is presented as a bigger thing than it actually is. It allows your bucket to present a default page for the www address, and gives you a custom 404 page, and er.. that's it, isn't it? None of the approximately 120 sites I help maintain 100% static, so use seem very limited to me. It's a start, but on its own it's a long, long way from hosting a complete website in practical terms.
Posted by: Brian | February 18, 2011 at 07:19 AM
I can't use this until I can serve my root domain without redirection to "www". Can Amazon designate an IP address (or set of IP addresses) for S3 that I can point my root A record to?
Posted by: Luigi Montanez | February 18, 2011 at 08:33 AM
Amazon S3 combined with the Jekyll static site generator could be a formidable option for hosting static content. Think about all the potential static content we could use: Blogs, Microsites, Minimum Value Products (MVP).
Amazon S3 is thee standard for hosting webapp assets. This new feature to host static content is good added value. Now I'm really interested to see where the S3 platform is in 2-3 years. Congrats to Werner Vogels and the entire Amazon Web Services team.
Posted by: TVD | February 18, 2011 at 04:31 PM
It is great to see that AWS is more agile and come out of this feature. Going forward, AWS should be doing a lot of such need based tweaks in EC2, EBS, CloudFront too.
Malcik.
http://www.cloudmanifest.com/
Posted by: Committedexpert | February 19, 2011 at 04:32 AM
The latest snapshot build of Cyberduck allows website configuration for S3. Refer to http://trac.cyberduck.ch/wiki/help/en/howto/s3#WebsiteConfiguration
Posted by: David Kocher | February 19, 2011 at 06:52 AM