Creating Instance in AWS
Log on to AWS open EC2 Select the region and click on launch instances
Creating Instance in AWS
Selecting the requires Amazon Image (OS) -select Ubuntu or windows server 2012 base ( Free tier
)
Creating Instance in AWS
Select t2.micro instance type to use free service
Creating Instance in AWS
Select the required options , specially subnet-set ap-south-1b
Creating Instance in AWS
Add disk if required otherwise go for next
Creating Instance in AWS
Click on add tags and type : Key = Name , Value = Windows server 2012 or Ubuntu
Tagging
Tagging is important to estimate the pricing for each resource used
Creating Instance in AWS
• Creating New security group –select RDP and HTTP for Windows and SSH RDP for Linux
Instance. In case of not knowing select All traffic and source anywhere ----Review and Launch
Creating Instance in AWS
Create a new key pair – name: awskey –Download key pair
Creating Instance in AWS
Click on launch instance –then scroll down and click on view instance
Creating Instance in AWS
• Now instance is created and running. click on connect
Creating Instance in AWS
Select connection method EC2 instance connect ----connect
Tools to access AWS linux instance
From Linux terminal/Mac OS --
# chmod u+x aws.pem
# ssh -i awskey.pem ec2-user@InstancepublicIP
Or
# ssh -i awskey.pem ec2-user@InstancepublicIP
From Windows System use software
0) EC2 cloud shell
1) Putty
2) Gitbash
3) Mobaextrem
Default user name:
1) RHEL – ec2-user
2) Ubuntu: ubuntu
3) Windows : Administrator
IIS in Windows Server
• Stands for "Internet Information Services." IIS is a web server software
package designed for Windows Server. It is used for hosting websites and
other content on the Web.
• Microsoft’s Internet Information Services provides a graphical user interface
(GUI) for managing websites and the associated users. It provides a visual
means of creating, configuring, and publishing sites on the web. The IIS
Manager tool allows web administrators to modify website options, such as
default pages, error pages, logging settings, security settings, and
performance optimizations
IIS Web server in Windows
1) Launching Windows Instance
2) Copy public IP and access the Instance through Remote Desktop
connection
3) Open Server manager – Add Roles and Feature –select and Install
Web server (IIS) --- Close
4) Check or create a new .html file in C:\inetpub\wwwroot\
5)Access the web page in browser using Instance Public IP
• Note: Turn off the Windows VM firewall ( If required)
Installing IIS
Open server manager –Add roles and features –next –next –next—
select web server (IIS)
Installing IIS
Next—next--
Installing IIS
Finally click on Install
Installing HTTP Web server in RHEL
# yum install httpd -y
# cd /var/www/html/
#ls
# nano index .html
<html>
<h1> Welcome to AWS training </h1>
</html>
# systemctl start httpd or service httpd start
# systemctl enable httpd or chkconfig httpd on
How to access : Open web browser and type :-
http://instance-public-ip or http://instance-public-
ip/mobile.html
Installing Apache Web server in Ubuntu
# apt-get update
# apt install apache2
# cd /var/www/html/
#ls
# nano mobile.html
<html>
<h1> Welcome to Azure training </h1>
</html>
# systemctl start apache2
# systemctl enable apache2
# ufw disable
How to access : Open web browser and type :-
http://instance-public-ip or http://instance-public-ip/mobile.html
Elastic IP Addresses
• An Elastic IP address is a static IPv4 address designed for dynamic cloud
computing. An Elastic IP address is associated with your AWS account. With an
Elastic IP address, you can mask the failure of an instance or software by rapidly
remapping the address to another instance in your account.
• An Elastic IP address is a public IPv4 address, which is reachable from the
internet. If your instance does not have a public IPv4 address, you can associate
an Elastic IP address with your instance to enable communication with the
internet.
Elastic IP Address Basics
1) To use an Elastic IP address, you first allocate one to your account, and
then associate it with your instance or a network interface.
2) When you associate an Elastic IP address with an instance or its primary
network interface, the instance's public IPv4 address (if it had one) is
released back into Amazon's pool of public IPv4 addresses. You cannot
reuse a public IPv4 address.
3) You can disassociate an Elastic IP address from a resource, and
reassociate it with a different resource. Any open connections to an
instance continue to work for a time even after you disassociate its Elastic
IP address and reassociate it with another instance.
4) A disassociated Elastic IP address remains allocated to your account until
you explicitly release it.
How charge applied in Free tier
Lab—Check current dynamic IP
Check the current IP of Instance—Stop and start the Instance
again and check the IP– IP changed
Lab –Allocate Elastic IP
Click Elastic IP then Allocates new address
Lab –Allocate Elastic IP
Now click on Allocate--Close
Lab –Associate with Instance
Now click on action the Associate address
Lab –Associate with Instance
Select Instance and click on Associate
Lab –Associate with Instance
Now check the obtained Elastic IP—Stop the instance and
start it again –We will get same IP
Lab –Disassociate and release IP
Elastic IP- select allocated IP –Action – Disassociate –again
select ---action --release
ENI Basic
• You can create a network interface, attach it to an instance, detach it
from an instance, and attach it to another instance. The attributes of a
network interface follow it as it's attached or detached from an instance
and reattached to another instance. When you move a network interface
from one instance to another, network traffic is redirected to the new
instance.
• You can also modify the attributes of your network interface, including
changing its security groups and managing its IP addresses.
• Every instance in a VPC has a default network interface, called
the primary network interface. You cannot detach a primary network
interface from an instance. You can create and attach additional network
interfaces. The maximum number of network interfaces that you can use
varies by instance type.
ENI Lab
1) Open EC2 –Network Interface –Create a new interface –select subnet and select
Security group -- and assign Elastic IP to it.—Then attach to any Instance
Security Group – Pre Configured
EC2—Security group –create Security group—give name and
description--—Inbound rules –Add rule--select required port –
change destination as anywhere –save.
While creating instance or any other compute recourses we can add
this security group.
Change security Security Group of running instance
Keypair Lab
EC2—keypair – create keypair –give keypair name—select format (.pem) –
create
.PEM Privacy-Enhanced Mail (PEM) is a de facto file format for storing and
sending cryptographic keys, certificates, and other data,
.PPK Putty private key(PPK) files are used by PuTTY, a
free SSH and Telnet client.