Virtual Hosting?

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

Virtual Hosting?

Postby FNdanielNL » 05. December 2007 22:41

I have tried already a lot of things but i cant get the fellowing working:

What i want

domein1.com directing to map1
domein2.com directing to map2

what i have is:

NameVirtualHost *:80

<VirtualHost domein1.com>

ServerName domein1.com
DocumentRoot "path to map

CustomLog logs/domein1.access.log combined
ErrorLog logs/domein1.error.log

</VirtualHost>

<VirtualHost domein2.com>

ServerName domein2.com
DocumentRoot "path to map"

CustomLog logs/domein2.access.log combined
ErrorLog logs/domein2.error.log

</VirtualHost>

// And in hosts file of windows:


127.0.0.1 localhost

127.0.0.1 domein1.com # domein1.com
127.0.0.1 domein2.com # domein2.com

btw got 1 ip who is working as fellow: 88.88.88.88 to> 192.169.2.2
first is ip how to visit the website and second is the ip who the server is responding on. Both domein names are set in the DNS to link to the ip 88.88.88.88
FNdanielNL
 
Posts: 2
Joined: 05. December 2007 22:34

Postby Izzy » 06. December 2007 01:19

A search in the Xampp for Windows forum, category Apache Friends in English, using the keyword vhost or virtualhost will give some clues and example solutions - you can also add Izzy in the Search for Author field if you wish to narrow the search a little.

Read the related Apache documentation.
http://httpd.apache.org/docs/2.3/vhosts/
http://httpd.apache.org/docs/2.3/vhosts/examples.html
http://httpd.apache.org/docs/2.3/mod/core.html


In this example we will use a wild card IP, name based VirtualHost first but you can experiment with using an IP based VirtualHost (check the Apache documentation) for how to.
Change the relevant path information to reflect your own paths as this is only an example.
Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName domain1.com
ServerAlias www.domain1.com
ServerAdmin serveradmin@domain1.com
DocumentRoot "C:/xampp/htdocs/map1"
<Directory "C:/xampp/htdocs/map1" >
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
CustomLog logs/domain1.access.log combined
ErrorLog logs/domain1.error.log
</VirtualHost>

<VirtualHost *:80>
ServerName domain2.com
ServerAlias www.domain2.com
ServerAdmin serveradmin@domain2.com
DocumentRoot "C:/xampp/htdocs/map2"
<Directory "C:/xampp/htdocs/map2" >
Options Indexes +FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
CustomLog logs/domain2.access.log combined
ErrorLog logs/domain2.error.log
</VirtualHost>


Check the syntax if you get errors by opening a command console (cmd.exe) in the xampp\apache\bin directory and typing apache -S at the command prompt.


===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby FNdanielNL » 06. December 2007 18:07

it does work already,maybe the dns had a big delay somewhere. Because on other services it was updated. But however it is working now ty
FNdanielNL
 
Posts: 2
Joined: 05. December 2007 22:34


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 119 guests