1) Hosting
1. Server:
A server is a powerful computer that stores data and services, which
it provides to other computers (clients) over a network. In web
hosting, the server hosts your website or ap plication, handling
incoming requests and delivering web pages or resources.
2. DNS (Domain Name System):
DNS is a system that translates human-readable domain names (e.g.,
[Link]) into IP addresses (e.g., [Link]). It acts as the
phonebook of the internet, allowing users to access websites using
easy-to-remember names instead of numerical IP addresses.
3. IP Address:
An IP (Internet Protocol) address is a unique numerical identifier
assigned to each device connected to a network. It's used to locate
and identify devices on the internet or within a local network.
4. IPv4 vs. IPv6:
• IPv4: The most commonly used version of IP addresses. It uses
32-bit addresses, allowing for approximately 4.3 billion unique
addresses.
• IPv6: A newer version of IP addresses, using 128-bit addresses.
It allows for a vastly larger number of addresses, overcoming
IPv4’s limitations as more devices connect to the internet.
5. PM2 (Process Manager 2):
PM2 is a process manager for [Link] applications. It helps in
managing, monitoring, and keeping [Link] applications alive forever
by restarting them if they crash. It also helps in load balancing and
managing the application’s environment.
Load balancing is the process of distributing network traffic or
computational workloads across multiple servers to ensure no single
server is overwhelmed. It enhances performance, reliability, and
scalability in web applications, databases, and other distributed
systems.
6. Caching:
Caching is the process of storing copies of files or data in temporary
storage locations (caches) to reduce the time it takes to access that
data in the future. This improves website performance by reducing
the need to retrieve the data from the server each time.
7. Proxy:
A proxy acts as an intermediary between a client (like a user’s
computer) and a server. It handles requests from the client, making
requests to the server on behalf of the client, and then returns the
server’s response to the client.
8. Reverse Proxy:
A reverse proxy is a type of proxy server that retrieves resources on
behalf of a client from one or more servers. It usually acts as a
gateway to an internal server, hiding the internal server structure and
protecting it from external access. Examples include Nginx and
Apache.
9. Forward Proxy:
A forward proxy, on the other hand, is used by clients to access
external servers or services. It forwards the client’s requests to the
target server and can be used for filtering content or hiding the
client's IP.
10. REST API (Representational State Transfer):
A REST API is a web service that follows the principles of REST
architecture. It uses standard HTTP methods (GET, POST, PUT,
DELETE) to interact with resources and can return data in formats like
JSON or XML. REST APIs are commonly used for communication
between a client (like a web browser) and a server.
11. HTTP Status Code Ranges:
HTTP status codes are grouped into ranges:
• 1xx: Informational (e.g., 100 Continue)
• 2xx: Success (e.g., 200 OK)
• 3xx: Redirection (e.g., 301 Moved Permanently)
• 4xx: Client Errors (e.g., 404 Not Found)
• 5xx: Server Errors (e.g., 500 Internal Server Error)
12. HTTP vs HTTPS:
• HTTP (HyperText Transfer Protocol) is an unsecured protocol
used to transfer data between the client and the server. Data
can be intercepted during transmission.
• HTTPS (HTTP Secure) is the secured version of HTTP. It uses
SSL/TLS encryption to encrypt the data transferred between the
client and server, ensuring privacy and data integrity.
13. Port 443, 80:
• Port 80: The default port for HTTP traffic.
• Port 443: The default port for HTTPS traffic, which is secured
using SSL/TLS encryption.
14. HTTP OPTIONS:
The OPTIONS method in HTTP is used to describe the communication
options for the target resource. It allows clients to determine what
methods (like GET, POST, etc.) are supported by the server.
15. Security Groups in AWS:
In AWS, a security group acts as a virtual firewall that controls the
inbound and outbound traffic to your EC2 instances. It defines which
network traffic is allowed or denied based on rules set by the user,
such as allowing HTTP (port 80) or HTTPS (port 443) traffic, or
restricting access to certain IP addresses.
These concepts are crucial for hosting, managing servers, and
maintaining security in web applications. Let me know if you need
more detailed explanations on any specific topic!
1. TLS (Transport Layer Security)
TLS is a cryptographic protocol that provides secure communication
over a computer network. It is the successor to SSL (Secure Sockets
Layer) and is used in HTTPS to encrypt data between a client and a
server, ensuring privacy and security.
2. Subdomain
A subdomain is a subdivision of a main domain. It allows users to
organize and navigate to different sections of a website.
Example:
• Main domain: [Link]
• Subdomain: [Link], [Link]
3. SSL Certificate
An SSL (Secure Sockets Layer) certificate is a digital certificate that
authenticates a website’s identity and enables encrypted connections
using HTTPS. It helps secure user data, build trust, and improve SEO
rankings.
4. EC2 Instance (Elastic Compute Cloud)
An EC2 instance is a virtual server in AWS (Amazon Web Services)
that provides scalable computing resources. It allows users to deploy
applications in the cloud with customizable configurations (CPU,
RAM, storage, etc.).
5. Key Pair in AWS
A key pair in AWS consists of a public key and a private key used for
secure SSH access to EC2 instances. The private key is stored on the
local machine, while the public key is associated with the instance.
6. SSH (Secure Shell)
SSH is a network protocol that allows secure remote access to servers
and computers. It encrypts the communication between the client
and the server, preventing unauthorized access.
7. Nginx
Nginx is a high-performance web server and reverse proxy server. It is
often used for load balancing, caching, and serving static files. It can
also act as a reverse proxy for backend applications.
8. PPA (Personal Package Archive)
A PPA is a repository for installing software on Linux distributions like
Ubuntu. It allows users to get the latest software versions that may
not be available in the default package manager.
Example:
sudo add-apt-repository ppa:nginx/stable
sudo apt update
9. Sudo (Superuser Do)
sudo is a command in Unix/Linux systems that allows a user to
execute commands with administrative (root) privileges.
Example:
sudo apt install nginx
10. JSON (JavaScript Object Notation)
JSON is a lightweight data format used to exchange data between a
server and a client. It is easy to read and supports key-value pairs.
Example:
{
"name": "John",
"age": 25,
"city": "New York"
}
11. XML (Extensible Markup Language)
XML is a structured format used to store and transport data. It is
similar to HTML but focuses on data representation.
<person>
<name>John</name>
<age>25</age>
<city>New York</city>
</person>
GIT
1. Git vs GitHub vs GitLab
• Git: A version control system that tracks changes in code.
It helps developers collaborate, manage versions, and
maintain code history.
• GitHub: A cloud-based platform that hosts Git
repositories, enabling collaboration, issue tracking, and
CI/CD. Owned by Microsoft.
• GitLab: Another Git repository hosting service like
GitHub, but with built-in DevOps features, CI/CD, and
self-hosting options.
2. Version Control System (VCS)
A system that tracks changes in files over time. It helps
developers collaborate, undo changes, and maintain code
history.
• Types:
o Centralized VCS (e.g., SVN, Perforce) – A single
central repository.
o Distributed VCS (e.g., Git, Mercurial) – Each user
has a full copy of the repository.
3. Branches
A branch in Git is an independent line of development.
• The main (or master) branch is the default branch.
• Developers create feature branches for new work.
• Example:
git branch new-feature
git checkout new-feature
(or using git switch new-feature in modern Git versions)
4. Git Pull vs Pull Request
• git pull: Fetches the latest changes from a remote branch
and merges them into the current branch.
git pull origin main
• Pull Request (PR): A request to merge changes from one
branch to another on platforms like GitHub/GitLab. It is
used for code reviews before merging.
5. Origin
origin is the default name for the remote repository where
your code is hosted (e.g., GitHub/GitLab).
• Example:
git remote -v # Show remote repositories
6. Git Rebase
Rebase moves changes from one branch onto another,
rewriting history instead of merging.
• Example: Rebasing feature branch onto main
sh
CopyEdit
git checkout feature
git rebase main
7. Git Stash
Temporarily stores changes that are not yet committed,
allowing you to switch branches without committing.
• Example:
git stash
git stash pop # Apply the stashed changes
8. Force Push
Pushes changes to a remote repository, even if it overwrites
previous changes. Use carefully to avoid data loss.
• Example:
sh
CopyEdit
git push --force
9. Conflict
A merge conflict occurs when two branches modify the same
part of a file, and Git cannot automatically merge them.
• Resolving: Edit the conflicting file, then
sh
CopyEdit
git add filename
git commit -m "Resolved conflict"
10. Git Fork
A fork is a copy of a repository in your own GitHub/GitLab
account, allowing independent modifications.
• Used for contributing to open-source projects.
11. Git Tags
Tags mark specific points in Git history, often for releases
(e.g., v1.0).
• Example:
git tag v1.0
git push origin v1.0
12. Git Cherry Pick
Selectively applies a specific commit from one branch to
another.
• Example:
sh
CopyEdit
git cherry-pick <commit-hash>
13. Git Fetch
Retrieves changes from a remote repository without merging
them into your local branch.
• Example:
sh
CopyEdit
git fetch origin
14. Git Reset --hard
Resets the current branch to a previous state, discarding all
changes permanently.
• Example:
sh
CopyEdit
git reset --hard HEAD~1 # Undo last commit
15. Git Reset --soft
Resets commits but keeps changes staged. Used when you
want to modify a previous commit.
• Example:
sh
CopyEdit
git reset --soft HEAD~1
git commit -m "Updated commit"
16. Repository (Repo)
A repository is a storage location for code and its version
history, containing files, commits, and branches.
• Example (Creating a new repo):
sh
CopyEdit
git init
17. Types of Merging
Merging combines branches into one. Types include:
1. Fast-forward merge: Moves the branch pointer forward
if there are no divergent changes.
sh
CopyEdit
git merge feature-branch
2. Recursive (3-way) merge: Used when branches have
diverged. Git creates a new commit.
3. Squash merge: Combines multiple commits into one
before merging.
sh
CopyEdit
git merge --squash feature-branch
1. Create a Repository
A Git repository can be created locally or on platforms like
GitHub/GitLab.
a) Creating a Local Repository
1. Open a terminal and navigate to the desired directory.
2. Run the following commands:
mkdir my-project
cd my-project
git init
This initializes a Git repository in the my-project folder.
3. Create a sample file and add it to Git:
echo "Hello World" > [Link]
git add [Link]
git commit -m "Initial commit"
b) Creating a Repository on GitHub/GitLab and Connecting It
1. Go to GitHub/GitLab and create a new repository (e.g.,
my-project).
2. Link the local repository to the remote:
sh
CopyEdit
git remote add origin [Link]
[Link]
git branch -M main
git push -u origin main
2. Create a Pull Request
A pull request (PR) is used when you want to merge changes
from one branch into another on GitHub/GitLab.
a) Create a New Branch and Make Changes
1. Switch to a new branch:
sh
CopyEdit
git checkout -b feature-branch
2. Modify a file (e.g., [Link]) and commit the
changes:
echo "New feature added" >> [Link]
git add [Link]
git commit -m "Added a new feature"
3. Push the changes to GitHub/GitLab:
sh
CopyEdit
git push origin feature-branch
b) Create a Pull Request on GitHub/GitLab
1. Go to your GitHub repository ([Link]
username/my-project).
2. You’ll see a Compare & pull request option.
3. Click New Pull Request, select the feature-branch, and
set the base branch (main).
4. Add a description and submit the PR.
3. Change Commit Message
You can change the message of the last commit using:
a) If the Commit is Not Pushed Yet
git commit --amend -m "Updated commit message"
b) If the Commit is Already Pushed
You need to force push:
sh
CopyEdit
git commit --amend -m "Updated commit message"
git push --force origin feature-branch
⚠ Be careful when using --force, as it can overwrite history.
4. Merge Two Branches
Merging is used to combine changes from one branch into
another.
a) Merge Without Conflicts (Fast-Forward)
1. Switch to the branch you want to merge into (e.g.,
main):
sh
CopyEdit
git checkout main
2. Merge the feature branch:
sh
CopyEdit
git merge feature-branch
3. Push the merged changes:
sh
CopyEdit
git push origin main
b) Merge With a Merge Commit (3-Way Merge)
If there are changes in both branches, Git will create a merge
commit:
sh
CopyEdit
git merge --no-ff feature-branch
git push origin main
This keeps the commit history of both branches.
c) Merge With Squash (Single Commit)
If you want to merge but keep all changes as a single commit:
sh
CopyEdit
git merge --squash feature-branch
git commit -m "Merged feature branch"
git push origin main