Apache has something called VirtualHosts.
You can configure it in that way that when you go to example.com get a different site than example2.com even if you use the same IP’s.
A HTTP Request looks something like this:
GET /index.html HTTP/1.0
[some more]
How does the server know you are trying to access http://www.example.com or http://www.example2.com?
In addition to the GET line, the browser sends a number of headers. One of these headers is the
Hostheader, which specifies which host the request is targeted at.A simple example request could be:
This indicates that the browser wants whatever is at
http://example.com/index.html, and not what is athttp://example2.com/index.html.Further information:
Hostheader in the HTTP specification