DEV Community

Cover image for Blog Post: My Experience Setting Up NGINX on an AWS Ubuntu Server
Isaac Osei-Boateng
Isaac Osei-Boateng

Posted on

Blog Post: My Experience Setting Up NGINX on an AWS Ubuntu Server

Introduction
As part of the DevOps Stage 0 task, I was assigned to set up and configure NGINX on a fresh AWS Ubuntu server. This task was designed to test my ability to work with basic web server configurations and deliver a functional web server. In this blog post, I’ll walk you through my approach, challenges faced, and how this task contributes to my learning and professional goals.

Approach to Completing the Task

  1. Setting Up the AWS Ubuntu Server
    I started by launching an EC2 instance on AWS with Ubuntu as the operating system. I ensured that the security group allowed HTTP traffic (port 80) so that the NGINX web server could be accessed publicly.

  2. Installing NGINX
    After connecting to the server via SSH, I updated the system packages and installed NGINX using the following commands:

Image description

  1. Configuring the Default HTML Page I replaced the default NGINX HTML file (/var/www/html/index.html) with a custom HTML page that displayed the message:

Image description

I used nano to edit the file and inserted the following HTML code:

Image description

  1. Testing the Configuration
    I restarted NGINX to apply the changes and accessed the server’s public IP address in a web browser. The custom HTML page was displayed successfully.

  2. Firewall Configuration
    Since AWS security groups already allowed HTTP traffic, I didn’t need to configure ufw (Uncomplicated Firewall) on the server. However, I verified that the security group rules were correctly set up.

Challenges Faced and How I Overcame Them

  1. Accessing the Web Server: Initially, I couldn’t access the NGINX default page via the browser. After some troubleshooting, I realized that the AWS security group wasn’t configured to allow inbound HTTP traffic. I updated the security group to allow traffic on port 80, and the issue was resolved.

  2. Editing the HTML File
    I accidentally overwrote the entire index.html file instead of editing it. To fix this, I recreated the file from scratch using the custom HTML code provided in the task requirements.

  3. Restarting NGINX
    After making changes to the configuration, I forgot to restart NGINX, so the changes weren’t reflected. Once I restarted the service using sudo systemctl restart nginx, everything worked as expected.

How This Task Contributes to My Learning and Professional Goals

This task was a great introduction to working with web servers and understanding the basics of NGINX. It helped me gain hands-on experience with:

• Setting up and configuring a web server on a cloud platform (AWS).
• Managing server configurations via the command line.
• Troubleshooting common issues related to web server setup.

As someone aspiring to become a DevOps Engineer, this task aligns perfectly with my goals. DevOps Engineers are responsible for automating and optimizing infrastructure, and this task gave me a glimpse into managing servers and deploying applications. According to HNG Tech, DevOps Engineers play a critical role in bridging the gap between development and operations, and this task was a small but important step in that direction.

Additionally, this experience reinforced my interest in cloud computing. Cloud Engineers, as highlighted by HNG Tech, are in high demand for their ability to design, deploy, and manage scalable cloud infrastructure. Working with AWS and NGINX has motivated me to explore more advanced cloud and DevOps tools like Kubernetes, Docker, and CI/CD pipelines.

Conclusion
Completing this task was both challenging and rewarding. It not only helped me understand the basics of NGINX and web server configuration but also gave me confidence in working with cloud platforms like AWS. I’m excited to continue learning and building my skills in DevOps and cloud engineering.

If you’re interested in pursuing a career in DevOps or cloud engineering, I highly recommend checking out the opportunities at HNG Tech. They offer a wide range of roles, from DevOps Engineers to Cloud Engineers, and provide an excellent platform to grow your skills and career.

References

  1. https://hng.tech/hire/cloud-engineers
  2. https://hng.tech/hire/devops-engineers

Image of Docusign

Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)