Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Oct 1999 17:25:01 +0100
From:      Richard Morte <ric@sinclairassoc.force9.co.uk>
To:        "freebsd-questions@FreeBSD.ORG" <freebsd-questions@FreeBSD.ORG>
Subject:   DNS Implications for VHosts on Apache
Message-ID:  <3809F85D.60239718@sinclairassoc.force9.co.uk>

next in thread | raw e-mail | index | archive | help
Hi,

I have configured Apache 1.3.6 for name virtual hosts on an intranet.
The domains are for clients' web pages during development.

The web server delivers content to the network machines, but I have
kludged my local DNS to get it working.

rc.conf: (no problems here):
  network_interfaces="lo0 pn0 tun0"
  ifconfig_pno="inet 192.168.120.1 netmask 255.255.255.0"
  ifconfig_pno_alias0="inet 192.168.120.100 netmask 0xffffffff"  # for
Apache

named.conf: (again, no problems here):
  <...usual stuff...>

  zone "local" in {
     type master;
     file "db.local";
     notify no;
  };
  
  <... more zones...>

db.local: (I'm sure this isn't the right way to do it...):

  @	IN	SOA	local. root.local. (
                            usual stuff...)
  	IN	NS	sparky.at.home.
  
  sparky		IN	A	192.168.120.100
  www.client1.local.	IN	A	192.168.120.100
  www.client2.local.	IN	A	192.168.120.100
  <...etc...>

httpd.conf: (and this seems OK):

  BindAddress 192.168.120.100
  <>
  NameVirtualHost 192.168.120.100

  <VirtualHost www.client1.local>
      ServerName www.client1.local
      <...additional vhost directives...>
  </VirtualHost>

  <VirtualHost www.client2.local> etc, for each client in turn.

By using Name Virtual Hosting I can use just the one IP address on which
Apache listens.For local network machines to resolve the URL enterd in
the browser, DNS is set up as in db.local - but the FQDNs in that file
effectively duplicate the same address. Running NSLINT seems to regard
this as an error with "...already in use" messages. It also reports no
PTR records - which is correct: there aren't any. But if I were to set
up an in-addr.arpa file to resolve IP addresses to names, I can't see it
working because the 1 IP address will resolve to multiple domain names.
(I'm not sure what a browser would make of that - it would probable fall
through the VH sections in httpd.conf and end up in the _default_
section).

I would like to stick with name virtual hosting if I can (next stage is
to use dynamically configured VH using the ``VirtualDocumentRoot
/www/data/%0/htdocs'' directive, where %0 is a placeholder for the
Server Name off the host: header).

So, do I:

a) forget name-virtual hosting and use lots of IP addresses /OR
b) try using CNAMEs in DNS (but how about the PTRs) /OR
c) forget about DNS, just add more entries to /ect/hosts (but then this
has to be
   repeated on every client - this is not so good) /OR
d) stick with what I've got - it works, so why worry /OR
e) try something else?

Can anyone suggest how best to proceed? How is this done in real-world
situations?

Regards,
Ric


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?3809F85D.60239718>