Installing and managing services is one of the first things a Linux Server Administrator should learn. The standard example of a web service is a “LAMP stack” – Linux, Apache, MySQL, PHP. While Apache is, for many administrators, the web service to use, there are use cases for using another one – Nginx. For many installations, the two web services are interchangeable. In this lab, you’ll be able to practice installing and configuring Nginx.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Install and Configure Nginx so that the web root is set as instructed
- First, we need to install the software. Since that can only be done as the
root
user, elevate toroot
. - Now we need to install the
nginx
software usingyum
. - Now we’ve been directed to use a specific DocumentRoot. In the file, search for
DocumentRoot
to find the default. Since it differs from what we’re being instructed to use, change it, and the subsequentDirectory
stanzas. Don’t forget that there are two of them.
- First, we need to install the software. Since that can only be done as the
- Test the configuration, ensuring pages are served from /opt/website
- Make sure the service is using the configuration file you just edited by restarting it.
- Verify that the page looks different from the default. You could do that either using
curl
in the terminal, or by putting your external IP address into your web browser. - If you see the DadCorp website, you’ve completed that lab correctly! Well done!