- Lab
- A Cloud Guru
Change DocumentRoot of the Apache Web Server
In this hands-on lab, your task is to change the DocumentRoot of the Apache web server. DocumentRoot changes also require other corresponding changes. First, we will create a new directory in a location with the proper permissions. The new directory and any nested directories will require read permissions. We will add the to the Apache configuration file. Next, copy the contents from the current directory to the new directory. SELinux will also need to be configured, so the new DocumentRoot can be accessible and able to serve the website to the client. We will verify the new changes. Lastly, we will restore the previous DocumentRoot along with the previous SELinux configuration to verify if the old DocumentRoot is accessible through the browser.
Path Info
Table of Contents
-
Challenge
Create a New Directory for the DocumentRoot
Note: You must use a local terminal app program with ssh support for this lab (examples: The mac/linux terminal program, or the new Windows Terminal with WSL2). The Instant Terminal can not be used for this specific lab.
- Create a new directory.
- Edit the Apache configuration file.
-
Challenge
Copy the Files
- Copy the files from the old directory to the new directory.
-
Challenge
Configure Selinux and Restart Httpd
- Edit SELinux to allow the new directory, file and image.
- Restart Apache service.
- Verify changes by opening a new private/incognito browser using the public IP address of the cloud server.
-
Challenge
Restore Original DocumentRoot and Verify Changes
- Edit Apache configuration file and revert to the original DocumentRoot.
- Verify changes by opening a new private/incognito browser using the public IP address of the cloud server.
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.