Creating Virtual Host in Ubutnu

Steps to Create Virtual Host in Ubuntu:
----------------------------------------
1). Open the hosts file:
Command:
-------
sudo gedit /etc/hosts

2). Now create an entry for your virtual host:
Code:
-----
127.0.1.1    yourhost.com

3). Now open the your 000-default file:
Code:
-----
sudo gedit /etc/apache2/sites-enabled/000-default

4). And add the following line at the end of your file:
Code:
-----
<VirtualHost *:80>
ServerName yourhost.com
DocumentRoot /var/www/your_directory
<Directory /var/www/your_directory>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
</Directory>
</VirtualHost>

5). Restart your apache server:
Command:
--------
sudo service apache2 restart

Note: If your sites dont work then make an entry on your browser prefrences.
Steps: edit--> Prefrences --> Network --> Setting --> No Proxy For --> Make and entry for you host "yourhost.com"