Saturday, December 3, 2011

Getting started with Amazon Web Services EC2

First off go to aws.amazon.com and create your account. This part is pretty self explanatory. If you choose a micro instance with no extra services, your first year is free.

You can choose from several public images. I chose an Amazon Linux AMI image which is an Amazon customization based on CentOS. CentOS is in the family of Linux distros that includes Red Hat and Fedora.

After you create your instance, there are a couple of things that you need to do to make it usable. Although it is easy to find how to do these things, I didn't find a unified location that tells you these steps.

  1. Open port 22. By default all inbound ports are blocked, so if you plan to ssh into your instance, you will have to do this. Go into the AWS Management Console and find Security Groups. On the Inbound tab, Create a new rule: SSH. For Source, use the default 0.0.0.0/32. This opens port 22 incoming traffic from any address. A couple of notes: You can not log in remotely as root. Use ec2-user or whatever the AWS Management Console tells you under Connect. Also, you cannot use a password to login; you can only log in with the key also found in the Management Console.
  2. Open ports 80 if you plan to use Apache, and/or port 8080 if you plan to use a web container.
  3. When you ssh in, do

    sudo yum install mlocate

    if you like to use the locate command.