I manage a few Mac OSX XServes for production websites and have recently run into an issue dealing with the server resolving the DNS of some of the sites. Further investigation revealed that httpd.conf was configured to listen on all IPs (port 80), but the virtual host configurations only applied to the actual IP for the domain (not localhost).
eg (freehand configuration, probably syntactically incorrect and missing irrelevant options): in httpd.conf: Listen 80
in domainA:80.conf: ServerName domainA.com
Now, in the /etc/hosts file, it had this entry: 127.0.0.1 localhost 127.0.0.1 domainA.com
what would happen when domainB.com called out to domainA.com on the same machine, it would use the localhost IP address. Therefore, instead of using the correct virtualHost configuration, it used the default configuration (this took me so damn long to figure out, but it makes perfect sense)
I don't really have a need to access the domains from localhost, so my question is: What's the best way to disable apache from trying to access the configuration using 127.0.0.1?
1) Comment out the '127.0.0.1 domainA.com' entry in /etc/hosts (this is what I did to fix it temporarily, but is this really a good solution)?
2) Update the httpd.conf file to listen only to the appropriate 188.8.131.52 IP address (Listen 184.108.40.206:80) ?
Sidenote: I went with option 1 temporarily because I use a Tenon configuration and was unsure of the ramifications of changing their default value on the 'Listen'