Getting Started With Amazon As a CDN – Part 1


Content delivery networks are all the rage now, so I’m looking at creating a CDN that will work nicely with my WordPress installation.

Rather than just blindly use a plugin, I want to make the code trustworthy and reusable among other blogs that I manage. Certainly theĀ easiest way to get a CDN working on your blog is to use the Jetpack plugin from Automattic. This transparently turns the content on your blog into a CDN-delivered bowl of web content.

Some people might not want the full weight of the Jetpack plugin or to use the WordPress CDN so here we go. I’m going to step through the process that I used to get a CDN working myself. Continue reading Getting Started With Amazon As a CDN – Part 1

A Quick Way to Manage Multiple Amazon AWS Accounts

I’m often switching between different Amazon AWS accounts. So to speed things along I’ve set up some simple scripts to easily switch between accounts while at the command line

On Linux (aws_setup):

export EC2_URL=
export EC2_CERT=/home/john/cert-12345678901234567890123456789012.pem
export EC2_PRIVATE_KEY=/home/john/pk-12345678901234567890123456789012.pem</code>

Once saved, run chmod +x aws_setup
On Windows (aws_setup.cmd):

<code>SET EC2_URL=
SET EC2_CERT=C:\Users\John\cert-12345678901234567890123456789012.pem
SET EC2_PRIVATE_KEY=C:\Users\John\pk-12345678901234567890123456789012.pem</code>

Save as many files with the paths to your various AWS key pairs, and simply run the script from within a terminal before using the ec2 tools.

NOTE, when you run the scripts on Linux (and I guess Macs), add an extra dot before you run it. This will allow the environment variable to persist when the script ends.

<code>. ./aws_setup</code>

Commands to get started with Amazon EC2

Here are some simple commands to get you started with using Amazon EC2:

Displays your account’s AMIs that are on Amazon

ec2run ami-XXXXXXXX
This launches your Amazon EC2 instance. Use your own or one of Amazon’s AMI IDs

Describes your running instances with AMI and instance IDs

Lists your account’s volumes and their status

ec2attvol vol-XXXXXXXX -i i-XXXXXXXX -d xvdf
Attaches an Elastic Block Storage device to your running instance

ec2detvol i-XXXXXXXX
Detaches the storage volume from an instance (use -f to force)

ec2stop i-XXXXXXXX
Stops a running instance so that you can perform maintenance on it

ec2minatt i-XXXXXXXX
Modifies an instance attribute such as the instance type

ec2start i-XXXXXXXX
Resumes your stopped instance

ec2kill i-XXXXXXXX
Terminates your running instance