Linux with AWS Cloud Bootcamp
Duration : 2 to 3 weeks
Pre-Requisites : Your time + Concentration + Practice
Course Content :
-
Windows Vs Linux
-
Linux History
-
Linux Distributions
-
Linux VM Setup
-
Working with Files & Directories
-
Working with text editors
-
User Management
-
File Permissions
-
Networking commands
-
Pacakge Managers
-
On-Prem Infrastructure
-
Cloud Computing
-
Cloud Providers (Amazon, MS, Google)
-
AWS Cloud Introduction
-
AWS Console tour
-
EC2 (Elastic Compute Cloud)
-
RDS (Relational Database service)
-
S3 (simple storage service)
-
Beanstack (web app deployment)
-
IAM (Identity & Access Mgmt)
-
Lambdas (Serverless computing)
-
Route 53 (DNS)
Frontend Technologies : Angular/React
Backend Technologies : Java Springboot MS
Databases : Oracle , Mysql + Mongo DB
DevOps tools : mvn, git, docker, jenkins, k8s
Operating Systems : linux
Cloud Services: Aws services
=> OS is a software
=> OS act as a mediator between users and computers
=> Wihout OS we can't use computers
=> We have several Operating Systems in the market
Ex : Windows, Linux, Mac, Solaris, Anroid, IOS
=> Developed By Microsoft company
=> It is GUI based OS
=> It is licensed OS
=> Single user based OS
=> Security features are less
Note: Anti Virus software we have to install.
=> Windows OS is recommended for personal use
Ex : watch movies, games, browsing, online classes
=> Developed by Linus Torvalds
=> It is free and open source
=> Linux supports both GUI and CLI
=> Linux is multi user based OS
=> Linux is Virus free (security is very high)
=> It is highly recommended for business use cases
Ex : Database servers, app servers, k8s cluster, jenkins server, sonarqube server, docker server, nexus server, ELK, Log files...
1990
Unix --> challenges
Minux
(Li)nus + Mi(nux ) = Linux
200+ distributions
amazon linux ubuntu linux cent os linux kali linux suse linux fedora linux red hat linux
AWS Account Setup : https://www.youtube.com/watch?v=xi-JDeceLeI
Approach-1 : Install Linux OS directley in PC
Approach-2 : Install Linux as Guest OS using Virtual Box
Approach-3 : Setup Linux VM in windows using Vagrant
Approach-4 : Take linux vm for rent in cloud platform (AWS)
EC2 service we can use to setup virtual machines in aws cloud.
AWS Free Tier account (1 year)
EC2 : To setup virtual machines
Monthly : 750 hours free of cost
Step-1 : Login into aws account
Step-2 : Go to EC2 service and launch new instance
AMI : amazon linux
instance type : t2.micro / t3.micro
Keypair : Create new keypair (.pem)
Step-3 : Select machine and click on Connect (SSH Client)
Step-4 : Open gitbash from keypair location and execute commands (chmod and ssh)
Connect with EC2 VM using MobaXterm: https://www.youtube.com/watch?v=uI2iDk8iTps&t=458s
https://youtu.be/JMlQaTXvw5o?si=okXzG9jKkBn1xcMY
Connect with EC2 VM using Putty : https://www.youtube.com/watch?v=GXc_bxmP0AA
-
Apps / Commands
-
Shell
-
Kernel
-
Hardware components
=> Shell is responsible to validate command given by user and translate that into kernel understandable format.
=> Kernel is one of the core component in linux os. Kernel is responsible to give instructions to hardware to process command execution.
=> In linux os everything will be represented as file only.
/
/bin
/opt
/etc
/lib
/var
/mnt
/media
/home
Note: In Linux VM for every user one home directory will be available like below.
ec2-user : /home/ec2-user
ashok : /home/ashok
sita : /home/sita
pwd: display present working directory.
cd : change directory
touch : create empty files
ls : listing the data of pwd
ls -l : long listing with alphabetical order
ls -lr : display files in reverse of alphabetical
ls -lt : display latest files on top
ls -ltr : display old files on top
ls -la : show hidden files also
mkdir : create new directory
rmdir : remove empty directory
rm : remove file
rm -rf : remove non-empty directories
cat : create file with data + append data + print data
cat > abc.txt
cat >> abc.txt
cat abc.txt
cat -n abc.txt
tac : print data from bottom to top
cp : copy one file to another file
mv : rename + move
history : display user activities in linux
head : display first 10 lines of the file.
head f1.txt
head -n 5 f1.txt
head -n 100 f1.txt
tail : display last 10 lines of the file.
tail f1.txt
tail -n 15 f1.txt
tail -n 50 app.log
tail -f app.log
=> It is used for searching data in the file
grep 'ashokit' app.log
grep -n -i 'exception' app.log
grep -v 'ashokit' app.log
tail app.log | grep 'ashokit'
tail -n 100 app.log | grep -n -i 'exception'
=> It is used to edit the files in linux os
=> Using vi we can open existing files and we can create new files also.
$ vi java.txt
=> vi command works based on 3 modes
1) command mode (read data)
2) insert mode (press i in keyword)
3) esc mode (press esc key)
=> save and close (:wq + Enter)
=> close without saving (:q! + Enter)
ifconfig : To check IP address of our machine
ping: To check connectivity
ping www.google.com
ping www.facebook.com
ping 172.31.4.278
wget: To download files from internet
wget <url>
curl: To send Http request to server
curl https://reqres.in/api/users
-> Linux OS is a multi user based OS
-> Multiple Users can connect with linux vm at a time.
Note: When we create linux vm using "Amazon Linux" AMI we will get 'ec2-user' as a default user with sudo priviliges.
SUDO : Super user doing operation
cat /etc/passwd
Syntax : sudo useradd
Ex : sudo useradd john
Syntax : sudo passwd
Ex : sudo passwd john
Note: To give sudo priviliges for the users we need to add them in sudoers file.
sudo visudo
Note: Configure user like below (just below root user)
john ALL=(ALL) ALL smith ALL=(ALL) ALL
Note: After adding user, close that file using "CTRL + X + Y + Enter"
=================================================== How to enable password based authentication in linux ?
=> In Linux VM by default PasswordAuthentication is disabled.
=> If we want to connect with Linux vm using username and password we need to enable that.
sudo vi /etc/ssh/sshd_config
=> Find the Line containing Γ’β¬ΛPasswordAuthenticationΓ’β¬β’ parameter and change its value from Γ’β¬ΛnoΓ’β¬β’ to Γ’β¬ΛyesΓ’β¬β’
Note: save that file and close it using :wq + Enter
sudo service sshd restart
exit
ssh john@public-ip
=> File permissions are divided into 3 types
a) read (r)
b) write (w)
c) execute (x)
=> File permissions will be represented like below
Ex : -rwxrwxrwx f1.txt
drwxrwxrwx ashokit
=> First 3 characters will represent owner permissions (the user who created that file)
=> Middle 3 characters will represent group permissions.
=> Last 3 characters will represent other users permissions.
Ex:
-rw-r-xr-x f1.txt
owner => read + write group => read + execute others => read + execute
-rwx------ f2.txt
owner : read + write + execute group : Nothing Others: Nothing
=> To add or remove file permissions we will use 'chmod' command.
chmod u+x f1.txt
chmod u-w f1.txt
chmod g+wx f1.txt
chmod o-r f1.txt
=> We can represent file permissions using numeric numbers also.
0 => No Permissions
1 => Execute
2 => Write
3 => (2+1) => Write + Execute
4 => Read
5 => (4+1) => Read + Execute
6 => (4+2) => Read + Write
7 => (4+2+1) => Read + Write + Execute
chmod 425 f1.txt
chmod 623 f1.txt
#u-rwx, g-rwx , o+rwx chmod 7 f1.txt
#u-rwx, g+rwx , o+rwx chmod 77 f1.txt
=> using chown command we can change ownership
$ sudo chown ashok f1.txt
Package : A software
=> Package managers are used to manage softwares installation in linux machines.
=> Package Managers are specific to linux distribution.
yum : amazon linux, cent os
apt : ubuntu , debian
rpm : red hat
sudo yum install git -y git --version whereis git
sudo yum install java -y java -version whereis java
sudo yum install maven -y maven -version whereis maven
π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯
Pre-Requisites : Linux Basics
-
What is infrastructure ?
-
On-Prem Infrastructure Challenges
-
Cloud Computing
-
Advantages with Cloud Computing
-
AWS Introduction
-
AWS Services Tour
-
Regions & AZs
-
EC2 + Load Balancer
-
S3
-
RDS
-
IAM
-
Beanstack
-
Lambdas
-
Route 53 (DNS)
=> Resources required to run our business.
IT Infrastructure :
- Machines
- Servers
- Databases
- Storage
- Network
- Power
- Security
- Backup
- Monitoring
=> We can deal with IT infrastructure in 2 ways
1) On-Prem infrastructure
2) Cloud Infrastructure
=> On-Prem infrastructure means we need to purchase everything and manage everything on our own.
=> We have to deal with below challenges when we go for on-prem infrastructure
- Lot of investment
- Scalability
- Availability
- Security
- Storage
- Monitoring
=> To overcome the challenges with On-Prem infrastructure, companies are moving to cloud computing.
=> The process of delivering IT resources over the internet on demand basis is called as Cloud Computing.
=> Cloud Computing works based on pay as you go model.
=> We have below advantages with cloud computing
-
Pay as you go
-
Scalability
-
Availability (24/7)
-
Unlimited Storage
-
Security
-
Backup & Restore
-
Monitoring
=> The company which is providing IT infrastructure based on "pay as you go" model.
-
Amazon => AWS
-
Microsoft => AZURE
-
Google => GCP
-
Salesforce
-
IAAS : Infrastructure as a service
-
PAAS : Platform as a service
-
SAAS : Software as a service
=> AWS stands for Amazon Webservices.
=> Amazon company started AWS cloud in 2006.
=> Today 190+ countries using AWS cloud services
=> Instead of we are puchasing, managing and maintaining infrastructure simply we can use AWS cloud infrastructure.
=> AWS providing services based on pay as you go model.
=> AWS having global infrastructure using Regions & Availability Zones.
=> We can create free tier account (1 year validity)
=> In AWS cloud we have 200+ services (some are free and some are paid)
=> If we use paid service in AWS, bill be generated.
Note: in AWS, bill amount auto-deduction will not happen. If we don't pay bill amount aws will suspend our account.
Note: As a beginner we can request AWS support team to get free credits.
EC2 : Elastic Compute Cloud => Virtual Servers
S3 : Simple Storage Service => Unlimited Storage
RDS : Relational Database Service => RDBMS
IAM : Identity and Access Management => Users, Groups & Roles
VPC : Virtual Private Cloud => Network
Route 53 : DNS => Domain Mapping
EKS : Elastic Kubernetes Service => K8s Cluster
Beanstack : Platform as a service
Lambdas : Serverless computing => Run application without thinking abt server
@@ Reference video : https://youtu.be/GSu1g9jvFhY?si=7VVcaxkZZw_WKWsC
Step-1 : Create Mysql DB using AWS RDS
Step-2 : Check DB connection with workbench
Step-3 : Develop application to connect with RDS DB.
Step-4 : Delete RDS database instance.
=> EC2 means elastic compute cloud
=> It is used to create virtual machines in aws cloud
EC2 instance = server/machine/vm/instance
=> EC2 is a paid service
=> Minimum billing period for EC2 instance is 1 hour.
9:15 AM - 9:30 AM ===> 1 hour
9:45 AM - 10:00 AM ===> 1 hour
=> To create EC2 instance we will use below resources
1) AMI (OS)
2) Instance Type (configuration)
3) Key Pair (.pem)
4) VPC (networking)
5) Security Group (firewall rules)
6) EBS (storage)
=> Windows Machines will run on RDP protocol and Linux machines will run on SSH protocol.
RDP => 3389
SSH => 22
=> Deploy SpringBoot application in EC2 Linux VM and access that using browser in windows machine.
@@ Reference video : https://www.youtube.com/watch?v=cRQPgbwOWq0
=> Web Server is a software which is used to run web applications.
=> Web applications are divided into 2 types
1) static web application
2) dynamic web application
=> The web app which is giving same response for every user is called as static web application.
Note: To run static websites we can use "httpd" as a webserver.
=> The web app which is giving response based on user is called as dynamic web application.
Note: To run dynamic website we can use "apache tomcat" as webserver.
Step-1 : Create EC2 VM with amazon linux ami
Step-2 : Connect with EC2 VM using SSH Client
Step-3 : Install "HTTPD" webserver to run static websites
Step-4 : Setup webpages (html files)
Step-5 : Enable http protocol with 80 port number in SG inbound rules.
Step-6 : Access website using EC2 VM public ip in our browser.
sudo su yum install httpd -y service httpd start
cd /var/www/html
Website URl : http://public-ip/
=> It is used to execute the script while launching EC2 VM.
Note: User data will execute only once when the machine is started.
#! /bin/bash
sudo su yum install httpd -y cd /var/www/html echo "
" > index.html service httpd start=> Setup a static website using "nginx" web server using EC2 Linux VM.
=> When we run our application in single server then we have to face below challenges
1) One server should handle all reqs
2) Burden will increase on server
3) Response will be delayed for clients
4) Server can crash
5) Single Point Of Failure
6) Business Loss
=> To avoid above problems, we will run our application using Load Balancer.
=> Load Balancer is used to distribute load to multiple servers in round robbin fashion.
=> We have below advantages with Load Balancer
1) App will run in multiple severs
2) Load will be distributed
3) Burden will be reduces on servers
4) Fast Performance
5) High Availability
=> We have 4 types of load balancers in aws
1) Application Load Balancer
2) Network Load balancer
3) Gateway Load Balancer
4) Classic Load balancer (previous generation)
In order to receive the discounted AWS Foundational Certification exam voucher reward, you must take an AWS Skill Builder Exam Prep course and complete an AWS Skill Builder Official Practice Question Set with a passing score of 70% or higher for the certification you are seeking. Please note that the courses must be completed under the AWS Skill Builder account that has the same email as your AWS Educate account.
Qualifying AWS Skill Builder Exam Prep courses are: click
Qualifying AWS Skill Builder Official Practice Question Sets are:
- Exam Prep Official Practice Question Set: AWS Certified Cloud Practitioner
- Exam Prep Official Practice Question Set: AWS Certified AI Practitioner
You can find these courses directly by following these steps:
- Go to AWS Skill Builder
- Use the following search filters: - Languages: English - Domain: Cloud Essentials or AI Practitioner - Course Level: Fundamental (Fundamental includes Foundational and Associate exams, Intermediate includes Professional, and Advanced includes Specialty) - Training Category: Exam Preparation (for practice test), Digital Course (for the Essentials course)
- Choose the course. As a reminder please make sure your Skill Builder email matches the email associated with your ETC/Educate account.
In order to receive the discounted AWS Associate Certification exam voucher reward, you must complete an AWS Skill Builder Exam Prep course and complete an AWS Skill Builder Official Practice Question Set with a passing score of 70% or higher for the certification you are seeking. Please note that the courses must be completed under an AWS Skill Builder account that has the same email as your AWS Educate account. Depending on your desired certification, qualifying ones are:
Qualifying AWS Skill Builder Exam Prep courses are:
- Exam Prep Standard Course: AWS Certified Solutions Architect - Associate
- Exam Prep Standard Course: AWS Certified SysOps Administrator - Associate
- Exam Prep Standard Course: AWS Certified Developer - Associate
- Exam Prep Standard Course: AWS Certified Data Engineer-Associate
- Exam Prep Standard Course: AWS Certified Machine Learning Engineer- Associate
Qualifying AWS Skill Builder Official Practice Question Sets are:
- Exam Prep Official Practice Question Set: AWS Certified Solutions Architect - Associate
- Exam Prep Official Practice Question Set: AWS Certified SysOps Administrator - Associate
- Exam Prep Official Practice Question Set: AWS Certified Developer - Associate
- Exam Prep Official Practice Question Set: AWS Certified Data Engineer- Associate
- Exam Prep Official Practice Question Set: AWS Certified Machine Learning Engineer- Associate
You can find these courses directly by following these steps:
- Go to AWS Skill Builder
- Use the following search filters: - Languages: English - Domain: SysOps, Architecting, Developing, Data Engineer, and Machine Learning Engineer - Course Level: Fundamental (Fundamental includes Foundational and Associate exams) - Training Category: Exam Preparation (for exam prep course)
- Choose the course. As a reminder please make sure your Skill Builder email matches the email associated with your ETC/Educate account.