Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Apr 1997 15:07:48 -0700 (PDT)
From:      Doug White <dwhite@gdi.uoregon.edu>
To:        Adam Majowicz at Connecticut Online <userx92@compsol.net>
Cc:        questions@FreeBSD.org
Subject:   Re: help on multiple web hosting
Message-ID:  <Pine.BSF.3.96.970418150445.14640P-100000@localhost>
In-Reply-To: <3357C9EE.7025@compsol.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 18 Apr 1997, Adam Majowicz at Connecticut Online wrote:

> I am using free bsd and the apache server that goes with that

Okay.  What version of FreeBSD is it?

> I have learned many things on this unix environment that is new to me 

The learning curve is steep but the rewards are plentiful.

> I just need to know how to make an ip address go to the proper
> dirrectory to find a file

No problem.

> www.domain1.com    is located in /home/domain1/public_html   directory
> www.domain2.com    is located in /home/domain2/public_html   directory

Easy.  Modify /usr/local/www/server/conf/httpd.conf.  At the bottom of
that file you'll find the following:

# VirtualHost: Allows the daemon to respond to requests for more than one
# server address, if your server machine is configured to accept IP
packets
# for multiple addresses. This can be accomplished with the ifconfig
# alias flag, or through kernel patches like VIF.

# Any httpd.conf or srm.conf directive may go into a VirtualHost command.
# See alto the BindAddress entry.

#<VirtualHost host.some_domain.com>
#ServerAdmin webmaster@host.some_domain.com
#DocumentRoot /www/docs/host.some_domain.com
#ServerName host.some_domain.com
#ErrorLog logs/host.some_domain.com-error_log
#TransferLog logs/host.some_domain.com-access_log
#</VirtualHost>

You will need to create a VirtualHost tag that looks something like
this...

<VirutalHost www.domain2.com>
DocumentRoot /home/domain2/public_html
ServerName www.domain2.com
</VirtualHost>

> for both ip's but when I try accessing the page it does not go to either
> dirrectory it goes to the one that was setup 
> 
> (I try access http://200.200.200.20/)

This procedure will work only for domains with names.  If you don't have a
name for your alias yet, then this probably won't work.

> I know that I have to tell them which ip is for which domain but don't
> where and how. And which domain goes to which directory

The above should help you. If you need more information, consult the
Apache documentation at http://www.apache.org.

Doug White                              | University of Oregon  
Internet:  dwhite@resnet.uoregon.edu    | Residence Networking Assistant
http://gladstone.uoregon.edu/~dwhite    | Computer Science Major




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.970418150445.14640P-100000>