Day 26 : Configuring an EC2 Instance as a Web Server with Nginx
100 Days of Cloud (AWS)

Welcome to Day 26. Today, we will learn how to configure an EC2 instance as a web server using Nginx. In this lab, you will discover what User Data Scripts are and how they work.
What is User Data Script in AWS?
In AWS, User Data is a feature that allows you to automate the configuration of an Amazon EC2 instance when it is first launched. This process is commonly known as bootstrapping. Instead of manually logging into a server via SSH to install software or change settings, you provide a script (or other data) during the launch process, and AWS executes it for you.
Common Use Cases
Software Installation: Installing web servers (Nginx, Apache), databases, or runtime environments (Python, Node.js).
Updates: Running
apt-get updateoryum updateto ensure the OS has the latest security patches.Configuration: Setting environment variables, creating local users, or downloading application code from GitHub or S3.
Service Management: Starting and enabling services so they survive a reboot.














#!/bin/bash
sudo apt update -y
sudo apt upgrade -y
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx


Congratulations you did it. It looks good. This lab was successfully completed without any errors. See you in day 27. If you have any issues please let me know I will be happy to assist you. Stay tuned and learn together. If you find my article useful, please kindly like and share it.




