Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I set up a local server without MAMP, for various reasons. I used this tutorial: Install and configure Apache, MySQL, PHP and phpMyAdmin on OSX 10.8 Mountain Lion

I'm just wondering why the local IP and localhost resolve to two different locations. Right now the IP resolves to a Virtual Host I set up and the localhost resolves to the DocumentRoot established by httpd.conf

share|improve this question

migrated from Nov 30 '12 at 10:42

This question came from our site for professional and enthusiast programmers.

I think you are using the word "resolve" in a non-standard way. Are you talking about what you get from a web server? – David Schwartz Nov 30 '12 at 3:31
I mean that when I type localhost an index file in the DocumentRoot draws. When I type another index page draws, from the DocumentRoot of my Virtual Host. – Greg Wiley Nov 30 '12 at 3:34
up vote 0 down vote accepted

You've got two (or more) virtual hosts set up. One is set to listen on localhost, the other is set to listen on

Or more likely, one is set to listen on either or localhost, and the other is set to listen on any connection and is picking up whichever the first is not.

Take a look at your virtual hosts - note that virtual hosts can be created in multiple locations on OSX - either under the system as a whole or per-user. You probably want to either remove the virtual host, or set it to listen under both addresses.

share|improve this answer

Take a look at /private/etc/hosts and make sure that is associated with localhost, like so... localhost
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.