Page 1 of 1

Webserver with several websites

PostPosted: 05. February 2007 15:36
by piros
Hello

I have a webserver (XAMPP) for hosting websites.

Trough virtual hosts I have added the websites on the server.

##
## Virtual Host for SITE1.NL
##

ServerName site1.nl
ServerAlias www.site1.nl
ServerAdmin
DocumentRoot "C:Program Files\xampp\htdocs\site1"
ServerPath "C:Program Files\xampp\htdocs\site1"

ErrorLog logs/www.site1.nl-error_log
CustomLog logs/www.site1.nl-access_log common


##
## End Virtual Host for SITE1.NL
##

##
## Virtual Host for SITE2.NL
##

ServerName site2.nl
ServerAlias www.site2.nl
ServerAdmin
DocumentRoot "C:Program Files\xampp\htdocs\site2"
ServerPath "C:Program Files\xampp\htdocs\site2"

ErrorLog logs/www.site2.nl-error_log
CustomLog logs/www.site2.nl-access_log common


##
## End Virtual Host for SITE2.NL
##

I also modified the hostfile of windows:

127.0.0.1 localhost
127.0.0.1 www.site1.nl
127.0.0.1 www.site2.nl

The problem is that when I call www.site1.nl or www.site2.nl, i get the same webpage.
(index.html in the map htdocs/site1).

I should get

for www.site1.nl
index.html in the map htdocs/site1

and for www.site2.nl
index.html in the map htdocs/site2

What can be a solusion?

Piros

PostPosted: 05. February 2007 16:27
by Wiedmann

PostPosted: 05. February 2007 20:44
by piros
DONE.

The problem was in the vhost file of Apache

First it was:

## NameVirtualHost *:80

It most be:

NameVirtualHost *:80

stupid stupid stupid :oops: :oops:

PostPosted: 12. February 2007 23:42
by nightrider35
on xampp it should look like this


Code: Select all
<VirtualHost *:80>
ServerName southcoastsupermotards.no-ip.org:80
DocumentRoot "D:/webserver/xampp/htdocs/southcoastsupermotards.no-ip.org"
<Directory "D:/webserver/xampp/htdocs/southcoastsupermotards.no-ip.org">
Order Allow,Deny
Allow from all
#Options All
#AllowOverride All
</Directory>
</VirtualHost>