Limiting to the ServerName in Apache2
- by David
I have 2 sites defined in my Apache2. Each one has a servername.
For example:
Server 1 (first in sites-enabled) responds to www.example.com
Server 2 (second in sites-enabled) responds to www.example2.com
Ok, the problem is when I type the server IP in the URL, the first server responds.
How could I limit the response to only specifying its servername? I would like to block the IP calls.
If that is not possible, I would like the second server to respond, not the first. I cannot change the order because there are aliases defined in the second server that would override the first server config.