How to Create Multiple Virtual Hosts in Ubuntu with LAMP/Apache
I also assume that you have the Apache mod_rewrite module enabled. You can enable this by typing the following command in the terminal sudo a2enmod rewrite Create Multiple Directories. mkdir /var/www/mylocalsite1 mkdir /var/www/mylocalsite2 mkdir /var/www/mylocalsite3 Add your sites to the hosts file: sudo nano /etc/hosts OR sudo vim /etc/hosts It will look like this 127.0.0.1 localhost 127.0.1.1 mahesh-thinkpad # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters Now add your virtual host names after 127.0.1.1 mahesh-thinkpad Like 127.0.01 www.mylocalsite1.com 127.0.01 www.mylocalsite2.com 127.0.01 www.mylocalsite3.com Configure Apache Open new file sudo vim /etc/apache2/sites-available/mylocalsites and add like this <VirtualHost *:80> ServerAdmin webmaster@loc...