Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Basically - I am producing a website and I am trying to share the "localhost" port on 2 computers.

Basically, when I build the project I just want to also be able to access it on both computers via the same port.

Currently, I cant seem to be able to do this ? Anyone can help with step-by-step ?

Thx

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

If I'm understanding you right you want localhost on machines A and B to point to the same place -- This is simultaneously exactly what's happening and completely impossible :-)

localhost by convention always points to 127.0.0.1, the magic loopback IP of the local machine (i.e. 127.0.0.1 on machine A always means machine A; 127.0.0.1 on machine B always means machine B). It's not an address that can be shared between multiple machines (in fact the entire 127.0.0.0/8 network is reserved for loopback use).

To do what you want you need to connect both machines over a network, assign them non-loopback IPs (private addresses out of 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16) & run your service over those addresses.


Consult a good networking book for more details...

share|improve this answer
    
hi :) no sorry maybe I made a mistake. Basically on Machine 1 - its 127.0.0.1:81 and I want machine 2 to be able to access this address so it can see the website ? –  Tom Mar 9 '10 at 16:37
    
Re-read the answer above: 127.0.0.1 is unique to each machine and cannot be shared across hosts: you must use non-loopback addresses to do what you want. –  voretaq7 Mar 9 '10 at 16:49
add comment

Your Answer

 
discard

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