- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
Day 26: Configuring an EC2 Instance as a Web Server with Nginx
☁️ Day 26: Configuring an EC2 Instance as a Web Server with Nginx | 100 Days of Cloud (AWS)
Welcome to Day 26 of the 100 Days of Cloud (AWS) series! In this lab, you’ll launch an EC2 instance and automatically configure it as an Nginx web server using a User Data script.
📌 Lab Objective:
Create an EC2 instance that installs and starts Nginx automatically during launch.
🛠️ Task Requirements:
EC2 Name: xfusion-ec2
Use any Ubuntu AMI
Configure User Data script to:
Install Nginx
Start Nginx service
Allow HTTP traffic on port 80
💻 Step-by-Step Solution (AWS CLI):
🔹 1. Get Latest Ubuntu AMI ID
aws ec2 describe-images \
--owners 099720109477 \
--filters "Name=name,Values=ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-amd64-server-*" \
"Name=state,Values=available" \
--query 'sort_by(Images, &CreationDate)[-1].ImageId' \
--output text \
--region us-east-1
🔹 2. Get Default Security Group ID
aws ec2 describe-security-groups \
--filters Name=group-name,Values=default \
--query 'SecurityGroups[*].GroupId' \
--output text
🔹 3. Allow HTTP Port 80
aws ec2 authorize-security-group-ingress \
--group-id SECURITY_GROUP_ID \
--protocol tcp \
--port 80 \
--cidr 0.0.0.0/0
🔹 4. Create User Data Script
vi userdata.sh
Paste:
#!/bin/bash
apt update -y
apt install nginx -y
systemctl enable nginx
systemctl start nginx
🔹 5. Launch EC2 Instance
aws ec2 run-instances \
--image-id ami-xxxxxxxx \
--instance-type t2.micro \
--security-group-ids SECURITY_GROUP_ID \
--user-data file://userdata.sh \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=xfusion-ec2}]'
🔹 6. Get Public IP Address
aws ec2 describe-instances \
--filters "Name=tag:Name,Values=xfusion-ec2" \
--query "Reservations[*].Instances[*].PublicIpAddress" \
--output text
🔹 7. Verify Nginx Web Server
curl http://PUBLIC-IP
✅ Nginx default page should appear successfully.
📚 What You’ll Learn:
Launching EC2 instances with AWS CLI
Using User Data for boot-time automation
Installing Nginx automatically
Managing AWS security groups
Hosting web applications on AWS
🌟 Why This Lab Matters:
Automating cloud infrastructure deployment is an essential cloud engineering skill for scalable and reliable environments.
🎯 Series: 100 Days of Cloud (AWS)
Keep mastering AWS cloud infrastructure step by step.
🔔 Follow OtterTech for more practical AWS labs and tutorials!
#AWS #EC2 #Nginx #CloudComputing #AWSCLI #Linux #UserData #CloudEngineering #100DaysOfCloud #OtterTech #Day26
Видео Day 26: Configuring an EC2 Instance as a Web Server with Nginx канала Otter Tech
Welcome to Day 26 of the 100 Days of Cloud (AWS) series! In this lab, you’ll launch an EC2 instance and automatically configure it as an Nginx web server using a User Data script.
📌 Lab Objective:
Create an EC2 instance that installs and starts Nginx automatically during launch.
🛠️ Task Requirements:
EC2 Name: xfusion-ec2
Use any Ubuntu AMI
Configure User Data script to:
Install Nginx
Start Nginx service
Allow HTTP traffic on port 80
💻 Step-by-Step Solution (AWS CLI):
🔹 1. Get Latest Ubuntu AMI ID
aws ec2 describe-images \
--owners 099720109477 \
--filters "Name=name,Values=ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-amd64-server-*" \
"Name=state,Values=available" \
--query 'sort_by(Images, &CreationDate)[-1].ImageId' \
--output text \
--region us-east-1
🔹 2. Get Default Security Group ID
aws ec2 describe-security-groups \
--filters Name=group-name,Values=default \
--query 'SecurityGroups[*].GroupId' \
--output text
🔹 3. Allow HTTP Port 80
aws ec2 authorize-security-group-ingress \
--group-id SECURITY_GROUP_ID \
--protocol tcp \
--port 80 \
--cidr 0.0.0.0/0
🔹 4. Create User Data Script
vi userdata.sh
Paste:
#!/bin/bash
apt update -y
apt install nginx -y
systemctl enable nginx
systemctl start nginx
🔹 5. Launch EC2 Instance
aws ec2 run-instances \
--image-id ami-xxxxxxxx \
--instance-type t2.micro \
--security-group-ids SECURITY_GROUP_ID \
--user-data file://userdata.sh \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=xfusion-ec2}]'
🔹 6. Get Public IP Address
aws ec2 describe-instances \
--filters "Name=tag:Name,Values=xfusion-ec2" \
--query "Reservations[*].Instances[*].PublicIpAddress" \
--output text
🔹 7. Verify Nginx Web Server
curl http://PUBLIC-IP
✅ Nginx default page should appear successfully.
📚 What You’ll Learn:
Launching EC2 instances with AWS CLI
Using User Data for boot-time automation
Installing Nginx automatically
Managing AWS security groups
Hosting web applications on AWS
🌟 Why This Lab Matters:
Automating cloud infrastructure deployment is an essential cloud engineering skill for scalable and reliable environments.
🎯 Series: 100 Days of Cloud (AWS)
Keep mastering AWS cloud infrastructure step by step.
🔔 Follow OtterTech for more practical AWS labs and tutorials!
#AWS #EC2 #Nginx #CloudComputing #AWSCLI #Linux #UserData #CloudEngineering #100DaysOfCloud #OtterTech #Day26
Видео Day 26: Configuring an EC2 Instance as a Web Server with Nginx канала Otter Tech
Комментарии отсутствуют
Информация о видео
8 мая 2026 г. 10:38:38
00:20:02
Другие видео канала





















