This article will guide you through creating a new Amazon EC2 instance to be used as a Web Server. You will also be shown how to create an AMI from the EC2 instance that will enable you to quickly make other new instances.
Launch a Basic Small Windows Server
- Log into or create an Amazon AWS account.
- Search for EC2 in the "Find Services" search bar.
- Click the "Launch Instance" button.
- Search for "Windows Server 2019".
- Select the Windows Basic 2019.
- Instance type - Select t2.micro for your instance type. Alternatively, you can choose a larger instance if you want installation to run faster. Instance size is the easiest option to upgrade later.
- Network - Use the same network if you already have resources running.
- Security Group - Select or create a group that allows web and secure access from anywhere. Ensure that the group allows you to RDS into the machine from only your location. If you prefer to manage SQL Server from your desktop, enable access to the SQL Server from your location as well.
- Choose or create a PEM Key Pair file and save it to a safe location.
- Launch the instance.
- Navigate to the EC2 Instances dashboard. You should now see the instance that you just created.
- Click the "Connect" button after a few minutes of waiting for the password to be available (AWS site says around 4 minutes).
- Use the PEM file that you saved to decrypt the admin password. Copy the password to your clipboard.
- Download and run the Remote Desktop file that is also present in the "Connect" window. Use the password saved to your clipboard to access the server.
Configure the Server
- Open Server Manager from the new server's desktop (can be found if you click the Windows icon in the bottom left of the task bar).
- Click Configure Local Server at the top.
- Turn off IE Enhanced Security in the Properties box at the top. You can also copy the installation download of your favorite browser to the server and install it, but IE works just fine for our purposes.
- Navigate to Roles and Features, click Tasks then click "Add Roles and Features".
- Under Server Role, choose "add Web Server".
- Select role-based or feature-based installation.
- Click Install.
Install SQL Server Express
- From your desktop, search for and download the installation file for the latest version of SQL Server Express.
- Copy the installation file to the desktop of the server (copy from your physical desktop and paste it to the server desktop).
- Install SQL Server using the basic default settings. Install SQL Server Management Studio from the installation completed screen if you want to manage the SQL server (or you can download it from the internet later).
Assign a Public IP address and Domain Name to the Server.
You can use the default Amazon domain name for the server (eg. ec2-1-2-3-4.compute-1.amazonaws.com) or give it one of your own.
Here are the basics of obtaining a custom domain name:
- Assign an Elastic IP to your EC2 instance.
- Purchase a domain name. Route 53 via AWS is a viable option.
- Connect the Elastic IP to your domain name.
- Bind the domain name to your site in IIS Manager.
NOTE: Using an Elastic IP is essential because the default IP of your server will change every time the server is reset.