Fix Warning – Web server root directory configuration is not safe as it permits access to non-public files in GLPI

Welcome back, everyone! In our previous article, we successfully walked through the installation process of the GLPI system. However, after completing the installation, you may have encountered a notable warning on the homepage: Web server root directory configuration is not safe as it permits access to non-public files as shown below:

web-server-root-directory-configuration-is-not-safe

Don’t worry, in this article, we will explore a detailed solution to eliminate this warning and ensure that your GLPI system is deployed safely and efficiently.

Read more

Fix Warning

Open the terminal window and navigate to the GLPI installation directory. In this example, my GLPI installation directory is /var/www/html/glpi.

cd /var/www/html

ls

To disable that warning, open and edit the SafeDocumentRoot.php file in the glpi/src/System/Requirement/ directory with the following command:

sudo vim glpi/src/System/Requirement/SafeDocumentRoot.php

Navigate to the end of the file, and you will see the warning as displayed in the image below:

To disable the warning, press the i key to switch to the editing mode in vim and add the command return; just above it.

After finishing, save and exit the file by pressing Esc, entering the command :x, and then pressing Enter

Next, restart the web server to apply the changes:

sudo systemctl restart apache2

Finally, refresh the page by pressing the F5 key, and you will notice that the warning no longer appears on the GLPI homepage.

There you have it, we have successfully disabled the warning Web server root directory configuration is not safe as it permits access to non-public files. Wishing you success, and don’t forget to subscribe to my YouTube channel.

Leave a Reply

Your email address will not be published. Required fields are marked *