[Xitami] Newbie can't setup virtual hosts

Paul Reid xitami@lists.xitami.org
Mon, 25 Jun 2001 01:34:32 -0400


> I then tried the DNS approach and set virtual hosting to www2.stc.com=stc.cfg but when I typed www2.stc.com in my browser's location bar, it dialed in and tried to find it on the Internet. 

You probably have a text file called "hosts". On Windows NT it
may be at C:\WINNT\system32\hosts, though it has been seen under
many names. Even Lmhosts.sam (which is really for something else,
but has been known to influence IP lookup).

It looks something like this: 

# This is a sample HOSTS file ...

#  102.54.94.97     rhino.acme.com      # source server

127.0.0.1       localhost

If typing "localhost" at your browser opens your page at
127.0.0.1, you have a hosts file somewhere (and that's why it
works). Anything on a line after "#" is ignored. 

Add some lines like 

127.0.0.1 manny

127.0.0.1 moe

127.0.0.1 jack

Save the file. 

Now, typing "manny" at your browser should open your default
127.0.0.1 page.

Now go into Xitami's Vhost settings and tell it that "manny"
points to a CFG file called "manny.cfg". In manny.cfg, point to
"O:/WebSites/mndm" as the root of the web pages for that host. Do
the same for moe and jack, except point to your other web-root
folders. 

Now typing manny, moe, or jack at your browser should open three
different web sites. 

You -may- still have trouble with your TCP stack not believing
the hosts file and going to the modem to ask a "real DNS". MS TCP
stacks can be quite dumb. 

When you get past that: I've had some trouble when web folders
are not on the same drive as Xitami. It "should" work, and often
it does, but sometimes it does not. 

Also: after setting or changing a Vhost, stop and restart Xitami.
I'm not sure if it "should" pick up the change on the fly, but my
habit is to force it to start anew.

 -PRR