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.

I have two personal computers that are connected to the same modem and I want to make a joint localhost For both of them.

for example i have a localhost on pc1 made by xampp and have a phpmyadmin and 'htdocs'folder, including databases and files. now we want to join them so if we went to localhost on pc2 it showed the same as pc1 and they have common databases. so if we change databases from pc2, the changes can be seen on pc1..

more important part is common phpmyadmin(databases) and in second priority if it's possible the common files.

share|improve this question

1 Answer 1

You cannot use localhost for access to another computer. It's a loopback address of the network card which means, in this case, you will be redirected to the local computer if you try to use it.

Since you're connected to the same modem you should be on the same network. You have to use the IP address or setup a DNS record for the computer with xampp installed and access it through that.

For example:
PC1 IP address: 192.168.0.10
PC2 IP address: 192.168.0.20

Configure apache to allow access from 192.168.0.20 in the \xampp\apache\conf\httpd.conf file. Browse to http://192.168.0.10/ or for example http://192.168.0.10/phpmyadmin, from PC2. You could also allow network access to the htdocs\ folder on PC1 and access it from PC2 by typing into explorer or run prompt \\192.168.0.10\htdocs\that way to modify files or folders.

Not neccesary but easier than typing in IP addresses:
If you have DNS on your modem you can configure an A-record for it there or you could simply go to the %WINDIR%\system32\drivers\etc\ folder on PC2 and configure the hosts file with a record pointing to 192.168.0.10(PC1).

More reading on networking:
http://en.wikipedia.org/wiki/IPv4
http://en.wikipedia.org/wiki/Hosts_%28file%29

share|improve this answer

Your Answer

 
discard

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.