High Availability Web Server Architecture using AWS CLI

High Availability Web Server Architecture using AWS CLI

  • Task Description:
  1. webserver configured on ec2 instance.
  2. Document root(/var/www/html)made persistent by mountingon EBS block device.
  3. Static objects are used in code such as pictures stored in s3.
  4. Setting up content Delivery Network using CloudFront and using the origin domain as s3 bucket.
  5. Finally, place the cloud front URL on the web app code for security and low latency.

Now let's get to the task:

Here we will discuss about some basic definations:

  • EC2: Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers. Amazon EC2’s simple web service interface allows you to obtain and configure capacity with minimal friction. It provides you with complete control of your computing resources and lets you run on Amazon’s proven computing environment.
  • CloudFront: Amazon CloudFront is a fast content delivery network (CDN) service that securely delivers data, videos, applications, and APIs to customers globally with low latency, high transfer speeds, all within a developer-friendly environment.

S3: Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance.

  •  Amazon S3 is designed for 99.999999999% (11 9’s) of data durability because it automatically creates and stores copies of all S3 objects across multiple systems. This means your data is available when needed and protected against failures, errors, and threats.
No alt text provided for this image


  • WebServer:A web server is server software,that can satisfy client requests on the World Wide Web.
  • web server processes incoming network requests over HTTP and several other related protocols.

Implementation:

Step 1:configure aws.

Step 2:create an EC2 instance to configure the webserver on it.

No alt text provided for this image
No alt text provided for this image
  • We can see my EC2 instance is configured and now running.

Step 3:Now Creating an EBS volume and attaching the volume to the above instance.

No alt text provided for this image
No alt text provided for this image
Now here we can see my volume is created and attached to my instance.

Step 4:Installing httpd server.

  • Commands: yum install httpd
  • systemctl start httpd:This will help us to start the services.
  • systemctl status httpd:This will help us to check wheather my web server is active or in-active.
  • systemctl enable httpd:To enable permanently the services.

For configuring HTTPD server we have to login with the instance on top of which the server is to be configured.

Here i connected via cli using ssh command.
No alt text provided for this image
No alt text provided for this image

Therefore, httpd server is configured and is running.

Step 5:Now partition,format and mount the EBS volume.

  • fdisk -l:To check wheather my volume is attached or not.
  • lsblk:To see how many partitions and harddisks are available.
  • n:To create new partitions

partition type-p:primary partition (In one harddisk we can create only max 4 partitions).

e-extended(like a hardisk where we create logical partitions).

Here partition has been created
format:mkfs.ext4 /dev/xvdb1

mount:mount /dev/xvdb1 /var/www/html

Webpage is created in the folder /var/www/html.

Step 6:Creating s3 bucket

No alt text provided for this image
S3 bucket is created.

Uploading image into newly created S3 bucket:

No alt text provided for this image

Step 7:Creating a cloudFront distribution:

No alt text provided for this image
No alt text provided for this image

In the above image we can see Origin Domain:URL of the S3 bucket containing our data.

Step 8:Finally,Lets run our webpage with high availability architecture.

No alt text provided for this image

Thankyou for reading my article...

To view or add a comment, sign in

More articles by Vadlamani Lakshmi Bhargavi

  • Confusion matrix for Detecting DoS attacks

    A confusion matrix is a technique for summarizing the performance of a classification algorithm. Classification is a…

    1 Comment
  • GUI container on top of docker

    Task 02 👨🏻‍💻 Task Description 📄 📌 GUI container on the Docker 🔅 Launch a container on docker in GUI mode 🔅 Run…

    2 Comments
  • Deploying MachineLearning model inside Docker Container

    Task 01 👨🏻‍💻 Task Description 📄 👉 Pull the Docker container image of CentOS image from DockerHub and create a new…

  • Configuring Docker Using Ansible

    Configuring Docker Container With HTTPD Server Image and Hosting a Webpage: TASK DESCRIPTION: Write an ansible playbook…

  • Industry use cases on ansible

    Lets first talk about ansible: Ansible is an Open Source Software that is used for automation of…

  • Industry use cases on kubernetes/openshift

    This Article is about how container adoption is growing rapidly in the enterprise and how openshift platform based on…

    2 Comments
  • Industry use cases on automation using ansible

    The article is about: "Industry use cases on Automation using ansible with two best industry expert Mr.Sreejith anujan…

  • Industry use cases solved Using Kubernetes

    Before we dive into kubernetes let’s briefly discuss some background. This will help us to better understand the…

  • Automation Using Python

    Here's an article on Automation using python. Me and my teammates have created a menu driven program which can automate…

  • AWS Task-1 using AWS CLI.

    What is AWS CLI? The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. With just one tool…

    2 Comments

Insights from the community

Others also viewed

Explore topics