Configuring Windows Components (Like IIS) on Amazon EC2

After getting my Amazon EC2 imaged created, I quickly discovered that the default image is as bare-as-bare-as-can-be.  They had other default images with SQL Server 2005 Express on it, but I prefered to use a clean Windows customized by yours truely.

Optional Windows Server operating system components are typically added or configured using installation media. This tutorial describes how to add or configure optional Windows components within the Amazon EC2 environment.

Windows Server operating systems include many optional components. Installing all components on each Amazon EC2 Windows AMI is not practical. Instead, you can access the necessary files to configure or install components using Elastic Block Storage (EBS) Snapshots.

The following is a list of available snapshots:

  • Windows 2003 R2 Enterprise 32-bit: snap-bb10f6d2
  • Windows 2003 R2 Datacenter 32-bit: snap-8010f6e9
  • Windows 2003 R2 Enterprise 64-bit: snap-d010f6b9
  • Windows 2003 R2 Datacenter 64-bit: snap-a310f6ca

Simply add the volume with a size of 2GB – using whatever tool or command line you prefer – to set it up and attach it to the instance you want to configure.  It might take a few moments for the instance to detect the volume, but after that, you will then be able to configure the Windows Components Wizard to point to the new volume.

Install A .Net Service Via Command Line

I’ve been working with .Net services for the last few years or so and it is often convenient for debugging to be able to install your debug version. Since it is a major pain to build an installer every time we want to test, we used the command line utility InstallUtil.exe that comes with the .Net Framework to install and uninstall our services in batch files.

If you’ve installed .Net in the default location InstallUtil.exe lives in C:\Windows\Microsoft.Net\Framework\v2.0.50727\InstallUtil.exe
in the respective framework version directory.

Below is an example batch file.

C:\Windows\Microsoft.Net\Framework\v2.0.50727\InstallUtil.exe [your-service.exe]

and to uninstall, use the /u flag

C:\Windows\Microsoft.Net\Framework\v2.0.50727\InstallUtil.exe /u [your-service.exe]

Using these batch files we just create short cuts to them and can double click the short cut to install or uninstall. Of course you can install/uninstall more than one service in the batch file.

Be sure to also check out the other flags available for InstallUtil.