Setting up Ubuntu/WordPress on Amazon EC2 – Part 1

Posted on by Mark

After choosing Amazon as my VPS host, the next step was getting the server set up. While this was a daughting task, the volume and quantity of documentation our there made it much easier than expected. As much for my own future reference as anything here is a brief run down of everything I needed to know to get from AWS account sign up to a running WordPress instance with a few additional nice to haves. The instructions are broken into two parts. Part 1 covers everything up to getting an SSH connection to the new VPS:

  • Create AWS account
  • Configure Firewall
  • Allocate IP Address
  • Connect to your VPS

Part 2 takes it from there through to a running WordPress instance:

  • Basic Hardening
  • Getting Comfortable
  • Install LAMP
  • Install Apache
  • Install MySQL
  • Install PHP
  • Install FTP server
  • Install WordPress
  • Next Steps

Create AWS Account

First step is to sign up for an Amazon Web Services (AWS). If y0u have one already but still want to take advantage of Amazon’s Free Usage Tier, you’ll need to create a new one. Once you’ve created an account and logged into the AWS console (https://console.aws.amazon.com/ec2/), select the region you want your instances hosted in (I chose Tokyo), and click Launch Instance. Screenshot of AWS Console Choose the Classic Wizard and select Community AMIs. You’ll now need to enter the AMI-ID for the AMI (Amazon Machine Image) you want to use. Use the AMI Locator provided at http://cloud.ubuntu.com/ami/ to find the right AMI. Searching on “ap north lucid 64 ebs” found the right image for me – 64-bit, Elastic Block Storage image of Lucid Lynx in the Tokyo data centre (why EBS?). Screenshot of cloud.ubuntu.com Note the AMI-ID and drop it in the search box in the AWS console. Screenshot of Classic Wizard in AWS consoleStep through the rest of the wizard accepting all the defaults, generating the Key Pair along the way. Once the wizard is complete you’ll be returned to the dashboard view of the AWS console with one instance now running.

Configure Firewall

You now need to config your Security Group which is the firewall Amazon gives you. Go to the Security Groups section and choose the default security group. Select the Inbound tab and configure the relevant rules. The image below shows what worked for me:

  • All traffic HTTP/HTTPS traffic (port 80 & 443)
  • FTP and SSH traffic (port 21 & 22)  from my DSL IP range
  • ICMP traffic from my DSL IP range

Screenshot of Security Group config in AWS console

Allocate IP Address

Amazon give you the ability to allocate an IP address using their Elastic IP function. Go to the Elastic IPs section, choose select Allocate New Address and then associate it with your EC2 Instance. Screenshot of AWS console

Connect to your VPS

You have now done everything you need to do to be able to connect to your AWS instance. To check everything is ok, go to the Instances section of the console. You should see a screen like this: Screenshot of AWS console The important things to note are that the instance is running, the name of the Key Pair and the Elastic IP.  To connect to your instance run the following:

$ ssh -i Mark-Ubuntu-Japan-02.pem ubuntu@176.34.24.251

And you’re away…

Keep reading for part 2.

This entry was posted in Cloud, Ubuntu, Under The Hood. Bookmark the permalink


Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">