- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud
- Security

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.

Lab 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.
About the author
Real skill practice before real-world application
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.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.