DEV Community

Clinton Ogechi
Clinton Ogechi

Posted on

DevOps Stage 0 - Setting Up NGINX on Ubuntu

As we kicked off Stage 0, I was tasked with setting up and configuring an NGINX web server on a fresh Ubuntu instance. This process helped me deepen my understanding of how web servers work and how crucial they are for serving web content in a production environment. Here’s an overview of my experience, challenges faced, and how this task fits into my overall professional goals.

Approach to Completing the Task

The task required me to install the NGINX web server, configure it to serve a custom HTML page, and ensure it was running properly. Below are the steps I followed:

1. Server Setup: I started by setting up a fresh Ubuntu instance on a cloud provider, I choose AWS as my cloud provider. Once the instance was up and running, I SSHed into it.

2.Installing NGINX: The first step was to install NGINX. I used the following command to install it.

sudo apt update && sudo apt install nginx -y

Enter fullscreen mode Exit fullscreen mode

3. Configuring NGINX: After installation, I created a simple HTML page with the message:

Welcome to DevOps Stage 0 - Clinton Ogechi/Clinton Ogechi

Enter fullscreen mode Exit fullscreen mode

I placed this file in the /var/www/html directory, ensuring NGINX was properly configured to serve this page.

4. Firewall Configuration: I checked that my firewall allowed traffic on port 80 (HTTP) and blocked unnecessary ports such as 8080 and 443.

5. Testing and Validation: Finally, I was able to access the website using the server’s public IP address via http://34.239.118.252/ to confirm that the custom message appeared as expected.

Image description

Challenges Faced and Solutions
While completing this task, I forgot to enable the firewall after configuring the rules with UFW. This meant that the server was not blocking ports 8080 and 443 as intended. I resolved this by running:

sudo ufw enable

Enter fullscreen mode Exit fullscreen mode

Contribution to My Learning and Professional Goals
This task was an essential step in my journey to becoming proficient in DevOps. By setting up NGINX, I gained practical experience in configuring web servers, which is a foundational skill in DevOps.

References
If you're looking into kick starting your career as a DevOps or as a Cloud Engineer, check out the links below;

DevOps Engineers - https://hng.tech/hire/devops-engineers
Cloud Engineers - https://hng.tech/hire/cloud-engineers

Top comments (0)