Virtual hosts over LAN

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Virtual hosts over LAN

Postby Owen » 02. June 2006 12:11

I'm running XAMPP 1.5.2 on WinXP and have set up some virtual hosts for local Web development. This works fine on my development machine, but I can't access the virtual hosts on another machine (a Mac mini) on my local network.

When using the local IP address of my development machine (http://10.0.0.101/) from the Mac, it redirects to the XAMPP admin pages (http://10.0.0.101/xampp) so Apache is working, but when I try any of the virtual hosts (e.g. http://10.0.0.101/local.site.com), I receive a 404 Object not found error). The Mac can't find my virtual hosts.

I have the following in my httpd-vhosts.conf file:

Code: Select all
<VirtualHost *:80>
   ServerAdmin admin@localhost
   DocumentRoot "C:/Program Files/xampp/htdocs"
   ServerName localhost
   ServerAlias localhost
   <Directory "C:/Program Files/xampp/htdocs">
      Options Indexes FollowSymLinks Includes ExecCGI
   </Directory>
</VirtualHost>


# local.site.com

<VirtualHost *:80>
   ServerAdmin admin@local.site.com
   DocumentRoot "C:/web/site"
   ServerName local.site.com
   ServerAlias local.site.com
   <Directory "C:/web/site">
      Options Indexes FollowSymLinks
      AllowOverride FileInfo
      Order allow,deny
      Allow from all
</Directory>
</VirtualHost>


and this in my hosts file:

Code: Select all
127.0.0.1   localhost
10.0.0.101   local.site.com


I've tried various things like changing the IPs in both files and reconfiguring my router, but to no avail. I just can't figure out why this isn't working properly.

I'd welcome any suggestions as I'm stumped on what's going on. Many thanks in advance.
Owen
 
Posts: 2
Joined: 02. June 2006 11:48

Postby Wiedmann » 02. June 2006 14:06

but when I try any of the virtual hosts (e.g. http://10.0.0.101/local.site.com), I receive a 404 Object not found error).

Sure. You access only a subdir with the name "local.site.com" on the Host "10.0.0.101". But there is no such subdir --> error 404

BTW: This have nothing to do with a virtual hosts access. In this case you must use the URI "http://local.site.com/".

I have the following in my httpd-vhosts.conf file:

I'm missing the line "NameVirtualHosts *:80".

and this in my hosts file:

You need this hosts file on your Mac too.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Owen » 02. June 2006 15:10

Thanks, Wiedmann.

The "NameVirtualHost *:80" line is present and correct in the http-vhosts.conf file.

I did wonder about the hosts file on the Mac, and did add the following line:

Code: Select all
10.0.0.101   local.site.com


but that had no effect. Also, I added the local domain using NetInfo Manager, but that failed also. Has anyone had a similar problem and overcome it?
Owen
 
Posts: 2
Joined: 02. June 2006 11:48


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 42 guests