Name Based Virtual Host

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

Name Based Virtual Host

Postby yonscun_lie » 31. July 2004 05:47

Problem with Virtual host.

Dear all,

Hi, I have download XAMPP and install it on c:\xampp.

I found htdocs is the document root. But I want to change it to c:\XAMPP\web (for some reason), while then I try to keep c:\xampp\htdocs folder in another virtual host.

So the system like this :
if user type http://localhost, it will open c:\xampp\web as doc root

if user type http://xampp, it will open c:\xampp\xampp


I try to use name based virtual host but Failed. Then I try to use IP based virtual host it's a little work. The code like this :
############################
# I have modified this one #
DocumentRoot "C:/xampp/www"
<Directory "C:/xampp/www">
...blablabla
</DiRECtory>
############################


# added this one #
<VirtualHost 127.0.0.1:80>
DocumentRoot C:/xampp/www
ServerName localhost
ServerAdmin localhost@localhost.com
ErrorLog logs/localhost.log
CustomLog logs/localhost.log common
</VirtualHost>

<VirtualHost 127.0.0.2:80>
DocumentRoot C:/xampp/htdocs
ServerName xampp
ServerAdmin xampp@xampp.com
ErrorLog logs/xampp.log
CustomLog logs/xampp_custom.log common
</VirtualHost>

if I type http://127.0.0.1 or 127.0.0.2 the apache respon good, but if I type http://xampp there are nothing happen????

For name based virtual host, I try to add this :
#NameVirtualHost *:80
#<VirtualHost *:80>
# DocumentRoot C:/xampp/www
# ServerName localhost
# ServerAdmin localhost@localhost.com
# ErrorLog logs/localhost.log
# CustomLog logs/localhost.log common
#</VirtualHost>

#<VirtualHost *:80>
# DocumentRoot C:/xampp/htdocs
# ServerName xampp
# ServerAdmin xampp@xampp.com
# ErrorLog logs/xampp.log
# CustomLog logs/xampp_custom.log common
#</VirtualHost>

But doesn't work. The apache only respon if I type : http://localhost, but not respond if I type http://xampp/ it doesn't

SSL is creating a new virtual host too, so I made another virtual host. Only change servername and docroot
yonscun_lie
 
Posts: 22
Joined: 01. May 2004 08:43
Location: Indonesia

Postby Bugman » 31. July 2004 15:19

Follow instructions here:

http://www.apptools.com/phptools/virtualhost.php

When restarting apache, just close down XAMPP and start it up

Bugman
Bugman
 
Posts: 53
Joined: 13. July 2004 23:39

Postby yonscun_lie » 02. August 2004 04:49

C:\WINNT\system32\drivers\etc\hosts <--- yeah at last I found the problem.......


THANKS A LOT BUGMAN :D :o :wink: :idea: :P
yonscun_lie
 
Posts: 22
Joined: 01. May 2004 08:43
Location: Indonesia

Postby Bugman » 02. August 2004 11:23

Its alright, you thought it would have mentioned it in the setup somewhere!

Bugman
Bugman
 
Posts: 53
Joined: 13. July 2004 23:39


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 101 guests