It is easier to have your work all within your home directory, wher we don’t have to worry bout permissions and folders owned by root user. What it gets you is the ability to access your websites in your home directory by a URL in the form http://localhost/ ~ system_user_name(say jasleen)/
Create a directory (folder) called “public_html” in your home directory, with your file browser or the command below:
Create two symbolic links (soft links, symlinks) in the stated directory pointing to the corresponding module in /etc/apache2/mods-available.
(make sure that your are in /etc/apache2/mods-enabled path)
$sudo ln -s ../mods-available/userdir.conf userdir.conf
$sudo ln -s ../mods-available/userdir.load userdir.load
The first command is used for configuration of files.
This command includes an absolute path, so it doesn’t matter where you execute it from.
$sudo /etc/init.d/apache2 restart
Now you can access to your public_html folder in browser as http://localhost/~system_user_name/