DEV Community

Cover image for Documenting My Experience with NGINX Installation and Configuration
Olasubomi Onasanwo
Olasubomi Onasanwo

Posted on

Documenting My Experience with NGINX Installation and Configuration

Introduction
This post details the installation and configuration of the NGINX web server as part of a DevOps assignment, enhancing technical skills and offering insights into web server management.
Approach to Completing the Task

Step 1: Launching an Ubuntu Instance on AWS
The process began by logging into the AWS Management Console and launching an Ubuntu Server instance. The t2.micro instance type was selected for the free tier, with the security group configured to allow HTTP traffic on port 80.

Step 2: Connecting to the Instance
After launching the instance, the connection was established using SSH, authenticating with the key pair created during setup.

Step 3: Installing NGINX
With a successful connection, the package index was updated, and NGINX was installed using:

sudo apt update
sudo apt install nginx -y

Step 4: Starting and Enabling NGINX
Once installed, the service was started and enabled to launch on boot:

sudo systemctl start nginx
sudo systemctl enable nginx
The status of NGINX was checked to confirm it was running without errors.

Step 5: Creating a Custom HTML Page
A custom HTML page was created to serve as the default welcome message. The index.html file was placed in the /var/www/html directory with the following content:

<!DOCTYPE html>


<โ€‹meta charset="UTF-8">
Welcome Page


Welcome to DevOps Stage 0 - Onas/Subomi



Step 6: Testing the NGINX Configuration
To ensure proper setup, the configuration was tested for syntax errors:

sudo nginx -t

NGINX was then reloaded to apply changes, allowing access to the custom page via the public IP address of the instance.

Challenges Faced and Solutions
Firewall Configuration
An initial challenge involved ensuring the security group rules allowed HTTP traffic. This was resolved by adjusting the settings in the AWS console.
Syntax Errors in HTML
A mistake in the HTML tag structure caused rendering issues. After testing the NGINX configuration, the error was identified and corrected.

Contribution to Learning and Professional Goals

This task significantly contributed to learning and professional goals:
Hands-on Experience: Practical experience in deploying a web server is crucial for any DevOps Engineer . โ€œVisit: https://hng.tech/hire/devops-engineers"

Problem-Solving Skills: Overcoming challenges improved troubleshooting abilities.

Understanding Web Technologies: This exercise deepened understanding of web technologies and their interactions.

Conclusion
In summary, the installation and configuration of NGINX provided valuable learning experiences that enhanced technical skills and problem-solving abilities, beneficial for future projects and career pursuits in DevOps.

Top comments (0)