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”.
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.
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 the 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.
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!
Click continue at the bottom of this page, then click 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!
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”.
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 . 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 tab and search for “MicrosoftWeb Platform,” as shown in Figure 5, “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.
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 ,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.
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.
The last screen, shown in Figure 9, “Reviewing the chosen configuration”, summarizesall your configuration info. If you’re happy with the settings, just click at the bottom of the screen.
Now we’re cooking! Click the 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.
Bill Staples is a long time web enthusiast, currently employed at Microsoft Corporation as General Manager of the Web Platform and Tools engineering teams including IIS, ASP.NET, Visual Web Developer, IIS Media Services.