views:

250

answers:

1

I installed XAMPP on my desktop. I set up vhosts for about 5 sites and they are all working properly from the desktop itself.

The problem arises whenever I try to access these vhosts from my laptop. I changed the hosts file on the laptop to redirect the laptop dev.domain.com requests to the desktop, however, when I try to access these sites from my laptop on the local network, I only receive the XAMPP welcome screen. It seems like when trying to access the vhosts on the desktop from the laptop the vhosts file is ignored as all requests are redirected to the xampp directory.

What might I need to adjust to ensure access to the vhosts on the desktop from the laptop?

+1  A: 

I found the answer to my question. For all others that are in need of this answer, please refer to the following site for a comprehensive explanation: http://www.ozestretch.com/forum/viewtopic.php?t=5&f=6

In brief, there are 3 items that need addressed.

First, you need to address the hosts file on on the networked machine. For example, the host file on networked machine would have the following pointing requests to the xampp machines's IP address:

192.168.0.128 myvhost.com 

Remember, the above IP address is that of the xampp server.

Second, the xampp machine's host file must also have this same address in its host file in order for the site to work. This seemed redundant to me at first, but it works so no argument from me. So, the hosts file on the xampp server will also have:

127.0.0.1 myvhost.com
192.168.0.128 myvhost.com

Lastly, the httpd-vhosts.conf file on the xampp machine must have the following line:

NameVirtualHost 192.168.0.128:80

Hope this answer helps others out there.