I am assuming working of Apache, for Ubuntu and Debian works same way. You can do the follwoing
Assume /etc/apache2/sites-available have two virtual host config files named websites1 (www.mysite1.com
) and website2 (www.mysite2.com
cd to /etc/apache2/sites-enabled
ln -s ../sites-available/mysite1 .
ln -s ../sites-available/mysite2 .
It will create the two links in /etc/apache2/sites-enabled.You can check with
ls -l /etc/apache2/sites-enabled
Now for www.mysite1.com
apache will go to /etc/apache2/sites-enabled/mysites1 and for www.mysite2.com
it will go to /etc/apache2/sites-enabled/mysites2
If you go only with IP in the browser, it will always serve the first one only. So always use the url (defined by ServerName in virtual hostfile) in browser corresponding to the website