Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Virtual Host on Apache 2.0.52 (WIN 32) XP Pro

Status
Not open for further replies.

noveltechinc

Technical User
Dec 19, 2004
2
US
I am hoping to setup multiple domains on one machine using one instance of Apache Server Software on WIN 32, OS: XP Pro.

I have mapped 3 urls thru DNS to my (1) IP address. They all terminate to my local Apache Document Root phys address on my local machine.

MY NEED IS: to get Apache Server to route the 3 urls to different document root paths.

Can it be done?
All suggestions welcomed!

 
Well if its anything like Apache 1.3.* I have this at the bottom of my httpd.conf , the rest of the config is pretty much setup for the default root and such, but then you gota have this at the bottom for virtual hosting.

Code:
NameVirtualHost *:80

<VirtualHost *:80>
	DocumentRoot "C:/Sites/kb244"
	ServerName kb244
</VirtualHost>

<VirtualHost *:80>
	DocumentRoot "C:/Sites/Nwmi"
	ServerName nwmi
</VirtualHost>

<VirtualHost *:80>
	DocumentRoot "C:/Sites/Michigan Freeride"
	ServerName freeride
</VirtualHost>

The above is pretty much the dead simple way of doing it, a server name ( ie the url ), and the root path and thats all I have dfined, you could define seperate error and access logs, and a bunch of other properties, but i dont need them. As you may have noted above , I just type for example will pull up that first site, in my C:\Windows\System32\Drivers\Etc\Hosts file I got

Code:
127.0.0.1	kb244
127.0.0.1	nwmi
127.0.0.1	freeride

If you are not using 127.0.0.1 that could be your problem.

Again I dont know if Apache 2 does things in the same manner.

Karl Blessing
PHP/MySQL Developer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top