Wednesday, July 14, 2010

How to install IIS on amazon EC2

When you enter your EC2 instance and want to add IIS [ via the add/remove programs -> add/remove windows components -> Application Server (double click) ... ], the server will ask you for a directory of installation files: convlog.exe on Service Pack 2 CD-ROM
and gives you a default directory such as: C:\sysprep\i386\i386

This directory doesn't exist, you need to mount a special snapshot EBS volume.
This can be done in 2 methods:

1) GUI method :
  1.1) (if you previously created the correct volume - skip to step 1.3) Go to the EC2 control panel (in AWS), click Elastic Block Storage -> Snapshots, filter by All snapshots.

Select the correct (matching your running EC2 instance configuration) snapshot:

The following is a list of available snapshots for US:
  • 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

The following is a list of available snapshots for EU:
  • Windows 2003 R2 Enterprise 32-bit: snap-a4bb5ecd
  • Windows 2003 R2 Datacenter 32-bit: snap-b8bb5ed1
  • Windows 2003 R2 Enterprise 64-bit: snap-a6bb5ecf
  • Windows 2003 R2 Datacenter 64-bit: snap-babb5ed3 
  1.2)  Right click the correct snapshot and 'Create Volume From Snapshot' - make sure you use a region that is exactly the same region as your instance (up to the last letter - e.g., "us-east-1b" - the 'b' is important !)
This step may take 10-15 minutes.

  1.3) Go to Elastic Block Storage -> Volumes, wait until the volume is created (status column), then right click it and select 'attach volume'. If you used the correct region, the combo box in the following dialog should allow you to select your image. Choose a drive and click OK.

The CDROM will be mounted on a new drive on your running EC2 instance (no need to close the running session during this procedure).

Locate the i386 directory on that driver and continue the installation process of IIS as described at the beginning of the blog post.

2) Command line method:
Using the amazon API Tools, follow the instructions here. You will need to install java & set the EC2_HOME and JAVA_HOME env variables before running the API Tools on your computer and you will need your private key too (login to this page for your private key info or in AWS panel go to 'account' -> 'Security Credentials' ).

5 comments:

  1. useful! many thanks

    ReplyDelete
  2. Is this what I need to do in order to push a Silverlight Application to the EC2 Cloud?

    ReplyDelete
  3. Thanks for this post. This is still relevant as of 2012.

    ReplyDelete