ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  Location, Location, Location: Tips for Storing Web Site Files
Subject:   Name-based Virtual Hosts
Date:   2003-09-14 22:55:36
From:   empass
I found an easier way to do number 3 (above)

According to the Apache manual you can do the following; I did not modify the "hosts" file. Also see the documentation about mass virtual hosting. (see apache.org and search for terms)

# example


ServerName www.mysite1.com
ServerPath /web
DocumentRoot /web/mysite1

ServerName www.mysite2.com
ServerPath /web
DocumentRoot /web/mysite2

ServerName www.mysite3.com
ServerPath /web
DocumentRoot /web/mysite3

# end example

It DOES work with the same IP for all three.

I also used a DNS Service (free for 5) to register the name servers @ http://www.zoneedit.com

Hope this helps.