Change Apache Default Root Directory on Ubuntu 14.04

Apache, Linux, Ubuntu, Web Development, 2015-06-17 00:13:26 UTC

In this case, the default configuration is not fit my need. So, I change the configuration. Based on experience configuring Ubuntu 12.04, I try to apply this on Ubuntu 14.04 (local machine). This configuration is slightly different. Here is how to configure it;

1. Open /etc/apache2/apache2.conf and change the line "/var/www" into something like below;

<Directory /home/your_name/sites/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>



2. Open /etc/apache2/sites-available/000-default.conf and change the line "DocumentRoot /var/www/html" into something like below;

DocumentRoot /home/your_name/sites/default



3. Create an index.html file in /home/your_name/sites/default folder.


4. Restart apache

$ sudo service apache2 restart




That's it! :)


Share: