DEV Community

Urunna Glad Erondu
Urunna Glad Erondu

Posted on

HNG Internship Stage 0 - Setting Up NGINX on Ubuntu Server

Objective
Web server configurations by serving a custom HTML page.

Prerequisites
AWS cloud account

Task Breakdown

  1. Setting Up the Ubuntu Server

Launch an Ubuntu instance. After setting up the instance, allow traffic on port 80 and Connect to it using SSH

ssh ubuntu@<your-server-ip>
Enter fullscreen mode Exit fullscreen mode
  1. Installing NGINX

NGINX is a lightweight and efficient web server. To install it on Ubuntu, Run the following command

sudo apt update  
sudo apt install nginx -y
Enter fullscreen mode Exit fullscreen mode

Once installed, Verify that the service is running:

sudo systemctl status nginx
Enter fullscreen mode Exit fullscreen mode

Image description

  1. Configuring NGINX to Serve a Custom Page

Replace the default index page with my custom HTML content.

First, edit the /var/www/html/index.html file:

sudo nano /var/www/html/index.html
Enter fullscreen mode Exit fullscreen mode

Replaced its contents with the following message:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>DevOps Stage 0</title>
</head>
<body>
    <h1>Welcome to DevOps Stage 0 - [Your Name]/[SlackName]</h1>
</body>
</html>
Enter fullscreen mode Exit fullscreen mode

After saving the file (Ctrl + X, then Y, and Enter)
Restart NGINX:

sudo systemctl restart nginx
Enter fullscreen mode Exit fullscreen mode

To confirm everything worked correctly, Access the public IP in a browser:

http://<your-server-ip>/

If the custom page displayed the required message, the setup is successful.

Image description

Key Takeaways and Professional Growth
Completing this task reinforced my foundational DevOps skills, including:

  • Server setup and management
  • Installing and configuring a web server
  • Managing firewall rules
  • Understanding basic web server configurations is essential for DevOps and Cloud Engineers, as they often manage infrastructure and deployments in cloud environments.

Conclusion
Setting up and configuring NGINX was an insightful experience working with Linux-based web servers. This task is part of my DevOps internship journey at HNG, preparing me for more complex automation and cloud infrastructure tasks.

If you’re looking for DevOps/Cloud Engineers, check out these sites:
• DevOps Engineers - https://hng.tech/hire/devops-engineers
• Cloud Engineers - https://hng.tech/hire/cloud-engineers
• Site Reliability Engineers - https://hng.tech/hire/site-reliability-engineers
• Platform Engineers - https://hng.tech/hire/platform-engineers
• AWS Solutions Architects - https://hng.tech/hire/aws-solutions-architects
• Azure DevOps Engineers - https://hng.tech/hire/azure-devops-engineers
• Google Cloud Engineers - https://hng.tech/hire/google-cloud-engineers

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay