Amazon EC2: Initial Setup
Today's installment is a quick walk-through on how to get your instance up and running with a good set of tools installed and the main services running. The next one will cover installing Wordpress and configuration.So, first things first: sign-up.I don't have screenshots of the entire sign-up process, but suffice it to say it's a lot like any Amazon checkout process. If you already have an Amazon account (and, well, who doesn't) you log in using your existing credentials and choose the services you want to enable. There's no charge to enable a service you're not using so go for it.After you've signed up you'll have access to the AWS console which you can get to with the link in the upper-right.You'll see a slightly different screen that only has the Launch Instance button in the middle.This is a good time to go over some of the terminology of all this.
- EC2: Elastic Compute Cloud. This is the what's providing the processor cycles to actually run the server.
- Instance: A server. Some types of instance come with storage, some don't. But more on that in a moment.
- EBS: Elastic Block Store. This provides persistant storage that you can attach to a server. It's like plugging in a RAID to your machine. These are typically more reliable than a normal hard drive since they are kept as some variety of RAID on the back-end.
- AMI: Amazon Machine Image's save you from needing to install an OS yourself. When the instance spins up it comes preloaded with everything you need to start using it.
- Key Pair: Used to provide authentication to log in with SSH.
- Security Group: Allows you to set up the firewall settings for your server.
So, in this example we're going to launch a Micro instance, using a 32-bit Linux AMI.In my case I already have a key-pair that I'm using. For your first instance you'll need to make a new one. Just call it something and hit the download button that you'll have. From what I can tell this is the only time you'll have to download the private key so you'll want to do that and put it somewhere safe.Like you can see above I've picked a 32-bit Linux instance.The next screen lets you change some of the details before you launch your instance.I would probably edit this and make a new security group... but that might just be me. The name "quicklaunch-0" tells me absolutely nothing so I changed it to Utility Server in my case.Finally, Launch the server.In a matter of minutes Amazon will have a machine running for you.Finally, let's connect to this thing!Let's take a step back.You'll need some SSH client on your machine first. If you're running on a Mac or any Linux variant you're probably set. If you're running Windows, you might as well grab PuTTY and install it. You'll have to read your own docs on PuTTY since I don't need it in my case. (Or, if you're a dork like me, install Cygwin so you can use the command-line version of SSH)Follow the instructions and SSH into your machine.
George-Burgyans-iMac:Vec.com gburgyan$ ssh -i vec.com.pem ec2-user@ec2.vec.comLast login: Sun Jan 15 18:25:52 2012 from cpe-24-93-188-0.neo.res.rr.com__| __|_ )_| ( / Amazon Linux AMI___|\___|___|See /usr/share/doc/system-release/ for latest release notes.[ec2-user@ip-10-202-55-86 ~]$
Houston, we have lift-off.You now have a bare installation of Linux. You can't do a whole lot with it yet.Something to note: you never typed in your password! The SSH private key is your password at this point. Feel free to change your password to something else if you want.
$ passwd
Another thing is that you aren't running as root. That's OK since the ec2-user has sudo permissions. This lets you temporarily escalate your permissions to an administrator.(In case you're wondering, the "$" is the prompt you see. This is a common indication of what you're supposed to type -- it's the stuff after the "$")So, the final thing we're going to do today is install a useful suite of tools and make sure the machine is fully patched up.
$ sudo yum upgrade$ sudo yum install mysql mysql-server php-mysql php emacs telnet ftp screen subversion
When this is done, reboot to make sure you're running the latest kernel that was likely installed.In my case I'm installing a few extra things, like emacs, screen and subversion. You don't need these. I like them. I like emacs. You might like any other text editor. I'm cool with that. VI is already installed, as is nano. If you don't know any better, you may as well use nano since it's a lot more user friendly for beginners.
$ sudo reboot
At this point you have a fully patched server running in the cloud!Next installment: getting Wordpress up and running!