I am trying to set up a load balancer for a couple of virtual hosts on my apache server. These virtual hosts are added by adding the following lines for the file "C:\Windows\System32\drivers\etc\hosts":
127.0.0.1 localhost
127.0.0.1 vhosta
127.0.0.1 vhostb
127.0.0.1 vhostc
127.0.0.1 load-balancer
::1 localhost
Then I've added the following lines for the file "C:\xampp\apache\conf\extra\httpd-vhosts.conf":
<VirtualHost *:80>
DocumentRoot c:/xampp/htdocs
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot c:/vhosts/vhosta
ServerName vhosta
</VirtualHost>
<VirtualHost *:80>
DocumentRoot c:/vhosts/vhostb
ServerName vhostb
</VirtualHost>
<VirtualHost *:80>
DocumentRoot c:/vhosts/vhostc
ServerName vhostc
</VirtualHost>
<VirtualHost *:80>
DocumentRoot c:/vhosts/load-balancer
ServerName load-balancer
</VirtualHost>
And of course I've created the folders in C:/vhosts/ and added an index.php file to each one (with an echo statement inside).
Now, I can access the virtual hosts through my browser by visiting "http://vhosta" etc.
But what I need, is to make a load balancer that chooses to execute either "http://vhosta", "http://vhostb" or "http://vhostc".
How can I achieve this? And have I done everything correct so far?
Any help will be greatly appreciated! Thanks in advance!
(i am using xampp on windows 8.1 btw.)