How to Create Web Server On Linux EC2 Instance By Using Bootstrap Script

Share via:

Hi Dears,

In this article,we will see Create Web Server On Linux EC2 Instance By Using Bootstrap Script.

Steps to Follow:
  1. Logging to AWS Account
  2. Create Web Server By Using Bootstrap Commands
  3. Go inside the Web Server through Putty & Verify Bootstrap Commands
  4. Verify content of Web Server in Browser
1. Logging to AWS Account

First, we need to AWS Console page by using below link.

https://aws.amazon.com/console/

Click on sign in to Console button.

Logging to aws account

Login using username & password and click on sign in.

Enter to AWS Management Console

We can see the AWS Management Console Dashboard.

2. Create Web Server By Using Bootstrap Commands

Go to Services, under the compute module click EC2 service to open.

 

In the EC2 Dashboard we can one security group is available by default and click on Launch Instance.

 

Go to Instances and click on Launch Instance.

Choose an Amazon Machine Image (AMI)

Select the Operating system of the EC2 instance by choosing any of the Amazon Machine Images (AMI). Select the Microsoft Amazon Linux AMI.

Choose an Instance type

Choose the Type of instance depending on your requirements.

Instance types comprise of varying combinations of CPU, memory, storage, and networking capacity.

select the default option of t2. micro – this instance type is covered within the free tier. Then click on Configure Instance Details.

Configure Instance Details

Configure EC2 instance details as per requirements of your environment and click on Add Storage.

Choose the Type of instance depending on your requirements.

Instance types comprise of varying combinations of CPU, memory, storage, and networking capacity so you can choose the appropriate mix for your applications.

select the default option of t2.micro – this instance type is covered within the free tier. Then click on Configure Instance Details.

Go to Advanced Details and type commands for bootstrapping in user data.

The commands are

Click on Add Storage.

Add Storage

Here, we can see root volume by default and size of 8GB

Add a new volume if required

Click on Add Tags.

Add Tags

Tags assist in easier identification and classification of the various instances in your AWS environment.

Click on click to add a Name tag to provide name for our server.

Provide the name for the Linux virtual machine for easier understanding and click on Configure Security Groups.

Configure Security Group

A security group allows configuring firewall rules to allow traffic as needed. Only one rule has been added to allow remote connection.

SSH Is enough to connect to our Linux virtual server and click on Review and Launch.

SSH – Secure Shell.

Select HTTP port

Select an existing security group and click on Review and Launch.

Review Instance Launch

Review and confirm the configuration of the instance. Click on the Edit button on each configuration item to make changes and click on Launch.

Choose existing Key Pair and Launch Your Instance

To connect to your virtual machine, you need a key pair. A key pair is used to log into your instance and select existing key pair.

click View Instances to view the instance you have just created and see its status.

We can see the instance “Web Server” has been created successfully.

3. Go inside the Web Server through Putty & Verify Bootstrap Commands
  1. We can go inside the Web Server by providing public IP & ppk file in the putty

Verify Bootstrap commands

Verify the status of Apache HTTP Server

4. Verify content of Web Server in Browser

Copy public IP of webserver as shown below.

Search Public IP of Web Server which was copied.

 

Thank you for giving your valuable time to read the above information.
Follow us on 
Website  www.ktexperts.com
Facebook Page KTexperts
Linkedin Page : KT EXPERTS

Follow Me
Ramesh’s Linkedin : Ramesh Atchala

Share via:
Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Add Comment