Introduction
Deploying a web server on a cloud platform is a fundamental skill for DevOps professionals. This document outlines the process of installing and configuring the NGINX web server on an Amazon EC2 instance running Ubuntu. The goal is to set up a functional web server that serves a custom webpage, demonstrating foundational cloud infrastructure management and web server configuration skills. I am delighted to start my HNG DevOps internship training with this project.
Project Setup
Launch an Amazon EC2 Instance
- Instance name: Nginx instance
- AMI: Ubuntu server 24.04
- Instance type: t2 micro
- Key pair: nginx-key
- Security group: Allow SHH traffic form anywhere.
Connect to the EC2 instance
- Next connect to the EC2 instance and update the package list.
sudo apt update
- Install nginx
sudo apt install nginx -y
- Start and enable nginx to run on boot
sudo systemctl start nginx
sudo systemctl enable nginx
Configure the html page
- Open the index.html file
sudo nano /var/www/html/index.html
- Add the html content
- Save and exist.
Restart nginx
- Restart the nginx server to effect the change.
sudo systemctl restart nginx
Verify the Setup
- To verify if the nginx web server is running
sudo systemctl status nginx
- Open a web browser and verify
http://your-server-ip
Challenge Faced
Accessing my web page through the public ip address was futile, so I had to configure an inbound http traffic by allowing access from anywhere at port 80 and the challenge was solved.
The Importance of this Task to my DevOps Career
This project is crucial for understanding the fundamental concepts of cloud computing and DevOps. By setting up an NGINX web server on an AWS EC2 instance, I have:
- Gain experience with cloud infrastructure and resource management.
- Learn how to configure and secure a web server.
- Understand the basics of networking, including security groups and firewall rules.
- Develop troubleshooting skills for common server deployment issues.
Conclusion
Successfully completing this project will enhance my ability to manage and deploy web applications in a cloud environment, an essential skill for any DevOps engineer.
Top comments (0)