First of all, we will be launching one EC2 istance on AWS cloud that mean we will be launching our
Web server on AWS cloud and then we will be installing the Apache Web server on that.
And then we will see whether we are able to access.
We are not going to cover just we will make one simple Web page and we will see whether we are able
to access that Web site or not for practical purposes.
We will be using AWS.
EC2
And you can get the AWS cloud free tier for one year.
So we are assuming that you can create your free account on AWS type of thing.
So here we will be looking at that.
So first of all, what we will do, we will go into the AWS console, On AWS console.
Lot of services are there.
But what we are interested we are interested in this EC2, EC2 is used for creating virtual
servers in the cloud.
Or you can say that we can create virtual machines in the cloud, like for all the other labs.
We created three VMS for the experimental purpose same way we can create the servers in the cloud.
So for that we need EC2 service.
So we will click on EC2 service.
Then we will try to launch one instance how we are going to launch one instance.
And please remember whenever you have to use AWS cloud, first of all, we need to create one key pair
that public private key pair because whenever we are creating the VMS, we have to lock these VMS with our
public key.
Once we have locked our VMS with the public key, we can only open it with a private key.
So we have to create the private key how we are going to create in our case, we have already created.
If in your case it is not already created, then what you can do is create key pair.
You can specify the name of the key and then you can download the key in PPK format or in PEM format.
If you are downloaded in PEM format, then you need to convert that into PPK format by
using some software like putty.
But we have already done this thing.
So Straightway, what we will do, we will go into our again EC2 dashboard.
We will go to the instances, although in our case we have already launched that instance.
I'm just going to tell you how we launched that instance.
So whenever we are talking about the EC2 service, how to launch the instances, you have to say
launch instance there, you will get this option.
Launch instances.
Now, a lot of choices are available, like Amazon linux2 AMI, MAC OS is there Redhat enterprise.
So suse linux, Ubuntu, windows are there.
Here we are going to choose.
Amazon Linux.
Why?
Because it just behaves like the Centos7 that we have used in our other labs.
So all the commands that we are comfortable there, they all will run in this Amazon Linux.
And also other advantage is that it comes under free tier eligible.
That mean when you're going to use it, there will be no charges for this operating system.
So it is available for x86 architecture.
And arm architecture also, but we are going to select 64 bit x86.
So we are going to say select.
Then you need to specify which processor you want to use, a lot of options are there in our case,
we will keep it to t2.Micro, in which it is going to give us one virtual CPU, 1GB RAM although other
you can also choose.
like this is going to give you a 8 virtual cpu and 32GB RAM.
But again, we want to keep our resources running under Free tier.
So this comes under your free tier t2.micro.
So we are going to choose.
So we are going to say next configure detail, how many instances we just want one network subnet settings.
OK, then what are you going to say add storage.
Here, you can specify because by default, when you're going to launch a Linux machine cloud,
it is going to give you 8GB, you can increase the size, but for this experiment, 8GB is more
than sufficient.
So we're going to keep as it and then add tag.
What do you mean
by tag like when we implement the physical servers, we name our servers.
So some time in AWS, thousands of machine might be running.
So we want to identify those machine so we can add the tag.
How we can add the tag like name then we can specify.
Apache.
Server, anything you can specify.
Then configure security group.
Now, that is the most important thing in configures group mean by default when you are installing the
Linux, it is automatically going to openssh port.
But what other ports we need, we need because we have to implement HTTP servers.
We need a http.
So we are going to do http also then we will be doing https also.
So it is opening 22, 80, and 43 ports, then review and lunch, and it is going to give you the
information that everything is OK.
You can double check all the things, then what you can say lunch, and then you have to select the
key pair that you have already created.
If you are not already created, what you can do, you can create it here.
And then you have to acknowledge then you have to say launch instance, in every case we have already done
this, then what we have to do.
So in my case, I'm going to cancel it.
So when we are going to lunch after two or three minutes, what it will show, it will show you the
status that it is running.
So then you are going to click it.
Now you have to find out the details about this machine.
The most important thing is because these all machines are given one private address, also public address
also.
So you have to note down this public address, once you have noted down this public address.
Now, you need to connect with this instance which is running in this region ohio region.
So you have to access it from the local machine because my local operating system is window.
So what I have to do, I have to click on this.
Putty tool is there.
So here we are going to type the address, whatever addresses which has been allocated, then connection.
Sometimes when there is inactivity for sometime, your connection with that machine will get lost.
So you can specify this keepalive value what will happen.
It will automatically keep on sending keepalive message that connection will not get terminated.
Then you have to specify the data also, here by default, when you create that machine, one user
get created the name of that user is EC2 user.
then you have to specify your private key, in our case, the private key browse it is in some folder
on desktop, vipin folder is there.
So I am going to specify that now please remember when you are doing this, when we are going to say
open the font size will be a little bit very small so you can go into the appearance and you can change
the font.
We are keeping a little bit larger font.
So I'm saying, okay, then we are going to say open.
Now what it will do, it will try to open.
And if you are first time you are going to access this.
So it will show you one message that whether it is safe to connect that machine.
So there you are going to say yes.
So by default, we are into which directory.
Let us little bit change the color of this.
So I will go into, we will see whether there are certain settings that change settings appearance.
So color i just want to change.
Colours.
So we will see what colors.
Default.
OK, I'm keeping it default, but it need not changing, so we will see a later here how to change this.
So here what we are doing where we are just running this pwd command.
Now, we are log in as a EC2 user.
So now what we would like we would like to log in as root user because Certain Command, you can do only
with this as a root user so you can specify sudo -s.
Now, we have logged in as a root user.
So now the first thing is you have to install the software and for that you can use the yum install httpd
like we did in our local machines same way, same command.
will run.
And then what you can do after that, we can verify with which command?
rpm -q.
And we can check the package, whether httpd packages there or not, in our case, it is
already installed.
So what we will do, we will go into /var/www/html directory, here.
We are going to create one page, how we are going to create one page in this way.
index.html.
Then what we are going to say, we are going to type likethis thing Apache Web.
Server, what you can specify.
Running on.
cloud you can specify, please remember, in our case, we are showing all these things, we have
already created this thing.
So these all slides are there whatever steps we are performing that mean this is the thing that how we
did.
launched instance.
Then we selected the AMI then t2 tier, one instance.
Then we selected that, you can say hard disk, then name Apache Web server, then we open
those port.
here we name our security group as Web server description Apache Web server.
Then that was the review screen, then launch.
We choose that,.
We specify the key then this was when it was launching.
Then it was showing one menu view instance, when we clicked on The View instances.
What it was showing, it was showing this screen.
So we noted down the address and that is we specify EC2 user, then that ip address
port is 22.
Then we change the font size to 18, then we specify the key.
And this was the screen.
And with sudo -s, we logged in as a root user then rpm query httpd, initially it was not installed, so
we installed by yum -q install httpd in quite mode.
So this was the screen.
It installed certain dependent package also, and it was asking for the conformation.
So we specified.
Yes, like in the local lab we implemented, then we have going to into the /var/www/html directory and then we created
the file Apache web server is running in cloud.
So here also what we are trying to do again, we are saying.
in.
cloud.
So we can save.
Clear the screen, then which command you're going to run systemctl.
restart httpd because here already .
First it is running, so you have to restart in real what command you have to run.
These are the command.
We are going to run for temporary running httpd server, you have to run systemctl start httpd systemctl
enable httpd, then we can verify it with the IP address, whether it is working properly
or not.
So we will go to the browser and specify this address.
So let us go into the browser.
So we are going to specify the address http://
the address of the virtual machine 52.15.85..
32.
So this is a apache web server running in cloud that mean our Apache Web server is properly running.
That was the verification, and if you want to change the configuration settings, please remember all
the files are same like you can open with vi editor vi /etc/httpd/conf/httpd.conf.
Same file are there, same thing we can configure in cloud like we did in so we will not be again repeating
those things.
We just wanted to show you how to launch one instance in cloud.
So this is our instance properly working and we are able to access the page as we have shown.
So both we have covered a little bit practical also, and we have shown you the slide.
So very easy to launch in the cloud, your Web server.