Same virtual host config works on Windows but not on MacOS X

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Same virtual host config works on Windows but not on MacOS X

Postby petruza » 27. September 2009 19:47

Hi, I've been using Xampp on Windows for some time now.
I'm trying to set it up on Mac OSX also, so I copied all the configuration, but I can't get virtual hosts to work.

1- I included this in /private/etc/hosts:
Code: Select all
127.0.0.1 localhost
127.0.0.1 somedomain.local


2- I included this in httpd.conf:
Code: Select all
DocumentRoot "/Volumes/Files/http"
Include etc/extra/httpd-vhosts.conf


3- I included this in httpd-vhosts.conf:
Code: Select all
<VirtualHost 127.0.0.1>
   DocumentRoot "/Volumes/Files/http"
   ServerName "localhost"
</VirtualHost>

<VirtualHost 127.0.0.1>
   DocumentRoot "/Volumes/Files/http/somedomain"
   ServerName "somedomain.local"
</VirtualHost>



Which is basically the same configuration I have on Windows.
The result I get on MacOS is that any domain defined in the hosts file gets you to httpd.conf's DocumentRoot, I.E. /Volumes/Files/http and not to the virtual host's root.
Any ideas?
petruza
 
Posts: 8
Joined: 27. September 2009 19:29

Re: Same virtual host config works on Windows but not on MacOS X

Postby petruza » 30. September 2009 01:10

Hello? anybody?
update: I've managed to make vhosts work, but it seems only the firs virtual host that I define is the one that works.
Every other domain just points to the first vhost defined.
petruza
 
Posts: 8
Joined: 27. September 2009 19:29

Re: Same virtual host config works on Windows but not on MacOS X

Postby Nobbie » 30. September 2009 11:54

You are missing the NameVirtualHost Directive. See the documentation about Namebased VirtualHosts: http://httpd.apache.org/docs/2.2/en/vho ... based.html

>Which is basically the same configuration I have on Windows.

This configuration never worked correctly.
Nobbie
 
Posts: 8778
Joined: 09. March 2008 13:04

Re: Same virtual host config works on Windows but not on MacOS X

Postby petruza » 30. September 2009 13:31

You're right, thanks!
Worked perfectly.

How strange though, that the same config worked different in two platform verions of the same software.

With virtual hosts now I have everything I use for everyday work, working in OSX :D I'll be kissing windows goodbye soon.
Thanks!
petruza
 
Posts: 8
Joined: 27. September 2009 19:29


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 4 guests