Recently I was trying to create a facebook app and thought of creating virtual hosts on my machine where I possibly could test it. Here is the steps I took to create two virtual hosts on my Linux Mint.First install LAMP stack if you don’t have it already
sudo apt-get install lamp-server^ -y
(Don’t forget the caret ‘^’)
Now define the following in “/etc/apache2/conf/extra/httpd-vhosts.conf” file
If the above mentioned file does not exist create it.
Also make sure that “/etc/apache2/httpd.conf” has this line
NameVirtualHost needs to be all conf files only once so make sure that “/etc/apache2/ports.conf” has got it commented out.
Now create the definition of virtual hosts like below.
One also need to create the entry in “/etc/hosts” like this.
Now you should be able to test your sites.
Thanks for reading and much credit goes to guys on internet for helping out specially on stackoverflow.com
via Blogger http://ashish-yadav.blogspot.com/2012/11/creating-virtual-hosts-in-apache2.html