Friday, March 14, 2014

Ubuntu: Change default location of localhost

By default, localhost ( points to /var/www/ directory in Ubuntu. I prefer the location to be in my home directory.
To change the default location, open the file:
 and change it to look as follows:
(My wokspace is located at /home/chaithanya/www)

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /home/chaithanya/www

        <Directory /home/chaithanya/www/>
                Options Indexes FollowSymLinks
                AllowOverride All
                Require all granted
        ErrorLog /var/log/apache2/error.log
        CustomLog /var/log/apache2/access.log common
Note: This works for Ubuntu 13.10+