Monday, March 30, 2009

How to turn on Amazon S3 bucket logging with CloudBerry Explorer (Part 1)


If you are wondering what kind of request is coming to your bucket and what actually you pay money for you may consider turning on Amazon S3 logging to record the requests coming to your bucket. This is a simple task that CloudBerry Explorer freeware will make it even easier.

A bucket to keep log files

Let’s create a bucket called cloudberry.log to keep your log file. You don’t necessarily have to create a new bucket for your log files, but I think it is a good idea to have a separate bucket for the purpose to make things better organized.


Configure logging

Let’s imagine we want to configure a logging for a bucket called images.cloudberrylab.com. So, all you have to do is to select the bucket and to click Logging button on the toolbar.


Now check “Use logging” checkbox and choose the bucket where you want the log files to be written in the dropdown list. In our example it is cloudberry.log.


Click ok and you are done. According to Amazon documentation log file don’t appear immediately. It may take up to 24 hours for the log file to be created.

What next?

Now you are asking yourself: what can I do with the log files, how I can view them? What format they are stored in? Read our second blog post in this series on analyzing the log files.

Final notes

Log file can be written to the bucket in the same geographical location. In other words if you are logging the access to bucket in the US you will have to assign another bucket in the US to keep that log.

Also notice that log file will add up to your monthly bill (although insignificantly) as you will need some additional S3 storage for your log files. The number of log files will grow over time so don’t forget to clean them up regularly.

S3 Log accuracy

One thing worth mentioning that even though Amazon will make the best effort to make the log as accurate as possible it doesn’t guarantee its complete accuracy. In rare situation certain requests will not make it to the log. But as Amazon explains S3 log is designed to give a general idea how your bucket is being used.

Conclusion

CloudBerry Explorer freeware is a tool that makes managing Amazon S3 easy. This is further proved with its ability to turn on S3 bucket logging, the task that you can complete in the less than a minute. You can download CloudBerry Explorer freeware on our website at http://cloudberrylab.com/

Monday, March 23, 2009

How to host Media Files on Amazon S3 with CloudBerry Explorer (part 1)


In this post we will discuss the advantages of storing media content of your website on Amazon S3 and how CloudBerry Explorer can help.  

Overview

If you want to learn how to get your Amazon S3 account you can read our previous post here

One of the typical ways to improve scalability of high traffic website is to serve it contents from several web servers. For example you may want to store your html files and dynamic script files at http://www.mysite.com/ while multimedia content such as images, video and audio files at http://media.mysite.com/ This way all request for html pages will go to first sever and requests for media content will go to the second one allowing each server to perform better under high load.

Let’s see how you can employ Amazon S3 as your second server. Amazon S3 offers you unlimited scalability and pay as you go model. You pay only for what actually is stored on your S3 account and pay only for the actual traffic. If the amount of data grows you pay more if it decreases you pay less. Same is with the traffic.

Amazon S3 can also act as a web server serving static content and this is where it comes handy. So instead of ordering another server to store your media content from your hosting provider you can sign-up for Amazon S3 account and move your images and video files there.

How to get Amazon S3 account and CloudBerry Explorer

 

It takes just a couple of minutes to create your own Amazon S3 account. We have a special blog post about it that you can find here

You can download CloudBerry Explorer freeware S3 client here

Copying files

Obviously if you want to serve your media files from Amazon S3 you will have to copy your files to your Amazon S3 account.  This is where you will need a client tool. There are many client tools available out there, but in this post we will talk about CloudBerry Explorer freeware.

Creating a bucket

First you will have to create a bucket that will have the same name as your domain name. for our example we will create a bucket called media.mysite.com,  this will help us to configure a CNAME for the bucket and you will learn more about it later.  Also make sure the name of the bucket is in lowercase – this is a requirement if you want to serve files from your bucket.


Copying files

 

Now you can copy files to your newly created bucket. Just select files on your local disk and click copy button on the toolbar.


 

Configuring access rights

 

To be able to serve your media files to internet users you will have to allow anonymous access to the files. You can do it easily by selecting the bucket and clicking the ACL Editor button in the toolbar.


ACL Editor will come up and you will have to grant “All Users” Read access to the bucket. “All Users” built-in group represents anonymous Internet users.  Make sure the check box “Apply for all subfolders and files” is checked off as it will automatically propagate access rights to all files in the bucket and you won’t have to set them up one by one. 

The ability to apply access rights to all objects in the bucket is one of the advantages of CloudBerry Explorer over other tools.  


Another cool feature is that you don’t have to care about access rights anymore - CloudBerry Explorer will apply bucket’s ACL to any new files copied to the bucket.

Generating URL

 

Now you have everything you need to start serving your files from Amazon S3. The syntax of the URL should conform to the following rule

http://[bucketname].s3.amazonaws.com/[filename]

your files URLs will look like the following

http://media.mysite.com.s3.amazonaws.com/Picture003.jpg

http://media.mysite.com.s3.amazonaws.com/Picture004.jpg

CloudBerry Explorer has an easy way to generate URLs for multiple files. Just select multiple files and click “Web URL” button on the toolbar.


In the dialog box you can see URLs for all your files and you can click Copy to clipboard button to copy them and paste wherever you like.

 


Configuring CNAMEs

 

Would you like to be able to use simpler link to your media files? Something like

http://media.mysite.com /Picture004.jpg

Is that possible? Yes! This is where CNAME comes. I am not going to get into DNS internal but simply speaking CNAME is a way to create a sub domain and refer it to another location. In our case we will refer a domain to Amazon S3 bucket.

All you have to do is to configure appropriate CNAME in your hosting provider control panel. I use 1&1 but every hosting provider offers a way to create CNAMEs and you will just have to find out the details.

To create a CNAME record you will have to specify an alias media and s3.amazonaws.com domain. This is how it looks like in 1&1 control panel:



It usually takes some time for DNS configuration to take effect, so the changes will not be available immediately.

Generating URLs with CNAME

 

Now you can start generating nice URLs using your newly created CNAME. Open the Web URL dialog box that you are already familiar with and type CNAME as indicated on the screen.  You will see that all URLs will be automatically updated to include the CNAME.


 

That’s it. Now you are ready to update your html code with new URLs and improve the scalability of your web server by taking advantage of Amazon S3.

 

Automating upload with PowerShell command line interface

 

If you are wondering how you can automate the process of copying the files to Amazon S3 you can check out CloudBerry Explorer PowerShell command line interface here It can automate most of the tasks available in CloudBerry Explorer GUI.

There is also an open source C# library called Resourceful that you can use to automate date transfer to S3. You can download the library at here

There is a huge number of 3rd party libraries for Amazon S3 available and those two are just examples.

Looking ahead to part 2

In the second part of our article we will look at how you can employ Amazon CloudFront content delivery service to make your files available in multiple locations and how to configure CloudFront using CloudBerry Explorer.

Another area that we will explore is how to reduce your monthly bills by configuring cache-control headers. 

Conclusion

As you could see Amazon S3 offers a great solution for hosting your media content while decreasing the load of your primary web server. There are some obvious advantages including pay as you go model and unlimited scalability. On the other hand CloudBerry Explorer freeware can help copy files to S3 account, configure your files to be accessible by web browser and automate the whole process.


Want to know how much it may cost to host videos on Amazon S3? Check out this blog post 

Sunday, March 15, 2009

Bolso is a simple tool for managing Amazon SimpleDB

We are starting a project in CloudBerry lab that will employ Amazon SimpleDB and we have been looking for a tool to help us get started with it. I came across this wonderful SimpleDB manager from Bolso. It is an Adobe Air application and works on Windows as well as on Mac. It costs only $20 and 7 days evaluation copy is available. I hope the rest of the post will help other SimpleDB developers learn Bolso features and decide if they can benefit from it.

Getting started

On the first run you should enter password for protect your Amazon account data. Then you should specify Amazon account data for start using Bolso.


Main Window

Main application window contains list of domains in the left part (it can be hidden with a button) and domain content in the right.



In the right bottom corner notification or error messages are displayed:



Displaying domain items

Domain items can be displayed in standard (list) style, or in tree view style with grouping by some field:



Query builder

Bolso has integrated sql query builder, that allows to create a query for specific attributes and items.

Manually writing a query

More advanced users may write and save sql queries without assistance of query builder:

Importing data

Another useful feature (or may be the main) of Bolso is data import:


Currently only xml file exported by phpMyAdmin may be used for import:


You should check generate item names box or select one of unique fields of source table to be used as item names. Then select columns, destination bucket and validate import file. After that ‘Import to SimpleDB‘ button become available


Another neat thing is a domain properties window, that shows the domain size and item count and other metadata


Conclusion: easy to use tool that allows exploring and modifying SimpleDB database. Data import features are particularly useful. One thing I would suggest the author is to make it possible to configure proxy settings to allow users behind the corporate firewall to work with SimpleDB. I highly recommend it to anybody who develops on SimpleDB or just want to try it out. You can download it at http://www.cafesilencio.net/bolso

At this time Cloud Databases such as Amazon SimpleDB are not nearly as popular as Cloud Storages such as Amazon S3, but I am sure that they will take off the ground one day as they provide for an efficient pay per use model and unlimited scalability as well as flexibility when it comes to querying the data not found in Cloud Storage services.

Wednesday, March 11, 2009

How to copy files to Amazon S3 in background with CloudBerry Explorer

Sometimes you have to copy a lot of files to your Amazon S3 account. For instance you want to move your static HTML files and images off your hosting provider to Amazon S3 to take advantage of reliable and secure storage, cost efficiency and CloudFront CDN or you simply want to backup your files to S3.  CloudBerry Explorer can help you to make it easily and quickly.  

Note: this post assumes that you are familiar with CloudBerry Explorer. if you don’t we urge you to download it for free at http://s3explorer.cloudberrylab.com/

Introducing copy queue

Chose you source and destination, select the files you want to copy and click copy button (or move) on the toolbar. Click ok in the confirmation dialog.

The CloudBerry Explorer bottom panel will show you what we call the copy queue. Here you can monitor the progress, see which file is currently being copied and even check out the estimated time left.


 

You will also see all the errors occurred during the copy process.

Copy in background is on by default

By default copy in background is on, however it might happen that you turn it off by chance or with purpose. To control copy behavior you have to go to tools->options, General tab and ensure that “Run operations in background” option is “on”.


 

Copy queue controls

Now let’s examine some of the queue controls in details.  First, you can pause the queue, to stop copy process for a while.  Just click the Pause button.



Clicking Resume button will effectively resume the copy process where it left off.


Notice that since Amazon S3 doesn’t allow for partial uploads yet, you can’t stop the process in the middle of the file. In other words you can’t upload only part of the file, then pause upload and then upload the rest of the file.

If you are interested in Amazon’s plans on partial upload you can check out this thread on Amazon S3 official forum.

Remove completed tasks button will clean up the queue and remove the records of files that have been successfully copied, those that are indicated with “checked” icon.


Clear all will just remove every file from the queue in regardless of whether it was successfully copied or not.  Be careful with this option as files won’t be copied after you remove them from the queue.


 Now look at the status bar, it offers you at a glance statistics for your copy progress.  At the left you can see how many files have been copied successfully, failed and currently pending. 

In the middle there is a percentage indicator for the copy progress, average speed and estimated time left.


Hide Queue label is actually a button that will hide the queue panel to free up some screen space.  To show the panel again just click Show Queue label.


Don’t forget about permissions

 One of the many CloudBerry Explorer advantage is that it helps to apply ACL list to the files inside the bucket. Just setup ACL list how you want and it will automatically apply appropriate permission to the files inside the bucket when you copy them. You can find more info about that in one of my previous posts here . 

But here I just want to mention that ACL is applied in background too and this is exactly why you see Apply ACL items in the queue.

Hide to tray

Newer version of CloudBerry Explorer also provides you with ability to hide the product to tray to clean up your workspace on the screen. When copy process is finished you will get a message in the tray notification area similar to this one:


What is coming next

We realize that copy in background is not perfect at this stage and we are working on improving it. One thing that we are going to introduce in the next release is the ability to remember the queue and restore it when you restart the product.

In the commercial version we will also offer multithreading that will help to copy a large number of small files quickly. 

Conclusion

CloudBerry Explorer makes it significantly easier to copy large number of files to Amazon S3 storage. Even though there is a lot of room for improvement CloudBerry Explorer is a solid product that helps people to achieve common tasks related to Amazon S3 storage in an efficient and user friendly manner.

As always we are eager to hear what you think about the product and we invite you to download CloudBerry Explorer for Amazon S3 at our website at http://cloudberrylab.com/

Wednesday, March 4, 2009

How to share files in Amazon S3 bucket using CloudBerry Explorer


Would you like to be able to share files on S3 bucket with other Amazon S3 users? CloudBerry Explorer can help you to do that. With its External bucket feature sharing buckets and files becoming a breeze.

Allowing another Amazon S3 user access your bucket and your files

Let’s assume I would like to share my bucket with the user who’s registered for Amazon S3 under info@cloudberrylab.com email. I will have to select a bucket I want to share and open ACL editor, then I click “Add” button and type the email address in the text box

Click ok to add it. Now you have to provide access rights to your bucket to this account. For our example I will grant the user read/write access to my bucket by checking appropriate checkboxes.

Notice how I also checked “Apply for all subfolders and files" checkbox to make sure correct permissions are propagated to all objects in the bucket. This operation may take some time if you have many files in the bucket.
Now you are ready to share your bucket with the user. All you have now to do is to tell the user the URL of your bucket. This is where Web URL feature comes handy. Right click the bucket and choose “Web URL” option. Now just click copy to clipboard to get the URL that you can send to another user. Here is how it looks like:
https://sharebucket_andy.s3.amazonaws.com/
You can optionally choose HTTPs URL type to make your communication secure.

Registering External bucket
Now when another user receives the URL she can register it as an external bucket and start sharing files.

Enter the URL of the bucket that you’ve generated on the previous step

The external bucket will appear in the list of other buckets and you can quickly spot it by a green icon with a smiling face:

Security Gateway
CloudBerry Lab is taking this approach a little further and working on the product that will let people not having AWS accounts access files and buckets. Security Gateway is an online service that works on top of the single Amazon S3 account. It allows creating users and sharing certain buckets and folders with them.
Security Gateway will be seamlessly integrated with CloudBerry Explorer and CloudBerry Backup.
As of this writing Security Gateway is still under development but you are welcome to sign-up for beta at http://www.cloudberrylab.com/default.aspx?page=security-gateway
Conclusion
There are numerous ways you can share files on the Internet these days but if you like Amazon S3 and CloudBerry Explorer you can find “External bucket” feature useful. But if you like Amazon S3 you can find CloudBerry Explorer with its “External bucket” feature useful.
If you have more than one Amazon S3 account if you like you can try this scenario yourself.
As always we hope you liked our post and we invite you to download CloudBerry Explorer for Amazon S3 at our website at http://cloudberrylab.com/