Create Web Server in AWS (Amazon Web Services)

Create Web Server in AWS (Amazon Web Services)

STEP 1:

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

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

Click on sign in to Console button.

STEP 2:

Logging to aws account

Provide username and password then click on sign in.

STEP 3:

Enter  into AWS Management Console Dashboard

We can see the AWS Management Console Dashboard.

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

Use below link to create Linux Ec2 instance in AWS

Launch Linux EC2 Instance

It will be displayed EC2 – Dashboard and click on Running Instances.

STEP 4:

Connect to Your Instance

In order to connect to your Windows virtual machine instance, you will need a third-party tool like putty

Copy the public DNS for connect your instance through putty.

Go to putty tool and enter DNS which was copied earlier from your instance.

Go to connection at the left side menu then select “SSH” and then select “Auth”. You need to click on the browse button to select the My Linux.ppk file that we created recently.

Click on open.

Ignore warnings and click on yes.

Once you connect, you will successfully see the Linux Virtual Server Terminal.

STEP 5:

we have to run some Commands to Convert from Linux Server to Web Server

  • sudo su
  • yum update -y
  • yum install httpd -y
  • cd /var/www/html
  • echo “ktexperts is a knowledge sharing platform” > index.html
  • ls
  • service httpd start
  • chkconfig httpd on

Logging to Linux Server

STEP 6:

Switch normal user “ec2-user” to root user “root”

STEP 7:

Update all the packages in current available version

We update all the packages at once per one server

If you mention -y it will do all the updates automatically otherwise it will wait until hit enter y(yes)

STEP 8:

In the Linux by default we get some directories with operating system

One of default directories is /var/

Check the /var/ Directory

STEP 9:

Install web package

The name of web package is httpd

Httpd –  Hypertext Transfer Protocol Daemon

HTTP Daemon is a software program that runs in the background of a web server and waits for the incoming server requests. The daemon answers the request automatically and serves the hypertext and multimedia documents over the Internet using HTTP

STEP 10:

After installing web package two directories will be created in /var/ directory

www directory will be created in /var/ directory

html directory will be created in /www/ directory

STEP 11:

Check the /www/, /html/ directories

cd – change directory

clear – clear the screen

Create a file “index.html” in the /html/ directory and put required content

echo command in Linux is used to display line of text/string that are passed as an argument

STEP 13:

Verify idex.html file

Verify idex.html file in /html/ Directory whether it was created or not

STEP 14:

Start the service

If you run this command once whenever you restart your machine the service starts automatically

Note: If you don’t run this command whenever restarts the machine, we need to start the service manually

STEP 15:

Take Public DNS (IPv4) / IPv4 Public IP and search in browser URL

Copy the either Public DNS (IPv4) or IPv4 Public

Search in browser URL.

We can’t get the content of web server because lack of HTTP Port.

When you enter Public DNS (IPv4) or IPv4 Public in browser.

Your request is going to web server but it’s not going to inside the web server.

We Need HTTP port “the request is going to inside the webserver and coming back then content will be displayed”.

SSH – It will help us to request go inside physically and run the commands

HTTP – It will help us to access your website through internet

STEP 16:

Add HTTP Port

Go to security groups at bottom of your Linux server and click on launch–wizard 1.

Go to Inbound and click on edit.

STEP 17:

Add security Group

Click on Add Rule.

Choose HTTP Port.

Click on save.

STEP 18:

Take Public DNS (IPv4) / IPv4 Public IP and search in browser URL

Copy the either Public DNS (IPv4) or IPv4 Public in browser.

We can able to see the content anywhere in the world.

HTTP

HTTP stands for Hypertext Transfer Protocol. It is a protocol for to communication between two systems e.g. the browser and the web server.

http transfers data between the browser and the web server in the hypertext (We can read) format

HTTPS

HTTPS stands for Hypertext Transfer Protocol Secure. It is a protocol for securing the communication between two systems e.g. the browser and the web server.

https transfers data between the browser and the web server in the encrypted (we can’t read) format.

 

 

Thank you for giving your valuable time to read the above information.

Follow us on 

Website :  www.ktexperts.com

Facebook Page : KTexperts

Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading...

3 thoughts on “Create Web Server in AWS (Amazon Web Services)

Add Comment