DEV Community

Cover image for Setting up NGINX Web Server on AWS: My HNG12 Stage 0 Experience.
Bamidele Riliwan
Bamidele Riliwan

Posted on

Setting up NGINX Web Server on AWS: My HNG12 Stage 0 Experience.

As a participant in the HNG12 internship program, I just completed my Stage 0 task: configuring NGINX web server using any preferred cloud platform and I decided to use AWS. The challenge seemed straightforward but as I dove in, I discovered that this task encompassed several crucial DevOps concepts and skills.

Step-by-Step Guide I followed
1.** AWS Setup**
Creating an EC2 instance
Managing security groups
Handling SSH keys
Each step was a learning opportunity, teaching me about cloud security and infrastructure management.

Image description

  1. NGINX Configuration Once I had my EC2 instance running, I faced the task of installing NGINX by following these steps:
  2. Connect to my EC2 instance using: #chmod 400 my-key.pem #ssh -i my-key.pem ubuntu@my-instance-public-ip
  • Once connected, I updated and upgraded my system using:
    sudo apt update
    sudo apt upgrade -y

  • I then installed Nginx with the command #sudo apt install nginx -y

  • I created my custom web page using the command #sudo nano /var/www/html/index.html
    And I added my html contents.

Image description

Challenges and Solutions

  • Security Group Configuration Initially, my website wasn't accessible. I discovered that I needed to explicitly allow HTTP traffic (Port 80) in my AWS security group. This taught me the importance of network security and proper port configuration.
  • File Permissions Another hurdle was setting the correct permissions for my web files. I learned about Linux file permissions and the importance of proper ownership for web server files.

Looking Forward
Completing this Stage 0 task has given me confidence in my ability to learn and adapt. I'm excited about the challenges ahead in the HNG12 internship and my journey into DevOps.

Image description

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

Top comments (0)