Using a public_html file in your home directory is much more convenient than /var/www for a local website development environment. The following commands create a file called public_html in your home directory and enable the UserDir module in Apache.
From the command line, enter:
$ mkdir ~/public_html$ cd /etc/apache2/mods-enabled$ sudo ln -s ../mods-available/userdir.conf userdir.conf$ sudo ln -s ../mods-available/userdir.load userdir.load$ sudo service apache2 restart