My Experience Setting Up NGINX on Ubuntu in AWS – HNG DevOps Stage 0

NGINX Web Server Setup on Ubuntu EC2 Instance As part of my DevOps Stage 0 task, I set up an NGINX web server on an Ubuntu EC2 instance in AWS to serve a custom HTML page. This project allowed me to revisit foundational DevOps practices and cloud infrastructure management. 1. Launch an EC2 Instance: I created an Ubuntu 24.04 instance using the t2.micro type and configured security groups to allow SSH (port 22) and HTTP (port 80) traffic. 2. Connecting and Setting Up: After connecting via SSH with the .pem key, I updated the package list and installed NGINX with: sudo apt install nginx -y I started and enabled NGINX to run on boot with: sudo systemctl start nginx sudo systemctl enable nginx 3. Configuring the Custom HTML Page: I replaced the default page by editing: /var/www/html/index.html with my custom message and restarted NGINX to apply the changes: sudo systemctl restart nginx 4. Testing the Setup: I accessed the server via its public IP and verified that the page loaded correctly in a browser. Insights and Challenges: Cloud Infrastructure: Launching EC2 instances and configuring security groups enhanced my understanding of cloud computing basics. Linux Administration: Navigating Ubuntu and managing NGINX solidified my skills in Linux server management. Networking: Understanding how security groups and firewalls work in cloud platforms was key to resolving issues with HTTP traffic access. Challenges Encountered: I initially faced issues accessing the page via the public IP due to incorrect inbound traffic configuration. Once I allowed HTTP traffic on port 80, the problem was resolved. Conclusion: This task was foundational for cloud infrastructure, web server configuration, and Linux system management. It’s a critical skill for any DevOps engineer and has prepared me for more advanced topics such as automation and multi-region deployments. References: DevOps Engineers Cloud Engineers Site Reliability Engineers Platform Engineers Infrastructure Engineers Kubernetes Specialists AWS Solutions Architects Azure DevOps Engineers Google Cloud Engineers CI/CD Pipeline Engineers Monitoring/Observability Engineers Automation Engineers Docker Specialists Linux Developers PostgreSQL Developers

Feb 5, 2025 - 00:18
 0
My Experience Setting Up NGINX on Ubuntu in AWS – HNG DevOps Stage 0

NGINX Web Server Setup on Ubuntu EC2 Instance

As part of my DevOps Stage 0 task, I set up an NGINX web server on an Ubuntu EC2 instance in AWS to serve a custom HTML page. This project allowed me to revisit foundational DevOps practices and cloud infrastructure management.

1. Launch an EC2 Instance:

I created an Ubuntu 24.04 instance using the t2.micro type and configured security groups to allow SSH (port 22) and HTTP (port 80) traffic.

2. Connecting and Setting Up:

After connecting via SSH with the .pem key, I updated the package list and installed NGINX with:

sudo apt install nginx -y

I started and enabled NGINX to run on boot with:

sudo systemctl start nginx
sudo systemctl enable nginx

3. Configuring the Custom HTML Page:

I replaced the default page by editing:

/var/www/html/index.html

with my custom message and restarted NGINX to apply the changes:

Image description

sudo systemctl restart nginx

4. Testing the Setup:

I accessed the server via its public IP and verified that the page loaded correctly in a browser.

Image description

Insights and Challenges:

  • Cloud Infrastructure: Launching EC2 instances and configuring security groups enhanced my understanding of cloud computing basics.
  • Linux Administration: Navigating Ubuntu and managing NGINX solidified my skills in Linux server management.
  • Networking: Understanding how security groups and firewalls work in cloud platforms was key to resolving issues with HTTP traffic access.

Challenges Encountered:

I initially faced issues accessing the page via the public IP due to incorrect inbound traffic configuration. Once I allowed HTTP traffic on port 80, the problem was resolved.

Conclusion:

This task was foundational for cloud infrastructure, web server configuration, and Linux system management. It’s a critical skill for any DevOps engineer and has prepared me for more advanced topics such as automation and multi-region deployments.

References: