[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Virtual Hosts



On Tue, Apr 03, 2001 at 01:24:36PM -0400, Peter Billson wrote:
> > I have installed Debian 2.2r2 and now trying to put
> > more IP based virtual hosts. I have used
> > the VirtualHost directives, and gave the IP number
> > to each site. But when I tried to look on the Virtual host
> > site, it brings the primary site.
> > 
> > I will appreciate, if I get information about how to setup 
> > VirtualHost on 2.2r2.
> > 
> > Abu Umair.
> > 
> 
> Be sure that you have a NameVirtualHost directive before your
> <VirtualHost> and be sure you have your Listen directive set to the
> IP(s)/ports you are listening on
> 
> basically use something like:
> 
> Listen 192.168.1.1:80
> Listen 192.168.1.2:80
> Listen 192.168.1.1:443
> 
> NameVirtualHost 192.168.1.1:80
> 
> <VirtualHost foo.bar.com:80>
               ^^^^^^^^^^^

I think it's more clear to use the IP address specified in the
NameVirtualHost clause here.  Not only is the config more readable,
but you reduce the possibility that DNS issues will prevent apache
from starting.

Using the colon:port notation is very useful when you want to bind one
apache to multiple ports.  Last I looked this wasn't clearly explained
on the apache website.

-- 
Nathan Norman - Staff Engineer | A good plan today is better
Micromuse Ltd.                 | than a perfect plan tomorrow.
mailto:nnorman@micromuse.com   |   -- Patton

Attachment: pgpMW0_OGkpOJ.pgp
Description: PGP signature


Reply to: