Introduction
In the world of DevOps, mastering the basics of web server configuration is a fundamental skill. As part of the DevOps training, I set up and configure NGINX on a fresh Ubuntu server. This task was designed to test the ability to work with basic web server configurations and deliver a functional web server. The goal was to install NGINX, configure it to serve a custom HTML page, and document the entire process. This blog post details my approach, challenges, and learnings from this task.
Approach
Setting Up the Ubuntu Server:
- I provisioned a Ubuntu server on a cloud platform (I used AWS EC2 for this task).
I ensured the server had a public IP address and allowed inbound traffic on port 22 (SSH) and port 80 (HTTP).
Installing NGINXI connected to the server via SSH using the ssh key generated and updated the package list using .
sudo apt update
- I installed NGINX using the command sudo apt
install nginx -y
.
- After installation, I verified that NGINX was running using sudo
systemctl status nginx
.
Configuring the Custom HTML Page
- I edited the default NGINX HTML file located at
/var/www/html/index.html
using thenano
text editor. i replaced the default content with my desire text.
- After saving the changes with control X, I restarted NGINX using
sudo systemctl restart nginx
to apply the new configuration.
Testing the Configuration:
I opened my browser and navigated to http://3.235.74.74 (my ubuntu server public ip) The custom HTML page was successfully displayed.
thanks
Top comments (0)