Search This Blog

Amazon T1 Micro instance With Apache Primer

Although there's been a lot of buzz about the new Amazon t1.micro instances and the "Free Tier" for amazon, I haven't seen a good tutorial on how to just get started using the Amazon Dashboard console, so I decided to make this quick-and-dirty "get your site up and running in 15 minutes" bit. For those of you who don't know, Amazon launched a micro instance type which is perfect for most "simple" websites that don't generate a ton of traffic. If you don't need MySQL, but do need some server-side processing like PHP, this may be the solution for you.

Signing Up for the Services

You'll want to sign up for at least EC2 and EBS, but most other services aren't used in this tutorial.

Sign into the AWS Management Console

Everything really happens under the AWS management console, so after you've gone through the riffraft of verifying your account, you'll want to click the "sign in to the AWS Management Console" link at the top of the http://aws.amazon.com page.

Once here, you'll want to click on the "EC2" tab:

Launching your instance

Click on the "Launch Instance" button.

This wizard will guide you through launching a new instance. The key things to keep in mind here are that you want to make sure you're launching a "t1.micro" instance and using Amazon's 64 bit image.

On the next page, make sure you choose the "t1.micro" instance:

The next page you can ignore, just click continue:

The next page just lets you set some labels for your instance, in general you probably just want to at least set the "Name" tag to something in the event you launch multiple instances, you can use this to identify which is which:

For example, I chose to name mine "ApacheServer"

Setting up your Keypair

Click continue to the next page, where you'll be prompted to create a keypair. If you've done this before, you can use an existing key pair, but if you're reading this tutorial I'll assume you haven't set one up yet.

KeyPairs are how you log into your server, using SSH. It's important to note that you'll need to download this key pair and keep it in a safe place. For security reasons, you can never download your keypair again after this setup procedure.

Enter a name for your keypair and click the "Create and Download your Key Pair" link:

Setting up your Security Group

Click continue and you'll be taken to a page allowing you to set up your security group. It's generally a good idea to set up a new security group for each new "group" of servers you want to create. For example, this is for apache, so lets name it "apache" and fill out a description:

Now we see by default that SSH is authorized, but we also want users to be able to access this server via HTTP, and probably HTTPS as well. We add those in by choosing the appropriate fields from the row at the bottom:

Make sure to click the "Add Rule" button after adding each rule:

Before moving on, make sure you see something like this:

Review and launch

Now we look over our information, and make sure everything's ok before launching the instance:

After launching, you should see a page like this:

Setting up your Elastic IP

Of course, Amazon is very volitile, so we'll want to make sure we set up an elastic IP for our instance before we change over our DNS name.

On the left side of your console, you should see a link to "Elastic IPs":

Once here, you can allocate a new Address:

This requires you to confirm that you wish to allocate a new EIP.

You're currently limited to 5 EIPs per account, and you pay for any EIPs which are not associated to instances. If your EIP is associated to an instance, you don't pay for it. From here, you'll see your new EIP:

Right-click on it and choose "Associate Address":

Choose your instance:

Assign your DNS to your EIP

This all depends on who you bought your domain from. You can simply associate your domain with this IP address and your users will be forwarded along to this server automatically.

Logging in

Of course, now you'll need to log in and set up your software, specifically Apache. From a terminal or shell, use the keypair you downloaded to SSH into your instance by your elastic IP address:

Popular Posts

Ever wonder how sites like battle.net support things like this in Google Chrome?

Well I did, so I did a little bit of digging. It turns out Google Chrome supports an open standard called Open Search. This format is relatively simple, and very easy to add to your own site. I just added it to some of our systems in under 5 minutes.

Adding OpenSearch to your site is incredibly simple, you just have to add a simple tag to your index HTML page, and add a simple XML file that it points to. The link tag looks like this:
<link rel="search" type="application/opensearchdescription+xml" href="http://my-site.com/opensearch.xml" title="MySite Search" />

For a while, I have been creating command line tools provided right with boto which I used to manage AWS. Recently, others have become interested in these tools as well, and I've seen several other contributors adding to these tools to make them even more useful to others. One recent submission by Ales Zoulek added some nice features to my list_instances command, which I use on a regular basis to list out the instances that are currently active for my account in EC2.

Amazon now lets you add Tags to EC2 objects such as Instances and Snapshots. This allows you to actually "Name" your EC2 instance, as well as add some metadata that could be used for AMI initialization, etc. Ales added the ability to list these tags by name within the list_instances command line application:

Last week, Amazon announced the launch of a new product, DynamoDB. Within the same day, Mitch Garnaat quickly released support for DynamoDB in Boto. I quickly worked with Mitch to add on some additional features, and work out some of the more interesting quirks that DynamoDB has, such as the provisioned throughput, and what exactly it means to read and write to the database.

One very interesting and confusing part that I discovered was how Amazon actually measures this provisioned throughput. When creating a table (or at any time in the future), you set up a provisioned amount of "Read" and "Write" units individually. At a minimum, you must have at least 5 Read and 5 Write units partitioned. What isn't as clear, however, is that read and write units are measured in terms of 1KB operations. That is, if you're reading a single value that's 5KB, that counts as 5 Read units (same with Write). If you choose to operate in eventually consistent mode, you'r…