I have a router in home. 3 different computers are connected to that router. Each computer has its own Apache software and has been set up to publish a webpage.
Router has only 1 IP address to outside. Lets say it is 88.65.1.7. All computers have different IP addresses like 192.168.0.1, 192.168.0.2, 192.168.0.3.
I want to use 3 different domain names.
http://www.a.com
http://www.b.com
http://www.c.com
If I ping to http://www.a.com, or http://www.b.com, or http://www.c.com, all domains go to same 88.65.1.7 IP address. Because all of them are behind of same router.
What I can’t understand is that how the network system can understand to go 192.168.0.1 when I type http://www.a.com to browser, and 192.168.0.2 when I type http://www.b.com, blah?
Or maybe I am thinking some things wrong.
One solution would be to set up port forwarding from the router to one machine, the ‘main’ machine, in whose apache httpd.conf you use rewrite rules to redirect the traffic, as so, assuming that your a.com machine is your main machine:
This would funnel traffic for b.com through the machine for a.com.