In this tutorial, we will learn how to launch an EC2 Server, the Ubuntu Linux Virtual Server and host a web site by serving index.html .

What is AWS?

Amazon Web Services ( AWS ) is an Amazon auxiliary which offers cloud-computing services at identical low-cost rates, therefore making its customer base .
Key AWS Services are EC2, RDS, S3, and CloudFront. There are a full of 140+ services which covers calculate, storage, databases, analytics, network, mobile, developer tools,
management tools, IoT, security, and enterprise applications.

Amazon EC2 Instance

Amazon Elastic Compute Cloud ( Amazon EC2 ) provides scalable computing capacity in the AWS Cloud. In other words, it provides us with a virtual server with different capacities to best suit your needs. Amazon EC2 enables you to scale up or down to handle changes in requirements or spikes in traffic with relief
An on-demand EC2 case from AWS is one in which the user can rent the virtual server per hour and use it to deploy his/her own applications .

Step 1: Launch an Instance

  • Log into the AWS cabinet .
  • From the top right corner of the EC2 splashboard, choose the AWS Region in which you want to launch the EC2 server .
  • From the splashboard, choose Launch Instance .

Choose Amazon Machine Image (AMI)

Amazon Machine Image or more normally known as AMI which includes an operate arrangement, and required software/Applications which depends on AMI .

For our example, we will use Ubuntu Server 18.04 LTS (HVM), SSD Volume Type ( This effigy is exempt tier eligible ) .
Click Select to choose AMI .

Choose EC2 Instance Types

In the adjacent gradation, we need to choose the case type. For our case, we will use t2.micro  which is barren tier eligible .

Configure the Instance

For our case, we can leave default settings .
Number of Instance – How many Instances you wish to launch, one in our character .
Purchasing Options – Launching in On-Demand price ( We can besides choose spot exemplify )
Read more on Spot Instances .
I will write a detail description on full settings later .

Click on Next: Add Storage.

Add Storage

elastic Beanstalk ( EBS ) volume is a virtual Hard Disk in the obscure .
volume type Root indicates that Root bulk will be partition from where our OS will boot .
We can add extra partitions if we want by clicking Add New volume .
Delete on Termination means the EBS will be deleted if we delete the EC2 case .

Add Tags ( optional )
Add tags provides a key-value pair to mark your exemplify, It can be used for better price analysis .
It is very useful in case of big infrastructures with many Instances .
Click Next : Create a Security Group.

To read more on Tags read here .

Configure Security Groups

security Groups are like firewalls that define what type of traffic we want to allow .
Since we wish to SSH (port – 22) into our EC2 Server and allow web traffic through HTTP (port – 80) and HTTPS (port – 443) .
We will besides set the source as My IP for SSH and for web dealings i, HTTP and HTTPS we will put Anywhere.

Click Review and Launch .

Review Instances

Review the case settings and hit launch .
We will get a dialogue where we will create a Public and Private key pair. The private key is stored in Instance and the public key is given to user do not let anyone know your public or individual cardinal otherwise they may use it to compromise your virtual machines .

Click on Download Key Pair to download winder pair and keep it safe.
After a successful launch of example, you will be taken to the Instance filmdom .
When the condition of Server change from pending to running, you can SSH into your Server to perform access .
SSH into our machine and install the webserver .
Check your public address from example details or assign an rubber band IP.

After allocating address you must attach it to your Server .
Choose an example from the drop-down menu and click Associate to attach it to Server.

immediately we need to SSH into our waiter ( here we are using AWS Dashboard but we can besides use putty or terminal to access SSH, more on that late ) .

ssh -i  ubuntu@

Let ’ s sign it to superuser ( etymon ) by –
sudo su
immediately let ’ s update all services/packages and install apache web waiter –

apt-get update

apt-get install apache2

nowadays let ’ s start the service :
service apache2 start Server index.html
You must have your files to be served
By default option apache2 web server serves a index.html from placement /var/www/html, now lets copy your code and paste in this directory ( /var/www/html ) .
We need to reload apache2 web waiter now. Type the come command :

service apache2 reload
now let ’ s check mark on the browser if our web site through index.html is served or not .
Copy populace address or elastic IP of your waiter from EC2 console by selecting your server and paste it on the browser .

beginning :
Category : Website hosting

Leave a Reply

Your email address will not be published.