|
Amazon's Simple Storage Service provides a simple web server to access any file that is stored in their storage cloud. This means, you can access files stored at S3, directly via a web browser, if you have set the permissions as "read" for all users. Many of our clients are using S3 to host media files, which do not need scripting on the web server side and require a lot of bandwidth to serve, e.g. images, flash movies, audio files etc. Let's review the step by step instructions to host media files on Amazon S3. | .
- Create and activate your Amazon S3 Account.
- Let's start the Bucket Explorer.
- Insert your Access key[1] and Secret key[1] and click on "Go" button.
- After successful logon, Bucket Explorer prompts you "Do you want to save credentials[2]?". Click on "Yes" to save it.
- Now create a bucket[3] in which you wish to store images or other media files (eg. images.bucketexplorer.com)
- [ optional ] Create a CNAME[4] entry into your domain’s DNS Manager interface and point it towards s3.amazonaws.com
- Select the bucket and upload images in it.
- Now give the READ permission to ALL USERS. For doing this right click on images and choose "Update Object's Access Control List" option,
- Check the READ permission for ALL USERS and click on "Save" permission button.
- Now again right click on images and choose "Generate Web URL" option.
- [ optional ] Click on "Use Bucket Name as Virtual Host"[5] button to modify all urls according to your CNAME entry. (it would look like -
http://images.bucketexplorer.com/buynowheaderbtn.png
- Click on "Copy all" button. This will copy all the URLs on the clip board.
- Now the images are ready for public sharing or you can use urls in your website.
- Since Amazon's pricing is truly "on demand", you will pay for every GET request and the bandwidth. If you don't want to pay for bandwidth consumed by the spiders, add a robots.txt which disallows robots to crawl your bucket's data. Something likes this http://images.bucketexplorer.com/robots.txt
- You have done it. Enjoy!
|
- ˆ Access Key & Secret key : Access key and secret key are just like user id and password which authenticate the user to access the Amazon s3 account.
- ˆ Credentials : Bucket Explorer saves Access key and Secret key in encrypted form at local machine. Next time user can easily connect without inserting of those keys.
- ˆ Bucket: Each of the files and folders stored in Amazon S3 is contained in a bucket. It's like "top level folder" or "top level drive". Bucket names are globally unique, i.e.since we have cretaed a bucket named "images.bucketexplorer.com", you cannot create this same bucket in your account. If you want to use these buckets for web hosting, try to choose a bucket name, which is a valid host name and everything should be lower case:
Valid Name: bucket2008, 1bucket, 01_bucket, 01.bucket, www.example.com Invalid Name:_bucket, .bucket, -bucket, 01-.bucket,01.-bucket, 127.0.0.1
- ˆ CNAME : This is optional; if you like to generate the public url using your own domain name, you should use CNAME entry. Otherwise user will see s3.amazonaws.com in the URL.
Example: For a bucket named images.bucketexplorer.com, the CNAME entry would point to images.bucketexplorer.com.s3.amazonaws.com. Once this is done, a file, "buynowheaderbtn.png" hosted in this bucket can be accessed via two URLs: http://images.bucketexplorer.com.s3.amazonaws.com/buynowheaderbtn.png , or http://images.bucketexplorer.com/buynowheaderbtn.png .
- ˆ Use Bucket Name as Virtual Host : This is optional. Bucket Explorer replace s3.amazonaws.com with bucket name and construct the URL using the bucket name. Make sure the bucket name is a fully qualified host name and a CNAME entry exists for it in your DNS server before choosing this option to create the URLs;
Example of Virtual Host URL: http://images.bucketexplorer.com/buynowheaderbtn.png
| |
|
|