Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Feb 2003 13:36:14 -0800
From:      "Daxbert" <daxbert_news@dweebsoft.com>
To:        <lists@3bags.com>, <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Silly question re: Apache NameVitualHost directive
Message-ID:  <025301c2d3a7$ef56af70$8a01a8c0@dweebsoft.com>
References:  <00ee01c2d3a6$52e73070$aeb423cf@3bagsmedia>

next in thread | previous in thread | raw e-mail | index | archive | help
> I'm wondering why/how I can get multiple NameVirtualHost IP addresses to
> answer?
>
> For example, I have one IP listed in the NameVirtualHost directive (e.g.
> 11.22.33.44), in my VitualHost 'containers' I use that IP like so:
> <VirtualHost 11.22.33.44> etc. For some reason, I've never been able to
> get a * to work on FreeBSD? Anyway, I have several Ips aliased on the
> NIC and I'd like to use them as separate NameVirtualHost addresses, so
> that I can also point domains to 11.22.33.55 and have them respond to
> the <VirtualHost 11.22.33.55> directives. At the moment, I can't seem to
> get this working?

All you need is multiple NameVirtualHost directives in your httpd.conf

Example:

NameVirutalHost 11.22.33.44
NameVirutalHost 11.22.33.55
NameVirutalHost 11.22.33.66


Second, when you're doing NameVirtualHost, you should avoid using IP based names in virtualhost.  The purpose of Named hosts, is to
use the browser supplied host header to identify which virtual server to use.

Then when apache parses the <VirtualHost insert.domain.name.here>  it will lookup the IP for the given name, and if it matches one
of the NameVirtualHosts, name based hosting will be used for that host.  You will get a warning if you have a NameVirtualHost
directive, and none of the Vhosts have a name which resolves to that IP.


--daxbert


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?025301c2d3a7$ef56af70$8a01a8c0>