Skip to main content

Change DocumentRoot of the Apache Web Server

Hands-On Lab

 

Photo of

Training Architect

Length

00:45:00

Difficulty

Intermediate

For this lab, your task is to change the DocumentRoot of the Apache web server. This is something that is often done, but you should always be aware that if this change is made, other corresponding changes will need to be made as well. First of all, you will need to create a new directory in some location that has the needed set of permissions applied to it. The directory needs to be readable and all the previous directories that lead up to that one must be readable as well. After creating the directory you must put its path in a configuration file of the apache server. Next, you need to copy the contents from the current directory to the new directory. Once you have done that, it is necessary to configure SELinux for the new DocumentRoot so that its files can be accessible and servable to the client that requested the website. Then you need to verify that everything is working properly. Afterwards, you can then restore the previous DocumentRoot and restore the SELinux configuration and verify that the old DocumentRoot is accessible through the browser. If everything is working properly, you have successfully completed the lab.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.