A quick way to install an AWS web server

We all know that with a web server it is possible to access web pages using the HTTP protocol. This post will quickly teach you how to install AWS web server

A quick way to install an AWS web server.

Step 1. Configuring the AWS Console to install the web server on AWS.

1. In the service menu, click on EC2.

2. Click on Launch Instance.

3. Next, select the following items:

a. Choose Amazon Linux AMI as shown below:

b. In the next step, select the Instant Type page, make sure to select t2.micro and then click Next: Configure Instance Details

Configuring AWS Web Server

from. At the next stage “ Configure Instance Details ”Nothing will change if not required.

d. In the next step “ Add Storage ”Select the SSD option and the size in GB, the default is 8GB.

e. In the next step “ Add Tags ”. Click on the Add Label button and enter the value for the name and column “Webserver” as shown below:

Configuring AWS Web Server

Now next, click on the button Configure Security group

f. On this tab, add another rule for HTTP port 80 to SSH port 22, so that we can access the HTTP web server to the index.html web page, as shown below:

  • Click the Add rule button
  • In the drop-down list select “HTTP” as shown below and click the Review and Launch button:

Configuring AWS Web Server

g. In the next step, we will go over all the settings and click the Launch button.

h. In the next step, select key pairs, if you have any existing other, choose a new one. Click on registration and click the Launch Instances button.

You will now see one running instance in the EC2 dashboard as shown below:

Configuring AWS Web Server

i. Now select Instance and note as Public DNS (IPv4). This is required to log into the EC2 instance as well as access the web server.

Configuring AWS Web Server

Now the next step we need to install the web server program on the server for this follow these steps.

Step 2. Configuring EC2 to Install the AWS Web Server.

a. Log in to your EC2 instance. If you don’t know how to log into your EC2 instance, please check this link.

b. Now install the HTTPd, PHP, MySQL, and PHP-MySQL packages required to “Install AWS Web Server”.

                      # yum -y install httpd php mysql php-mysql

c. Enable the HTTP service using chkconfig so that HTTPD starts automatically after server reboot.

                      #chkconfig httpd on

d. Start HTTP or web server service.

                      # /etc/init.d/httpd start
Starting httpd:                                            [  OK  ]

e. Now we need to make a sample index.html file so that it appears every time we try to access the web server.

                      cd /var/www/html/
vi index.html

and paste below content into file, save and exit.

                      # cat index.html
<p><b>Добро пожаловать на веб-сервер AndreyEx!!!!</b></p>

Now try to access the webpage using the DNS address recorded in step 1. h.

You should see a message confirming that we have successfully installed the AWS web server.

Related Posts