# 🚀 Day 6 of DevOps + Cloud – Shell Scripting, AWS Services & My First Web Server

### 🖥 Today’s Journey

Today was all about **automation, AWS services overview, and hosting my first webpage** on an EC2 instance. It felt like combining theory + practice in the best way.

---

### 1️⃣ Shell Scripting for Automation

Instead of typing the same commands again and again, I learned how to write **shell scripts**. Example:

```plaintext
#!/bin/bash
echo "Updating system..."
sudo yum update -y

echo "Creating a directory..."
mkdir myapp && cd myapp

echo "Creating a test file..."
echo "Hello DevOps 🚀" > test.txt
cat test.txt
```

💡 This is the starting point of **automation** → tomorrow it can grow into installing apps, deploying servers, or CI/CD pipelines.

---

### 2️⃣ Common AWS Services Every DevOps Engineer Must Know

I explored **why these AWS services matter**:

* **EC2 (Elastic Compute Cloud):** Virtual machines in the cloud.
    
* **S3 (Simple Storage Service):** Store & retrieve any amount of data.
    
* **RDS (Relational Database Service):** Managed databases without worrying about backups & patches.
    
* **Lambda:** Run functions without managing servers (serverless).
    
* **CloudFront:** A global CDN that makes content load faster worldwide.
    
* **IAM (Identity & Access Management):** Control **who** can do **what** on AWS.
    

---

### 3️⃣ IAM Users vs Root User

* **Root User** → The “super admin” of AWS. Full power. Should be used **only once** to create IAM users.
    
* **IAM User** → Safer. You give limited permissions (like “read-only S3” or “EC2 admin”).  
    👉 Best practice: **Don’t use root for daily tasks** — always work with IAM users.
    

---

### 4️⃣ Hosting My First Webpage on AWS EC2

Steps I followed:

1. **Connect to EC2 instance** (Amazon Linux).
    
2. **Install Apache Web Server:**
    
    ```plaintext
    sudo yum install httpd -y
    sudo systemctl start httpd
    sudo systemctl enable httpd
    ```
    
3. **Create a simple HTML page:**
    
    ```plaintext
    echo "<h1>Welcome to Apache Web Server on Amazon Linux 🎉</h1>" | sudo tee /var/www/html/index.html
    ```
    
4. **Open instance public IP in browser:**  
    `http://<your-ec2-public-ip>`
    

✅ My first webpage was live on AWS!

---

### 🔗 References

* [AWS IAM Best Practices](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)
    
* [AWS EC2 Docs](https://docs.aws.amazon.com/ec2/)
    
* [Learn Shell Scripting](https://www.shellscript.sh/)
    
* [Host a Website on Apache EC2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html)
    

---

### 📌 Key Learnings

* Shell scripting is the **foundation of automation**.
    
* IAM users keep AWS **secure**.
    
* Apache on EC2 makes cloud **real** when you see your first webpage live.
    

💡 Today connected theory → AWS services + practice → first hosted webpage!→ first hosted webpage!
