DNS and Apache NameVirtualHost - can't get it right!

Thor Kottelin thor at anta.net
Tue Feb 15 10:10:09 UTC 2000



BIND Users Mailing List wrote:

> From: Joakim Schramm <joakim at humanet.se>

> I'm trying to bring some of my now IP based virtual hosts in Apache into
> Name hosted, all under 1 IP - but I can't figure out who the DNS
> records/-zone files should be set up.
> 
> Tried to move an A rec for each into the zone file that now have the IP
> that should be used, but just get log mess like:
> Feb 13 12:47:19 ns named[10776]: domain1.nu.zone:21: data
> "www.domain2.nu" outside zone "domain1.nu" (ignored)

You need to place zone data for domain2.nu in the zone file for
domain2.nu, not in the one for domain1.nu.

> Also tried in each zonefile to change the IP to the one I want to use
> and the same in the zonefile with the PTR entried.

You should probably have only one PTR record for each IP address.

> No errors when
> restart Named but browesing to the domain just bring to the main http
> docs map. I'm pretty sure this is a DNS misconfig rather then an Apache
> config so thats why I post here.

When doing name-based virtual web hosting, all DNS needs to do is point
host names to the correct IP addresses, e.g. "www.domain2.nu. A 10.0.0.1"
or "www.domain2.nu. CNAME server-01.domain.nu." - If this works, I'd look
at the Apache httpd.conf instead. If the main site comes up instead of the
desired virtual site, there's probably something wrong with the Host
headers; either the user agent isn't sending them, or the server doesn't
process them as you intended. This is easy to troubleshoot by telnetting
to port 80 and issuing raw HTTP requests, e.g.:

HEAD / HTTP/1.1
Host: www.domain2.nu

(followed by two carriage returns)

Setting up name-based virtual hosting is usually quite uncomplicated using
the RTFM method, but if this fails, a suitable place for follow-ups would
probably be comp.infosystems.www.servers.misc. Good luck!

Thor

-- 
My PGP public key is available on key servers - please use it!

Powerful, automated web hosting: <http://www.virtualis.com/vr/tkotteli/>





More information about the bind-users mailing list