Demystifying the Cloud: A Case Study Using Amazon’s
6.5 Step One: Move Static Content to S
The first and easiest step is to move all your static content—images, CSS, JavaScript files, etc.—to Amazon S3. The simplest way to do it is just a drop more complicated than if you were to create a Z drive with Gladinet.
Tip: Once your content has been stored on S3 you can also use Cloud- Front,10 Amazon’s CDN (Content Delivery Network), which provides edge servers in various locations around the globe to serve the stored data and to improve your application’s performance. See http:// aws.amazon.com/cloudfront/).
6.5.1 Using CloudFront
Amazon CloudFront has a simple Web services interface that lets you get started in minutes. In Amazon CloudFront, your objects are organized into distributions. A distribution specifies the location of the original version of your objects. A distribution has a unique CloudFront.net domain name (e.g., abc123.cloudfront.net) that you can use to reference your objects
Demystifying the Cloud: A Case Study Using Amazon’s Cloud Services (AWS) 127
through the network of edge locations. If you wish, you can also map your own domain name (e.g., images.example.com) to your distribution. You can create distributions to either download your content using the HTTP or HTTPS protocols, or stream your content using the RTMP protocol.
Amazon CloudFront employs a network of edge locations that cache copies of popular files close to users on the Internet. CloudFront ensures that end-user requests are served by the closest edge location. As a result, requests travel shorter distances to request objects, improving performance.
To use Amazon CloudFront, you:
Store the original versions of your files in an Amazon S3 bucket Create a distribution to register that bucket with Amazon Cloud- Front through a simple API call
Use your distribution’s domain name in your Web pages, media player, or application. When end users request an object using this domain name, they are automatically routed to the nearest edge location for high performance delivery of your content
Pay only for the data transfer and requests that you actually use 6.5.2 Other Tools for Moving Content to S3
There are many tools for loading your static content into S3. For computers running the free Firefox browser (Windows, Mac )S X, and Linux), perhaps the easiest is a free Firefox add-in called S3Fox. The AWS Management Console also includes support for Amazon S3. It runs in any browser.
Tip: For large amounts of data, AWS Import/Export (http://aws.ama- zon.com/importexport/) accelerates moving into and out of AWS using por- table storage devices for transport. AWS transfers your data directly onto and off of storage devices using Amazon’s high-speed internal network bypassing the Internet. For significant data sets, AWS Import/Export is often faster than Internet transfer and more cost effective than upgrading your connectivity. You can use AWS Import/Export for migrating data into the cloud, sending backups to AWS, exchanging data with others, and disaster recovery).
Here, we will assume that S3Fox is what you’ll use to move content between your computer and the cloud.
6.5.3 Using Amazon S3 with Firefox S3Fox
1. S3Fox is a plugin for the Firefox browser, so if you don’t have a Firefox browser installed in your machine, you’ll first need to get one by downloading it free from http://www.mozilla.com/. 2. Next, download and install the S3Fox plugin (http://
www.s3fox.net/),
3. Have your Access Key ID and Secret Access Key ready. If you have misplaced them, go to http://aws.amazon.com/security-cre- dentials to view your S3 credentials (see Figure 6.11). To view your Secret Access Key, click on “Show.”
Launch S3Fox Organizer
1. In Firefox, go to Tools and select S3 Organizer (as shown in Figure 6.12).
Figure 6.11 S3 Access Credentials.
2. Enter your S3 credentials.
3. Enter a self-explanatory Account Name, your Access Key and Secret Key (click Show to see the secret key). Click Add. (See Figure 6.13.)
Get Connected, Create First Bucket
Once you’ve entered the correct information, you’ll be brought to your account which is blank, by default ( In the screenshot in Figure 6.14, some files were previously created in S3 and are shown on the right panel).
On the left side of S3Fox Organizer will be your local machine folders, and the Amazon S3 “buckets” will be on the right.
Figure 6.13 Entering S3 Credentials into the S3Fox Organizer.
Right-click Create Directory (as shown in Figure 6.15). Anything cre- ated on the root level will be buckets. All files and folders will be stored/ organized under buckets.
Create Folders, Upload Static Content
Double-click in your bucket and create a folder. Inside the folder, upload your content by dragging from the right-hand pane. By default, anything uploaded to your Amazon S3 account will not be accessible by public.
A similar solution (also available at no charge) is Cloudberry S3 Explorer (http://www.cloudberrylab.com), shown in Figure 6.16.
A Pro Version is also available (see Figure 6.17), and it adds additional features, including compression, security, search, and FTP support.