Cannot figure out how to define Vhosts

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

Cannot figure out how to define Vhosts

Postby steed » 26. July 2004 06:44

Hi,

I want to move several sites I have to my new sever which has XAMPP installed.

I want to have these six sites namebased virtual hosts. I have them set up successfully on the other server, but simply transferring the virtusl hosts code from the old httpd.conf to the new just messes everything up.

Here is what I WISH I could do.

1) Keep localhost private so that only I can use phpmyadmin and it is NOT accessible from outside when someone accesses the server via port 80

2) Define my VirtualHosts so that I can have them on a separate partition. e.g. d:\ftproot

Here is the VHOSTS section of Httpd.conf


#
# Use name-based virtual hosting.
#
NameVirtualHost *:80



#<VirtualHost *:80>
# ServerName www.domain1.com
# ServerAdmin admin@domain1.com
# DocumentRoot "D:/ftproot/domain1/htdocs"
# ServerAlias domain1.com *.domain1.com domain1.dyndns.org *.domain1.dyndns.org
#</VirtualHost>

<VirtualHost *:80>
ServerName forums.domain2.com
ServerAdmin admin@cdomain2.com
DocumentRoot "D:/ftproot/domain2/htdocs/forums"
ServerAlias forums.domain2.com forums.domain2.dyndns.org
</VirtualHost>

<VirtualHost *:80>
ServerName www.domain2.com
ServerAdmin admin@domain2.com
DocumentRoot "D:/ftproot/domain2/htdocs"
ServerAlias domain2.com domain2.dyndns.org
</VirtualHost>

<VirtualHost *:80>
ServerName www.domain3.com
ServerAdmin admin@domain3.com
DocumentRoot "D:/ftproot/domain3.com/htdocs"
ServerAlias domain3.com *.domain3.com domain3.dyndns.org *.domain3.dyndns.org
</VirtualHost>

<VirtualHost *:80>
ServerName www.domain4.com
ServerAdmin admin@domain4.com
DocumentRoot "D:/ftproot/domain4/htdocs"
ServerAlias domain4.com *.domain4.com domain4.dyndns.org *.domain4.dyndns.org
</VirtualHost>

<VirtualHost *:80>
ServerName www.domain5.com
ServerAlias domain5.com *.domain5.com domain5.dyndns.org *.domain5.dyndns.org
ServerAdmin admin@domain5.com
DocumentRoot "D:/ftproot/domain5/htdocs"
</VirtualHost>


And another problem...

3) Also, whenever I try to give my server a name other than localhost, the localhost itself becomes useless (blank page). I don't understand that since my old server has a name (not localhost) and I can still access it with http:\\localhost.

Well, the avatar says it all. I am new to XAMPP. Any help is appreciated.

Steed
User avatar
steed
 
Posts: 2
Joined: 26. July 2004 06:07

Postby Bugman » 27. July 2004 12:59

Hello,

Its very simple. You will need to look up on the internet about hosts file in the system32 folder on your windows machine. Here you can define addresses so that only you can see them.

I suggest that when you define domain names, you do something like www.local.domainname.com otherwise you will end up in a pickle.

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 45 guests