AWS Service - Elastic Compute Cloud(EC2)
EC2:
Create EC2 instance( Windows & Linux):
create EC2:
search ec2 service -> launch instance -> choose amazon linux (freetier) -> choose t2 micro -> leave the configure instance default -> leave the default storage option -> tags give name like (Name Linux-server) -> create new security group and add the ports (ssh/http/all-icmp) -> create a new key pair for the login password
Linux Machine:
To connect the EC2 - we need either putty or MobaXterm
open MobaXterm - > session -> ssh -> public ip -> username = ec2-user -> advanced settings (use private key and choose the key we downloaded)
Windows machine:
login using username = Administrator (use get password feature in instance connect to upload your .pem key and generate the password)
search rdp and give public ip and user name "Administrator" and give the generated password
Linux website:
– Create a website in Linux server :
yum install httpd ( host a website)
cd /var/www/html
vi index.html
(ESC i - type your content
ESC:wq! - to save the content and force-quit )
systemctl restart httpd
systemctl enable httpd (permanent service enable)
to delete a line
ESC dd
Windows Website:
after login - search for "server manager" add roles and features select webserver(IIS) Internet Information Service
go to website default path = c:inetpub/wwwroot
edit the default website
User ADD:
useradd pravin
passwd pravin
vi /etc/ssh/sshd_config
PasswordAuthentication yes
systemctl restart sshd
visudo
esc /root - search the word root
esc yy - to copy the line
esc p - to paste it in next line and edit it to change the root to pravin (example below)
root ALL=(ALL) ALL
pravin ALL=(ALL) ALL
Sign in by new user:
Types of Instance:
On-demand instance -
Depending on our need, whenever if we build an EC2 instance is called on
demand (1000 rs - rough calculation)
reserved instance
we can purchase an instance for a specific period of time (30 % discount - 700 rs)
Spot instance
70 % - 300rs - 12 hours auto terminate
Scheduled instance
scheduling an instance build for a certain time
Dedicated host
Dedicated HW for end-user
Types of EC2 instance (resource) refer :
https://aws.amazon.com/ec2/instance-types/
Changing RAM & Storage in Linux Server:
instance right click -> instance-settings -> change instance type
– Before Changing:
– After Changing:
Comments
Post a Comment