On Wednesday, January 15, 2003, at 03:16 PM, Tim Moss wrote:

I'd hear that AOLserver 4 had host-based virtual hosting built into it.

How do you actually configure this?
More or less like this:

----------------------------------------------------------------Cut
here--------------------------
ns_section ns/modules
ns_param        nssock          ${bindir}/nssock${ext}

ns_section ns/module/nssock
ns_param   port            $httpport
ns_param   hostname        $hostname
ns_param   address         $address

ns_section "ns/servers"
ns_param server1  "Some server"
ns_param server2 "Some other server"

ns_section ns/module/nssock/servers
ns_param server1 www.server1.com
ns_param server2 www.server2.com

#
# Note that the previous section is different from the sample config
shipped
# with AOLserver 4; by empirical methods, I realized that the sample is
# incorrect -- it wants to put ":$httpport" after the host.  It would be
nice if that worked,
# but the code doesn't actually support it.  If you have a server
listening on
# more than one port, and you want servers with the same name but different
# ports going to different servers, you're out of luck for now.
#

#
# Now, one set of server configs per virtual...
#

ns_section "ns/server/server1"
ns_param   pageroot        /usr/local/aolserver/servers/server1/pages

ns_section "ns/server/server1/module/nslog"
ns_param        file    "$logdir/access-server1.log"

ns_section "ns/server/server1/modules"
ns_param   nslog           ${bindir}/nslog${ext}

ns_section "ns/server/server2"
ns_param   pageroot        /usr/local/aolserver/servers/server1/pages

ns_section "ns/server/server2/module/nslog"
ns_param        file    "$logdir/access-server2.log"

ns_section "ns/server/server2/modules"
ns_param   nslog           ${bindir}/nslog${ext}
----------------------------------------------------------------Cut
here--------------------------

I left out some things, but most of those are no different from the 3x
config.  Note that you load nssock on a global basis, not a per-module
basis.  At the moment, it appears that nslog can only be loaded on a
per-module basis, so you can't dump all the access log entries into one
log file; that may or may not suit your taste, depending on how you run
your railroad.

Also, virtual server configuration appears static at the moment; as far as
I can tell, you can't add servers to an AOLserver once it's completed
initialization, so dynamic virtual hosting scenarios are not possible now.

(At Primehost, we used to solve this by lumping a number of virtuals into
one AOLserver instance, and tuning the number of virtuals to keep the
server startup time fairly low; then we'd run as many instances as we
could get away with on a box.  Some platforms could handle more instances
with fewer virtuals per instance, and others were better at fewer
instances with more virtuals per instance.)

Pete.

Reply via email to