DEV Community

Cover image for Mastering Web Server Setup: A Step-by-Step Guide to Installing and Configuring NGINX on a Fresh Ubuntu System
patrick ibe
patrick ibe

Posted on

2

Mastering Web Server Setup: A Step-by-Step Guide to Installing and Configuring NGINX on a Fresh Ubuntu System

As part of my journey into DevOps, I recently completed the HNG DevOps Stage 0 - NGINX Configuration task. This experience provided hands-on exposure to setting up a web server, configuring it, and troubleshooting issues in a cloud environment. Below, I share my approach, challenges, and the impact this task had on my learning and career development.

Approach to Completing the Task

To complete the task, I followed these structured steps:

  1. Launching an AWS EC2 Instance
  • I logged into the AWS Management Console and launched an Ubuntu EC2 instance.

Image description

  • Configured the security group to allow HTTP (port 80) and SSH (port 22) access

Image description

Image description

  • Connected to the instance via SSH using the command:

Image description

2. Installing and Configuring NGINX

  • update package repositories and installed NGINX

Image description

3. Creating a Custom HTML Page

  • Modified the default index.html page to display:

Image description

  • Restarted NGINX to apply changes:

Image description

4. Testing the Configuration

  • Opened a browser and accessed http://13.60.55.194 to verify that the webpage was correctly served.

Image description

Challenges and How I Overcame Them

Security Group Misconfiguration

Initially, I couldn't access the webpage from my browser. After troubleshooting, I realized that the security group settings didn’t allow HTTP traffic. To fix this, I updated the AWS security group rules to allow port 80 (HTTP) from all sources.

Image description

How This Task Contributes to My Learning and Career Goals

This task was a foundational step in my DevOps journey. By working with AWS EC2 and NGINX, I gained

  • Practical cloud deployment experience, which is essential for roles like Cloud Engineer (HNG Cloud Engineers).
  • Web server configuration skills, a key competency for DevOps Engineers (HNG DevOps Engineers).
  • Problem-solving abilities, as I learned to troubleshoot and resolve real-world server issues.

This experience has reinforced my passion for cloud computing and DevOps, bringing me one step closer to my professional goal of becoming a skilled Cloud & DevOps Engineer.

Conclusion

Setting up NGINX on AWS EC2 was a rewarding challenge. It provided valuable hands-on experience with cloud infrastructure, web server configuration, and troubleshooting. I look forward to applying these skills in more complex DevOps environments and real-world cloud projects.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (6)

Collapse
 
ezekiel_ibem_848b9d723f61 profile image
Ezekiel Ibem

Well documented explanation, keep it up 👏

Collapse
 
patrick_ibe profile image
patrick ibe

Thanks Bro❤️

Collapse
 
techygee profile image
Joseph Adamu

Well written🔥

Collapse
 
patrick_ibe profile image
patrick ibe

Thanks bro😊

Collapse
 
tony_uketui_6cca68c7eba02 profile image
Anthony Uketui

Niceeee✨

Collapse
 
patrick_ibe profile image
patrick ibe

Thanks Brother!!

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs