Table of Contents
Today we will configure the most common web server on the planet: Apache. This lab will in no way give you enough experience to manage an Internet-facing webserver with dynamic content, and we don’t have enough time to cover related issues such as web development. Indeed, there are multiple papers dedicated to precisely that. This is the first step down a very long road; an introduction to one aspect of a potent career path.
Web servers are commonly addressed using any of two common
notations, either http://www.domain/ or
http://domain/. We’ve configured this
in the DNS lab already, but then our web server
(which didn’t actually exist) was known to DNS
as goliah.
Change the DNS so that both
www.localdomain. and
localdomain. resolve to our server’s addresses
for both A and AAAA records[62]. You should not
add an entry to the reverse zone, as we are defining aliases, and
only canonical names go into the reverse zone. Remove the old
entry for the non-existant Goliah. Use the following to test what
you have done.
The localdomain. case is just a little
bit tricky; remember that @ is shorthand for
the $ORIGIN, which in this particular file (as
defined in named.conf*), is
localdomain., so either use a
@ or leading whitespace, just as we did when
specifying the nameservers (NS record) for our
zone.
Move to Server#rndc reloadCheck your logs to ensure it worked, then begin testing$dig -t A +short www.localdomain192.168.1.1$dig -t AAAA +short www.localdomainfd6b:4104:35ce::1$dig +short -x 192.168.1.1server1.localdomain.$dig +short -x fd6b:4104:35ce::1server1.localdomain.$dig -t A +short localdomain192.168.1.1$dig -t AAAA +short localdomainfd6b:4104:35ce::1
[62] Alternatively, we could have made it so www has a CNAME of server1, but having duplicate A and AAAA records means we have greater flexibility, either to add other servers in round-robin DNS or to disable IPv6 by removing the AAAA record when accessing the web service.