0% found this document useful (0 votes)
58 views

Creating Ec2 Instance

The document provides step-by-step instructions for creating an EC2 instance on AWS. It describes launching an instance, selecting an Amazon Machine Image, instance type, security group, key pair, and other configuration settings. It then explains how to connect to the instance using Putty on Windows and install and run Apache web server to serve a basic "Hello World" HTML page.

Uploaded by

Bharath
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Creating Ec2 Instance

The document provides step-by-step instructions for creating an EC2 instance on AWS. It describes launching an instance, selecting an Amazon Machine Image, instance type, security group, key pair, and other configuration settings. It then explains how to connect to the instance using Putty on Windows and install and run Apache web server to serve a basic "Hello World" HTML page.

Uploaded by

Bharath
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

Creating an EC2 instance

Sign in to the AWS Management Console.


Click on the EC2 service.
Click on the Launch Instance button to create a new instance.
Creating an EC2 instance
Now, we have different Amazon Machine Images. These are the snapshots of different
virtual machines. We will be using Amazon Linux AMI 2018.03.0 (HVM) as it has
built-in tools such as java, python, ruby, perl, and especially AWS command line
tools.
Creating an EC2 instance
Choose an Instance Type, and then click on the Next. Suppose I choose a t2.micro as
an instance type.
Creating an EC2 instance
The main setup page of EC2 is shown below where we define setup configuration.
Creating an EC2 instance
Creating an EC2 instance
Where,

Number of Instances: It defines how many EC2 instances you want to create. I leave
it as 1 as I want to create only one instance.

Purchasing Option: In the purchasing option, you need to set the price, request
from, request to, and persistent request. Right now, I leave it as unchecked.

Tenancy: Click on the Shared-Run a shared hardware instance from the dropdown menu
as we are sharing hardware.

Network: Choose your network, set it as default, i.e., vpc-dacbc4b2 (default) where
vpc is a virtual private cloud where we can launch the AWS resources such as EC2
instances in a virtual cloud.

Subnet: It is a range of IP addresses in a virtual cloud. In a specified subnet,


you can add new AWS resources.

Shutdown behavior: It defines the behavior of the instance type. You can either
stop or terminate the instance when you shut down the Linux machine. Now, I leave
it as Stop.

Enable Termination Protection: It allows the people to protect against the


accidental termination.

Monitoring: We can monitor things such as CPU utilization. Right now, I uncheck the
Monitoring.

User data: In Advanced details, you can pass the bootstrap scripts to EC2 instance.
You can tell them to download PHP, Apache, install the Apache, etc.

Now, add the EBS volume and attach it to the EC2 instance. Root is the default EBS
volume. Click on the Next.
Creating an EC2 instance
Volume Type: We select the Magnetic (standard) as it is the only disk which is
bootable.

Delete on termination: It is checked means that the termination of an EC2 instance


will also delete EBS volume.
Now, Add the Tags and then click on the Next.
Creating an EC2 instance
In the above screen, we observe that we add two tags, i.e., the name of the server
and department. Create as many tags as you can as it reduces the overall cost.

Configure Security Group. The security group allows some specific traffic to access
your instance.
Creating an EC2 instance
Review an EC2 instance that you have just configured, and then click on the Launch
button.
Creating an EC2 instance
Create a new key pair and enter the name of the key pair. Download the Key pair.
Creating an EC2 instance
Click on the Launch Instances button.
Creating an EC2 instance
To use an EC2 instance in Windows, you need to install both Putty and PuttyKeyGen.
Download the Putty and PuttyKeyGen.
Creating an EC2 instance
Download the putty.exe and puttygen.exe file.
Creating an EC2 instance
In order to use the key-pair which we have downloaded previously, we need to
convert the pem file to ppk file. Puttygen is used to convert the pem file to ppk
file.
Open the Puttygen software.
Click on the Load.
Creating an EC2 instance
Open the key-pair file, i.e., ec2instance.pem.
Creating an EC2 instance
Click on the OK button.
Creating an EC2 instance
Click on the Save private key. Change the file extension from pem to ppk.
Creating an EC2 instance
Click on the Save button.
Move to the download directory where the ppk file is downloaded.
Creating an EC2 instance
Open the Putty.
Creating an EC2 instance
Move to the EC2 instance that you have created and copy its IP address.
Creating an EC2 instance
Now, move to the Putty configuration and type ec2user@, and then paste the IP
address that you have copied in a previous step. Copy the Host Name in Saved
Sessions.
Creating an EC2 instance
Now, your Host Name is saved in the default settings.

Click on the SSH category appearing on the left side of the Putty, then click on
the Auth.
Creating an EC2 instance
Click on the Browse to open the ppk file.
Creating an EC2 instance
Move to the Session category, click on the Save to save the settings.
Creating an EC2 instance
Click on the Open button to open the Putty window.
Creating an EC2 instance
The above screen shows that we are connected to the EC2 instance.

Run the command sudo su, and then run the command yum update -y to update the EC2
instance.
Creating an EC2 instance
Note: sudo su is a command which is used to provide the privileges to the root
level.
Now, we install the apache web server to ensure that an EC2 instance becomes a web
server by running a command yum install httpd -y.
Creating an EC2 instance
Run the command cd /var/www/html.
Creating an EC2 instance
To list the files available in the html folder, run the command ls.
Creating an EC2 instance
We observe that on running the command ls, we do not get any output. It means that
it does not contain any file.

We create a text editor, and the text editor is created by running the command nano
index.html where index.html is the name of the web page.
Creating an EC2 instance
The text editor is shown below where we write the HTML code.
Creating an EC2 instance
After writing the HTML code, press ctrl+X to exit, then press 'Y' to save the page
and press Enter.

Start the Apache server by running the command service httpd start.
Creating an EC2 instance
Go to the web browser and paste the IP address which is used to connect to your EC2
instance. You will see the web page that you have created.
Creating an EC2 instance
Next Topic#

← PrevNext →

Youtube For Videos Join Our Youtube Channel: Join Now


Feedback
Send your Feedback to [email protected]
Help Others, Please Share
facebook twitter pinterest

Learn Latest Tutorials


Splunk tutorial
Splunk

SPSS tutorial
SPSS

Swagger tutorial
Swagger

T-SQL tutorial
Transact-SQL

Tumblr tutorial
Tumblr

React tutorial
ReactJS
Regex tutorial
Regex

Reinforcement learning tutorial


Reinforcement Learning

R Programming tutorial
R Programming

RxJS tutorial
RxJS

React Native tutorial


React Native

Python Design Patterns


Python Design Patterns

Python Pillow tutorial


Python Pillow

Python Turtle tutorial


Python Turtle

Keras tutorial
Keras

Preparation
Aptitude
Aptitude

Logical Reasoning
Reasoning

Verbal Ability
Verbal Ability

Interview Questions
Interview Questions

Company Interview Questions


Company Questions

Trending Technologies
Artificial Intelligence Tutorial
Artificial Intelligence

AWS Tutorial
AWS

Selenium tutorial
Selenium

Cloud Computing tutorial


Cloud Computing

Hadoop tutorial
Hadoop

ReactJS Tutorial
ReactJS

Data Science Tutorial


Data Science

Angular 7 Tutorial
Angular 7

Blockchain Tutorial
Blockchain

Git Tutorial
Git

Machine Learning Tutorial


Machine Learning

DevOps Tutorial
DevOps

B.Tech / MCA
DBMS tutorial
DBMS

Data Structures tutorial


Data Structures

DAA tutorial
DAA

Operating System tutorial


Operating System

Computer Network tutorial


Computer Network

Compiler Design tutorial


Compiler Design

Computer Organization and Architecture


Computer Organization

Discrete Mathematics Tutorial


Discrete Mathematics

Ethical Hacking Tutorial


Ethical Hacking

Computer Graphics Tutorial


Computer Graphics

Software Engineering Tutorial


Software Engineering
html tutorial
Web Technology

Cyber Security tutorial


Cyber Security

Automata Tutorial
Automata

C Language tutorial
C Programming

C++ tutorial
C++

Java tutorial
Java

.Net Framework tutorial


.Net

Python tutorial
Python

List of Programs
Programs

Control Systems tutorial


Control System

Data Mining Tutorial


Data Mining

Data Warehouse Tutorial


Data Warehouse

Javatpoint Services
JavaTpoint offers too many high quality services. Mail us on [email protected], to
get more information about given services.

Website Designing
Website Development
Java Development
PHP Development
WordPress
Graphic Designing
Logo
Digital Marketing
On Page and Off Page SEO
PPC
Content Development
Corporate Training
Classroom and Online Training
Data Entry
Training For College Campus
JavaTpoint offers college campus training on Core Java, Advance Java, .Net,
Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at
[email protected].
Duration: 1 week to 2 week

Like/Subscribe us for latest updates or newsletter RSS Feed Subscribe to Get Email
Alerts Facebook Page Twitter Page YouTube Blog Page

You might also like