DEV Community

Cover image for TASK: Configuring NGINX Web Server on Amazon EC2 Instance using Ubuntu server.
Kemisola
Kemisola

Posted on

TASK: Configuring NGINX Web Server on Amazon EC2 Instance using Ubuntu server.

The goal of this task:

This task will demonstrate my ability to work with basic web server configurations and deliver a functional web server.

Hello all, I worked on this Project on the 29th of January 2025 and I was able to get it done after a series of trials. Below are the steps I took:

👉 I launched an Amazon EC2 Instance on AWS. I picked AWS Cloud Service because I'm very familiar with it.
Image description
👉 I used the Free Tier version of my Ubuntu server and also the Instance type (free version).
👉 I edited my security group to allow SSH traffic from anywhere.
👉 After my EC2 Instance state changed to 'Running', I connected it to the EC2 Instance connect and started installing my nginx.
Image description
👉 To install my nginx, I used the following code: "sudo apt install nginx -y", "sudo systemctl start nginx"
"sudo systemctl enable nginx"
Image description
Image description
👉 To add HTML content to my web server, I used "nano". Through 'nano', I was able to add my HTML code which consists of my name and my Slack name.
Image description
👉 I exited nano and went back to Ubuntu to restart my nginx with the code "sudo systemctl status nginx" so that I can see the content I just added.
👉 I went back to my EC2 Instance and copied my Public IPv4 address and voila (after configuring my security group)! I have all my content live on the web. See image below:
Image description

Challenges I faced while working on this project:

👉 After copying my IPv4 address, my Web server was not accessible. I had to configure my security group rule to allow inbound HTTP traffic from anywhere at port 80 and that got the job done.
👉 I also tried to SSH my EC2 from Putty but faced many error issues which was while I switched to EC2 Instnace Connect.

Was the Goal of this Task met?

Yes, while working on this project, I was able to understand the fundamental concepts of cloud computing and DevOps. In my other projects, I have been using Amazon Linux but here, I gained hands-on experience with Ubuntu & NGINX web server management.

References

• DevOps Engineers
• Cloud Engineers
• Site Reliability Engineers
• Platform Engineers

Top comments (1)

Collapse
 
ameh_mathias profile image
Ameh Mathias Ejeh

Nice writeup.