Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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'm trying to setup a a virtual host on a machine in my office I've added urs.local

to the hosts file,

and added this to config


ServerName localhost 

DocumentRoot "/Applications/MAMP/htdocs" 
ServerName urs.local

On that same machine I put urs.local in the browser address bar, and it works.

But, then I go to another computer on the same network, behind the same firewall, and I get "problem loading page."

I think I am missing something somewhere.

share|improve this question

closed as off-topic by HopelessN00b, Sven Mar 15 at 9:49

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – Sven
If this question can be reworded to fit the rules in the help center, please edit the question.

Are you adding a corresponding hosts entry on that second computer? – EEAA May 8 '12 at 19:41
no I want others on the network to see the site but I don't want to do that on all the computers. so right now if i type the ip i see the main site but not the second – mcgrailm May 8 '12 at 19:42
I think you need to read up on what actually is. – MDMarra May 8 '12 at 19:52
@mcgrailm I think that you've probably received a few downvotes because SF is for professional systems administrators. The concept of the loopback adapter is fundamental and many feel that any professional systems administrator should know how it works. – MDMarra May 8 '12 at 21:39
I'm not one of the downvoters but I suspect you got those downvotes because as professionals in our fields we should all know this kind of elementary stuff. This really is kindergarten level knowledge. – John Gardeniers May 8 '12 at 22:20
up vote 20 down vote accepted

I don't think that this has really been properly described here, so here it goes. is a loopback address. It exists on all modern computer systems. Any traffic sent out of an interface with a destination of is immediately received on the loopback interface of the same machine. That traffic never reaches the network.

Since you are listening only on the loopback interface, then the only machine that can ever get to your site is the one hosting the site. When other computers try and connect to, they are trying to connect to themselves. You see where the problem is now, I take it?

The concept is probably best illustrated with this drawing:

Awesome Point Diagram

To solve your actual problem, you need to do two things.

  1. Listen on an address that other computers can contact. You have an normal IP of some sort. Use that instead of the
  2. If you must use a named virtualhost (not required), then you will either need to add an entry in the hosts file of every computer contacting your machine, or you will need to add a DNS entry in your local DNS server(s) for urs.local with an IP that is reachable. If you need to do this to more than one or two machines, use DNS. It's the right way™

tl;dr is on an interface whose traffic never leaves the machine that it is connected to. It exists on every modern implementation of the TCP/IP stack. Telling other machines to connect to is going to have them trying to connect to themselves, not your machine.

share|improve this answer
+1 for Yea Bro! That's me! – dmourati May 8 '12 at 21:58
thank you for this I have my answer and understanding and I love the illustration ! – mcgrailm May 9 '12 at 12:47

What URL exactly are you using on the other machines? is localhost. This will never ever be accessible from remote machines, it only points to the local machine. So in order to access your Site on this server from other computers you have to do two things:

  1. Modify the vhost to not listen on only
  2. Chose a server name that is not "localhost" (eg the hostname)
  3. Point the browsers of the remote machines to this server name
share|improve this answer

Yup - That'll have problems for a number of reasons:

1) 127.0.0.x is essentially referring to the system itself. So even if you did update the host files manually on other systems, they wouldn't find their way to the server you want.

2) 127.0.0.x isn't listening for external connections.

I agree that your virtual hosts need to listen on a network accessible IP. Once that's done, you can likely leverage DNS to refer the workstations to the appropriate location.

share|improve this answer

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