“From Zero to NGINX Hero: My DevOps Stage 0 Adventure”


Drama, suspense, and a happy ending included! 🔥➡️✨


Introduction

As a budding DevOps enthusiast, my first hands-on task was setting up an NGINX web server on a fresh Ubuntu machine. This foundational exercise aimed to teach server configuration, troubleshooting, and deployment — skills critical for roles like DevOps Engineers and CI/CD Pipeline Engineers. In this blog, I’ll walk through my journey, the hurdles I faced, and how this task aligns with my career aspirations.

Approach

Step 1: Installing NGINX

I started by updating the Ubuntu package repository and installing NGINX using:

sudo apt update && sudo apt install nginx -y

After installation, I verified NGINX was running:

sudo systemctl status nginx

Step 2: Creating the Custom HTML Page

I replaced the default landing page by creating a new index.html at /var/www/html/:

sudo nano /var/www/html/index.html

I added a simple HTML template with the required message:

<!DOCTYPE html>  
<html>  
<head>  
    <title>DevOps Stage 0</title>  
</head>  
<body>  
    <h1>Welcome to DevOps Stage 0 - TechGee</h1>  
</body>  
</html>

Step 3: Configuring Permissions and Testing

To avoid permission issues, I set ownership of the /var/www/html directory to the web server user:

sudo chown -R www-data:www-data /var/www/html

Finally, I reloaded NGINX to apply changes:

sudo systemctl reload nginx

Challenges & Solutions: The “Oops, I Did It Again” Edition 🎭


Challenge 1: Firewall, the Overenthusiastic Bouncer 🚧

Problem: My NGINX server was ready to party, but Ubuntu’s firewall (UFW) was like, “NOPE. Port 80? Never heard of her.”
Solution: I whispered the magic words:

sudo ufw allow 'Nginx HTTP'

Moral of the Story: Firewalls are the bouncers of the internet. Always check the guest list.


Challenge 2: Permission Denied? More Like “Permission Confused” 🔑

Problem: My HTML page was MIA. Turns out, the file was owned by root—the ultimate gatekeeper. NGINX, being a mere mortal (www-data), couldn’t read it. 🙈
Solution: I handed over the keys:

sudo chown www-data:www-data /var/www/html/index.html  # "Here, NGINX. This is YOUR house now." 🏠

Moral of the Story: Sharing is caring. Especially with web servers.


Challenge 3: The Case of the Missing Semicolon 🔍

Problem: I edited the NGINX config like a coding wizard… until I missed a ;. NGINX responded with: “Error 500: LOL, nice try.”
Solution: I became Sherlock Holmes of Syntax:

sudo nginx -t  # Spoiler: It yelled, “Missing semicolon at line 13!” 🕵️♂️

Then, I raided the logs:

tail -f /var/log/nginx/error.log  # “Ah-ha! There’s the culprit!” 🎯

Moral of the Story: Semicolons are the pepperoni of code — small but essential. 🍕


Why You’ll Remember This Forever 🌟

  • Firewalls are drama queens.

  • Permissions are like relationships — communication is key.

  • Typos are the universe’s way of keeping you humble.

Now go forth, and may your servers never throw a tantrum again! 🚀

(P.S. If all else fails, scream “sudo !!” and pray.) 😇

If you are looking to hire talent in the tech industry, consider the following roles:

  1. DevOps Engineers - Learn more

  2. Cloud Engineers - Learn more

  3. Site Reliability Engineers - Learn more

  4. Kubernetes Specialists - Learn more

  5. Automation Engineers - Learn more

  6. PostgreSQL Developers - Learn more

  7. Platform Engineers - Learn more

  8. Infrastructure Engineers - Learn more

  9. AWS Solutions Architects - Learn more

  10. Azure DevOps Engineers - Learn more

  11. Google Cloud Engineers - Learn more

  12. Monitoring/Observability Engineers - Learn more

  13. Docker Specialists - Learn more

  14. Linux Developers - Learn more

This list is intended for hiring managers and recruiters seeking qualified candidates in these specialized roles.


Conclusion

Completing this task was a small but significant step in my DevOps journey. It taught me resilience (debugging at 2 AM!), attention to detail, and the thrill of seeing “Welcome to DevOps Stage 0” load on my screen. I’m excited to tackle more complex tasks — maybe Docker or Kubernetes next!

To fellow beginners: Embrace the grind. Every error message is a lesson. 🚀


Ready to start your DevOps journey? Check out opportunities at HNG Tech!