DEV Community

Muad
Muad

Posted on

Deploying First Nginx Web Page

Task Introduction:

How to successfully deployed a public Nginx web page by setting up a domain, configuring DNS records, launching an EC2 instance, and hosting a custom HTML page.

Steps Taken:

  1. Created a web domain on HostAfrica.com.

  2. Added the domain and subdomain (xyz.domainName.com) in Route 53.

  3. Launched an EC2 instance (free tier) and connected via Session Manager.

  4. Updated packages: sudo apt update.

  5. Installed Nginx: sudo apt install nginx.

  6. Started and enabled Nginx:
    sudo systemctl start nginx
    sudo systemctl enable nginx

  7. Edited /var/www/html/index.html with a custom HTML page:

<!DOCTYPE html>
<html>
<head>
    <title>Welcome</title>
</head>
<body>
    <h1>Welcome to this page</h1>
</body>
</html>
Enter fullscreen mode Exit fullscreen mode
  1. Created an A record in Route 53 for the subdomain xyz.domainName.com pointing to the EC2 public IP.

Result:

The Nginx web page is now live and accessible publicly at http://xyz.domainName.com. Let’s move to Stage 1!

Challenges Faced and How I Overcame Them

The main challenge was the cost of purchasing a domain and using AWS Route 53, which I managed by leveraging the AWS Free Tier for EC2 and optimizing resource usage to keep expenses low.

How This Task Contributes to My Learning and Professional Goals

This task helped me refresh my domain configuration skills, gain hands-on experience with AWS services like EC2 and Route 53, and move closer to my goal of becoming a proficient cloud engineer.

References

I used the guide at https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04 to install Nginx,

For those interested in learning more, check out

https://hng.tech/hire/devops-engineers and https://hng.tech/hire/cloud-engineers.

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

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

πŸ‘‹ Kindness is contagious

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

Okay