Launching One windows EC-2 Instance with IIS server On AWS
Tags: aws, ec2, cloudcomputing, amazon
Published: 2020-07-20 08:00:34

Launch one T2 micro type windows server instance on AWS. Configure an IIS server with a default web page.

* About EC2
* Setup EC2 Instance
* Step wise installation.
* Setup remote desktop connection.
* Configure an IIS server with default page
* start our created webpage.

### Elastic Cloud Computing (EC2)
Amazon Elastic Compute Cloud (Amazon EC2) provides scalable computing capacity in the Amazon Web Services (AWS) cloud. Using Amazon EC2 eliminates your need to invest in hardware upfront, so you can develop and deploy applications faster. You can use Amazon EC2 to launch as many or as few virtual servers as you need, configure security and networking, and manage storage. Amazon EC2 enables you to scale up or down to handle changes in requirements or spikes in popularity, reducing your need to forecast traffic.

### Setup EC2 Instance

Sign up on AWS at [https://aws.amazon.com/](https://aws.amazon.com/)  and make an account. You will need to enter your billing and credit card information. 
Note: You should delete instances you no longer need to ignore any additional billing unknowingly.

Find and Select Amazon EC2 from listed products and services.
Click the button: "Launch Instance"

Step 1: Choose an Amazon Machine Image (AMI): This is the operating system your virtual machine in the cloud will be.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/k8izo82n6wk1zgr2b3cf.png)

Step 3: Configure Instance Details: Leave the default settings. Click "Next: Add Storage"

Step 4: Add Storage: Leave the default settings. Click "Next: Add Tags"

Step 5: Add Tags: Create a key and value.

Step 6: Configure Security Group: Check the radio button labeled "create a new security group" and give it a name and description. Make sure there is an RDP type listed and add HTTP and HTTPS. Click "Review and Launch"

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gkjizxyrz61xith4v1jf.png)

Step 7: Review Instance Launch: Click "Launch" The following window should appear. Select "Create a new key pair" and type in a name. Click "Download." Make sure you save this file!!! Click "launch instance" You should be redirected to a page where you can click "view instances" to see all your instances. Your new EC2 instance should appear and may take a few moments to initialize.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/t04q7ywg8wtgrcn1agdz.png)

### Setup remote desktop connection.

* In the Connect To Your Instance popup, click Download Remote Desktop File to download the RDP file, already preconfigured for your EC2 instance.
* In the same popup, click Get Password to obtain the authentication password.
* Load your private key and click Decrypt Password. The password will then be visible in your screen.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/q7f98vtg8c2glbmdkrij.png)

You are now connected to your Windows Server machine.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/h4uwz41goprmwwrib38u.png)

### Configure Internet Information Services (IIS)

Internet Information Services (IIS) is an extensible web server created by Microsoft and available in Windows machines. IIS may or may not be enabled by default in the Windows Server EC2 instance.

1. In order to enable IIS, launch Server Manager and select Manage > Add Roles and Feature

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/c0muiuyi3ap6wvkq6x4x.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/im0s791bresuzsef2pay.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/uxw87vi5xv3zyaukzqry.png)

2.In the Add Roles and Features Wizard, Server Roles page, find and check “Web Server (IIS)”

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/qi6eah8r578s6d79nszz.png)

3.In the Roles Services for Web Server Role (IIS), check the desired options to be include in the installation
Note: The installation may take several minutes.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zf8e0zvzf68hbxx4abh2.png)

4.Go to explorer, then in the new tab give localhost and IIS server is launched.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/wrrhnucflq4hamrjbmv7.png)

5.If everything is installed correctly, you should be able to enter the IP address of your EC2 instance in any web browser, and see the IIS default page

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3cdp0yhevv0gb12snwtj.png)

### Webpage

For hosting our html web page, go to C drive 🡪 inetpub 🡪 wwwroot 🡪file.
By deleting default files in that folder, we got the error and finally replaced the file with our web(html) file and worked.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6en7clw1cvw7sjxgc0qy.png)

You should be able to enter the IP address of your EC2 instance in any web browser.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/pavhuqsvsiweuao24d9s.png)