Setting up 2 or more domains on Apache with one IP address elegantly -- is it possible?

Setting up 2 or more domains on Apache with one IP address elegantly -- is it possible?

Post by George Kirik » Sat, 09 May 1998 04:00:00


I'm in the process of setting up some domains using the Virtual IP
capability of one of the hosting services, and came across a problem
which yet to be resolved. Hopefully someone can offer some suggestions
on the proper Apache configuration.

The first domain is, and has a real IP address (eg. This is my main account, which has POP mail, SMTP
mail, FTP, Telnet, etc.

The web directory is /abchome/www

If I place index.html in /abchome/www, all is well for the
domain. In order to save money (i.e. to share the account, and it's
total transfer limits, etc.), I'd like to place a second domain into
the same account, say

It was suggested that I create a subdirectory under www, to
/abchome/www/xyz, and then I'd put a new index.html there for the domain.

However, the hosting company created an index.cgi script in PERL which
redirects the requests for into the xyz directory, and som
when users of Netscape 4.0 etc request, Netscape shows the
resulting URL to be: . Furthermore,
shows up as

This seems to be a bit inelegant (i.e. there is an EXTRA xyz/ for the domain in the URL, and the extra index.html in the URL for domain.

So, my question is there a way to achieve the "optimal" result, namely:    shows up in the browser as

AND    shows up in the browser as

(etc. for any additional domains)

I would have thought it would be just a matter of changing the default
directory that each domain looks at (which sounds fairly simple).
Ideally I'd like the directories to be setup under the one main
account as:

/abchome  <--- my root for the main account with the real IP number
/abchome/www <-- place home page, index.html here, for
/abchome/www/xyz <-- place home page, index.html here for (virtual)
/abchome/www/def <-- place home page, index.html here for (virtual)

Any suggestions?

With many thanks in advance if this can be done (and equal thanks if
one can verify that it *can't* be done without putting extra junk at
the end of the URL in the browser).



| Toronto, Canada          Telephone: (416) 588-0269                 |