Beginnings are always easy, for example, this is the beginning of my 8-week internship journey with HNG, and as excited as I am, I am resolved to overcome any challenges I would likely encounter in this program's tasks. That said, let us begin.
DevOps Stage O Task
Interns are tasked with setting up and configuring NGINX on a fresh Ubuntu server.
Solution
For this task, I will use AWS Cloud because I am familiar with it, but as I've stated, I am challenging myself, so expect this task to be redone in other cloud providers' compute instances.
First I will begin by launching the AWS compute--instance EC2, picking Ubuntu AMI, and allowing ports 22 and 80. Next, I connect to the instance via SSH
After getting into the server I would run an update and install NGINX with the following command
sudo apt update & sudo apt install nginx -y
Now I'll navigate to the directory where my webpage will be served
cd /var/www/html/
Once there I create a new file using sudo permission and add my HTML code
sudo vi index.html
<!DOCTYPEhtml>
<html>
<body>
<h1>Welcome to DevOps Stage 0</h1>
<p>Omoruyi Emmanuel Osakue/Omoruyi</p>
</body>
</html>
Next, we run a restart for the service
sudo service nginx restart
Let’s check if everything works as it should. Open our newly created site in a web browser.
Everything works as it should. We have just configured the Nginx web server.
Now while working on this project I initially tried editing my HTML file in the /www/html/ directory without sudo permissions which of course failed after which I learned to use the sudo permissions
This task demonstrates my ability to work with basic web server configurations and deliver a functional web server.
Top comments (0)