Amazon EC2 provides free micro instances of Windows 2008 x64 with SQL and IIS preinstalled. I’ve been carving out pieces of our internal infrastructure and placing them into cloud-based solutions like Amazon. Ideally, a bomb could go off at EnGraph and we wouldn’t skip a beat.
Since the process of configuring Microsoft SQL Server is easy, but not exactly obvious, I’ve laid out step-by-step instructions on how to do this. Did I mention it is free? Well, 750 hours a month for free (I’ll wait while you do the math).
- Sign into Amazon Web Services console. If this is the first time working with AWS, credit card authorization ($1.00) and a phone call verification will be performed. From scratch, this process takes about 10 minutes to complete.
- Once the console is loaded , click “Launch Instance”.
- Select Windows 2008 x64 with SQL Express and IIS and click “Select”.
- On the following screen, make sure “micro” is selected and click “Continue”.
- On the Advance Instance Detail page, make sure shutdown behavior is “stop”, click “Continue”.
- A name can be entered on the Keys page to distinguish it from other servers, then click “Continue”.
- Creating a key pair will allow Remote Desktop Access to the EC2 instance. This is needed. Name the key, then click “Create and download”. Download the .pem file to a place where it will not be lost. You are using Dropbox, right? Click “Continue”.
- The Security Group page configures which ports will allow incoming traffic. It is like the external firewall. By default ports 80 (IIS), 3389 (RDP) and 1433 (SQL) are allowed. Create a new security group with these default settings and click “Continue”.
- Verify all the settings are correct on the last page. Pay specific attention to Instance Type (should be micro) Shutdown behavior (should be stop) and key pair name (should match what was created in step 7). Click “Launch”.
- The server will be created and configured, then it will spin up and be ready for use. This process usually takes about 10 – 15 minutes.
- Once the server is ready, check the box next to the new server name, then click “Instance Management”, when the context menu opens, click “Get Windows Password”.
- On the screen that opens up, click “Choose File” and browse to where the .pem file was saved from step 7. This will decrypt the administrator password. Copy and paste this password in a new note. You are using Evernote, right?
- Back in the Management Console, click “Elastic IPs” under Network & Security.
- Click “Allocate New Address”
- On the dialog that opens up, select “EC2″ and click “Yes, Allocate”
- A new IP address will be allocated and displayed in the list of address. Make note of the new address and copy it into your Evernote note.
- Check the box next to the new IP address, then press “Associate Address”
- On the dialog that opens up, select the new instance and press “Yes, Associate”
- Open a Remote Desktop Client – I’m partial to CoRD.
- Create a new RDP connection. The server name will be the address from step 16. The username will be administrator and the password will be from step 12. Go ahead and forward disks as well.
- Once an RDP connection is established with the new server (pretty cool right? Remember this is free!), go ahead and change the administrative password to something easier to remember. Click the Start menu, select Control Panel, click User Accounts and step through the wizard to change the password – make note of the updated password.
- Log off the server and reconnect using the new password.
- Internet Explorer is a nightmare on a server OS. I keep a standalone installer of Google Chrome in my Dropbox. This is why we forwarded the disks in step 20. Open up My Computer and browse to the installer file using the \\tsclient drives. This step is not relevant to this exercise, but it is just good practice.
- We are now ready to configure SQL Server. Click the start menu and browse to SQL Server Management Studio.
- Once it loads (it will take a little bit the first time), logon using the credentials that are pre-populated.
- Right click on the server name (at the top of the tree view) and select “Properties”. A dialog box will open up.
- Click the security tab and change the Server authentication to be “SQL Server and Windows Authentication mode”. This is also know as mixed mode. Click “OK” to close the dialog and press “OK” to the next dialog telling you to restart the server (it doesn’t mean the entire server, just the service running SQL Server – not exactly intuitive naming in my opinion).
- Right click on the server name and select “Restart”, click “Yes” to the “are you sure” prompt.
- Once the SQL Server is restarted, expand the “Security” node, then expand the “Logins” node. Right click “sa” and select properties.
- Create and confirm a new password. Then click into the “Status” pane and change it to “Enabled” under “Login”. Click “OK”.
- At this point, Management Studio should be closed and reopened using the new credentials for testing. Change the Authentication mode to “SQL Server” and enter “sa” for the user and the password created in step 30.
We are finished! Management Studio can be opened up from a different computer, enter the address from step 16 and control the SQL Server instance remotely.
A couple things to remember.
- There is only about 9 or 10 GB free after everything is installed and configured. This should not be used for Wikipedia clones.
- There is only 613 MB of RAM. Make sure to log off Windows after finishing RDP sessions to conserve resources.
I’ve been really happy with my micro EC2 instances. This blog is run on a micro instance (and has stood up to some large traffic days), I’m slowing moving MentionNotifier to run on a combination of EC2 and SES.
We also have a large instance running that we use for our ParaPlan Cloud clients. It has been a great experience for us. We are able to save our clients a lot of money in IT and server costs, while not having to actually maintain any hardware.
I hope this tutorial has been helpful. Cloud computing is the way of the future and it is very nice to see companies like Amazon lower the barrier of entry so far that people can try it out for free.