How Do You Change the Apache Web Server Default Directory for a Website’s Files?

Problem scenario
You updated the Directory section of apache2.conf. You changed the DocumentRoot stanza in apache2.conf too. But when you browse to the website, you are not getting to the files in the directory you changed it to. You are getting files from /var/www/html/. Apache has been installed on Debian Linux. What do you do?

Solution

  1. Find this file: 000-default.conf
  2. Back it up. Then change its DocumentRoot stanza.
  3. Restart apache2 web services.

Leave a comment

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