WordPress in the Cloud with Amazon EC2 and the Microsoft Web Platform Article

One claim I often hear from web developers, especially those who offerwebsite design and consulting services, is their need to quickly launchwebsites that run fast and give them total control of the server for maximumflexibility and scalability. This is a quick tutorial on how to do justthat, with a guided tour on how to run WordPress on Amazon’s EC2 Cloud andthe Microsoft Web Platform.WordPress is the world’s most popular blog engine. It could be arguedthat it’s also the most popular PHP application ever made. With thousands ofthemes and plugins, and a veritable army of web designers and consultantsworldwide specializing in building websites based on it, it’s no wonder thatthere are literally millions of WordPress-based sites on theInternet.Amazon’s EC2 has taken an alternative approach to web hosting. As aweb developer you’ve probably heard of cloudcomputing, so have you had a chance to try EC2 yet? It’s analternative take on web hosting that puts you in control of the servers youspin up, and you only pay for what you use. If you’ve ever bought a book oranother item from Amazon, you can use that same account to buy a server andtry it out for a few hours. All for the total price of a few dollars.WordPress and EC2 come together in a really slick way, giving you asuper-fast blog or website in just a few minutes. If you already have an EC2account, you can skip the first section below and go straight to the section called “Starting an EC2 Instance”.

Creating an EC2 Account

First, browse to http://aws.amazon.com/. Clickon the Create AWS Account link, as shown in Figure 1, “Creating an AWS account”.

Figure 1. Creating an AWS account

Creating an AWS account


If you’ve made a purchase from Amazon in the past you can use yourexisting account information, as shown in Figure 2, “Using your existing Amazon sign-in”. If not, choose the I am a newuser option and follow the instructions.

Figure 2. Using your existing Amazon sign-in

Using your existing Amazon sign-in


The sign-up process is fairly simple; after this just specify yourcontact information and you’re done!Next, you’ll want to register with Amazon EC2. To do this, browse tohttp://aws.amazon.com/ec2/ and click theSign Up For Amazon EC2 link. This will take you toa pricing details page, where you can review pricing options and pay bycredit card at the bottom of the page.

note: Pricing

Running a server full time for a month on EC2 costs about $80 ormore, depending on how much storage, bandwidth, and CPU power you use.While cheaper options exist out there, you do have full control over theserver, the ability to easily spin up new instances on the fly, and thebenefit of Amazon’s incredible network bandwidth andconnectivity.

Amazon will want to now verify that you’re a real human being. Theydo this by calling a phone number you specify and asking you to enter aPIN they provide on the website via the telephone. It’s quite slick toenter a phone number, see your phone ring about ten seconds later, enter afour-digit number after the friendly Amazon lady prompts you, and thenwatch the web page refresh to show you’ve been authenticated. Great jobAmazon, that was painless!

Figure 3. Amazon’s telephone verification

Amazon’s telephone verification


Click continue at the bottom of this page, then clickComplete Sign Up on the following page. Amazon willnow activate your subscription, making sure your account has access tocreate new instances. In a few minutes you’ll receive an email saying thatactivation is complete, and you can start your first cloud server!

Starting an EC2 Instance

To do this you’ll want to browse to the AWS Management Console here:http://console.aws.amazon.com/ec2/. You may be askedto log in again,; if so provide your credentials and you’ll end up on theAmazon EC2 Console Dashboard, as shown in Figure 4, “The EC2 Console Dashboard”.

Figure 4. The EC2 Console Dashboard

The EC2 Console Dashboard


First, you’ll need to make sure that the selected region (at the topof the left-hand sidebar) is US West—this will benecessary so that you have access to the WordPress image we’ll be usingfor this tutorial. Then go ahead and click LaunchInstance. Amazon provides a list of preconfigured images—orAMIs (Amazon Machine Images)—from the Quick Starttab. These are vanilla Windows and Linux images you can use to start aserver from scratch. To make the task of setting up server instances eveneasier, Microsoft has provided Amazon with a few preconfigured images thathave the Microsoft Web Platform Installer installed and ready to go. Clickon the Community AMIs tab and search for “MicrosoftWeb Platform,” as shown in Figure 5, “Microsoft Web Platform AMIs”.

Figure 5. Microsoft Web Platform AMIs

Microsoft Web Platform AMIs


Microsoft has provided four server images:

The Media Server image
This image has the new IIS Media Services 3.0 platformpreconfigured with some smooth streaming content already uploadedand ready to go. This is the same server that powered the 2010Olympics and NFL Sunday Night Football.
The DotNetNuke Image
The DotNetNuke image has Windows, IIS, SQL, and DotNetNukepreconfigured and ready to run. DotNetNuke is the leading webcontent management application on .NET.
The Full Web Server Development Stack
This image has the entire Microsoft Web Platform installed,including Visual Studio, IIS, ASP.NET, and SQL Express.
The WordPress Image
This has everything preconfigured and ready to kick off aWordPress install. It’s the one we’ll be using for the rest of thistutorial, so choose this if you want to follow along.

You’ll now be guided through a series of steps (five in all) toconfigure your image before it starts. First specify how many servers(instances) you want to create, and choose an instance type. There are twoavailable: “Small” has one core and limited memory, while “High-CPUMedium” has additional cores and greater memory, but costs more.

Figure 6. Instance details

Instance details


The next step gives you more extensive configuration options foryour instance, but I find the defaults work really well.Now you’re prompted to create a new key pair (or alternately choosean existing one if you’ve already created one). Just enter a name, andthen click to Create & Download your Key Pair,as shown in Figure 7, “Creating a new Key Pair”. A key pair is a file thatcontains information that Amazon uses to authenticate you. You’ll want tostore this in a safe place on your computer.

Figure 7. Creating a new Key Pair

Creating a new Key Pair


Next we need to specify firewall information. This isimportant—without this step, no one would be able to access your website,and you would be unable to connect via remote desktop into your machine!Click Create a new Security Group, and then open upthe ports required as shown in Figure 8, “Configuring the firewall for our new instance”. You’llwant HTTP and HTTPS for your web server, and you may want to open up MySQLso that you can remotely manage your MySQL database (if you prefer tomanage it locally you can skip this one). We’ll also add RDP so that wecan remotely access the server’s desktop.

Figure 8. Configuring the firewall for our new instance

Configuring the firewall for our new instance


The last screen, shown in Figure 9, “Reviewing the chosen configuration”, summarizesall your configuration info. If you’re happy with the settings, just clickLaunch at the bottom of the screen.

Figure 9. Reviewing the chosen configuration

Reviewing the chosen configuration


Now we’re cooking! Click the View your instances on theInstances page link.From here you’ll see a list of the instances you created. It willtake a few minutes to start up the new machine, so now’s a good time tograb a snack.

Win an Annual Membership to Learnable,

SitePoint's Learning Platform

  • http://thebestdailydeals.com coupons online

    I am impressed to read such a powerful story about WordPress in the Cloud with Amazon EC2 and the Microsoft Web Platform Article » SitePoint. I will post a link on my coupon site to this blog post. I will be back to read more.