In this post I am going to show you how to change your root directory in Ubuntu 15.04. If you further want to know about root directory read my blog What is Root Directory. If you are comfortable with then let’s get started with out wasting time any more!
Step 1: Opening the ‘default.conf’ File
The path for our root directory is specified in 000-default.conf file. Open your 000-default.conf file from /etc/apache2/sites-availale/ by running the following command:
sudo gedit /etc/apache2/sites-available/000-default.conf
Step 2: Changing Root Directory
You can clearly see in the 000-default.conf file that by default root directory is /var/www/html/ which is mentioned with DefaultRoot directive. Replace /var/www/html/ with the path whatever you want to and then save the 000-default.conf file.
Step Restart Apache Serve
As you’ve replaced the default root directory with your desired one, you, now, need to restart the apache server by running the following command:
sudo service apache2 restart
Hope this will help by changing your root directory, if you have any question about it, feel free to ask by comments!