Changing The Default Document Root On The Apache Web Server

By default, Apache uses /var/www as the root directory for its web pages. You can change this to something different by editing /etc/apache2/sites-available/000-default. You can even specify the root directory as a network share on a Windows system, which is what I was trying to achieve anyway. The first step is to ensure that your remote share is available after booting.

At the Pi command line, edit the Apache configuration file 000-default.

sudo nano /etc/apache2/sites-available/000-default

Now change the directory root on the DirectoryRoot statement to the new location. Save the changes and exit. To make these changes live, you need to restart Apache so that it reloads the new configuration.

sudo /etc/init.d/apache2 reload