VirtualHosts problems (just 2)

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

VirtualHosts problems (just 2)

Postby wclark » 30. October 2007 04:31

Hi All,

I am running OS X Leopard and the latest xampp. It mostly works, but I have 2 problems I have not been able to solve:

I am using VirtualHosts.

When I point my browser to localhost, then the xampp default site comes up as I expect.

First Problem:

When I point my browser to local.site1.com, the url gets changed to local.site1.com/xampp/index.php. If I manually change it to local.site1.com/index.php, then site1 comes up.
Same thing happens for site2.

Second Problem:
after I fix the URL from local.site1.com/xampp/index.php to local.site1.com/index.php it works fine and subsequent links work fine. The url shows as local.site1.com.
For site2, I manually remove the /xamp from the url and the index.php page comes up, but when I click on a link the url show as 192.168.1.120/newpage.php instead of local.site2.com/newpage.php.

Note that these sites both work fine on external servers, so I do not think it is a problem with the code.

Any suggestions are greatly appreciated, since I have been pulling my hair out for 2 days now. :-/

Many Thanks!
billc

my hosts file entries are:
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
102.168.1.120 local.site1.com site1
102.168.1.120 local.site2.com site2

My httpd-vhosts.conf is:
NameVirtualHost *:80
<virtualHost *:80>
ServerName localhost
ErrorLog logs/error.log
DocumentRoot /Applications/xampp/htdocs
<Directory "/Applications/xampp/htdocs">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</virtualHost>

<virtualHost *:80>
ServerName local.site1.com
DocumentRoot /Users/myUser/Sites/site1/html
<Directory "/Users/myUser/Sites/site1/html">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
DirectoryIndex index.php
</virtualHost>

<virtualHost *:80>
ServerName local.site2.com
DocumentRoot /Users/myUser/Sites/site2/www/html
<Directory "/Users/myUser/Sites/site2/www/html">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
DirectoryIndex index.php
</virtualHost>
wclark
 
Posts: 2
Joined: 30. October 2007 04:08
Location: Michigan, USA

Postby Wiedmann » 30. October 2007 04:54

When I point my browser to local.site1.com, the url gets changed to local.site1.com/xampp/index.php. If I manually change it to local.site1.com/index.php, then site1 comes up.
Same thing happens for site2.

Clear your browser cache.


For site2, I manually remove the /xamp from the url and the index.php page comes up, but when I click on a link the url show as 192.168.1.120/newpage.php instead of local.site2.com/newpage.php.

That's IMHO a code problem. I guess there is an absolute URI with "http://192.168.1.120/newpage.php" in the link href (use the source view in your browser).
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Thanks a million!

Postby wclark » 30. October 2007 16:15

Hi Wiedmann,

You were correct on the solution to both my problems! Awesome!

Many thanks and best regards,
billc
wclark
 
Posts: 2
Joined: 30. October 2007 04:08
Location: Michigan, USA


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 13 guests