Forum OpenACS Q&A: Aolserver 4.0 with Postgres 7.2 , invalid command name "ns_db"

i'm running postgres 7.2 , Aolserver 4.0GM , Openacs4.6.3
in FreeBSD 5.1R
when i start aolserver with this config file...

=================================================

ns_log notice "config.tcl: starting to read config file..."

set locale "ko"

set database              postgres

set httpport              8000
set httpsport            8443

set hostname              test
set address                192.168.0.104
set user_account        "service0"

set server              "service0"
set db_name            $server
set servername          "New OpenACS Installation - Development"

# which database do you want? postgres or oracle

#################################################################
# For a basic install, nothing below here needs to be changed
#################################################################

set serverroot          "/web/service0"

# if debug is false, all debugging will be turned off
set debug false

#
# AOLserver's home and binary directories. Autoconfigurable.
#
set homedir                /usr/local/aolserver
set bindir                  [file dirname [ns_info nsd]]

#
# Where are your pages going to live ?
#
set pageroot                /web/service0/www
set directoryfile          index.tcl,index.adp,index.html,index.htm

#
# Global server parameters
#

ns_section ns/parameters
ns_param  serverlog          ${serverroot}/log/error.log
ns_param  home              $homedir
ns_param  maxkeepalive      0
ns_param  logroll            on
ns_param  maxbackup          5
ns_param  debug              $debug

# charset hacking
ns_param  HackContentType    1
ns_param  URLCharset        euc-kr
ns_param  OutputCharset      euc-kr
ns_param  HttpOpenCharset    euc-kr
ns_param  DefaultCharset    euc-kr

#
# Thread library (nsthread) parameters
#
ns_section ns/threads
ns_param  mutexmeter        true      ;# measure lock contention
ns_param  stacksize          500000

#
# MIME types.
#
#  Note: AOLserver already has an exhaustive list of MIME types, but in
#  case something is missing you can add it here.
#

ns_section ns/mimetypes
ns_param  Default            text/plain
ns_param  NoExtension        text/plain
ns_param  .pcd              image/x-photo-cd
ns_param  .prc              application/x-pilot
ns_param  .xls              application/vnd.ms-excel
ns_param  .tcl              "text/plain; charset=euc-kr"
ns_param  .adp              "text/html; charset=euc-kr"
ns_param  .html              text/plain

#
# Tcl Configuration
#
ns_section ns/server/${server}/tcl
ns_param  library        ${serverroot}/tcl
ns_param  autoclose      on
ns_param  debug          $debug
############################################################
#
# Server-level configuration
#
#  There is only one server in AOLserver, but this is helpful when multiple
#  servers share the same configuration file.  This file assumes that only
#  one server is in use so it is set at the top in the "server" Tcl variable
#  Other host-specific values are set up above as Tcl variables, too.
#
ns_section ns/servers
ns_param  $server    $servername

#
# Server parameters
#
ns_section ns/server/${server}
ns_param  directoryfile      $directoryfile
ns_param  pageroot          $pageroot
ns_param  maxconnections    5
ns_param  maxdropped        0
ns_param  maxthreads        5
ns_param  minthreads        5
ns_param  threadtimeout      120
ns_param  globalstats        false    ;# Enable built-in statistics
ns_param  urlstats          false    ;# Enable URL statistics
ns_param  maxurlstats        1000    ;# Max number of URL's to do stats on
#ns_param  directoryadp    $pageroot/dirlist.adp ;# Choose one or the other
#ns_param  directoryproc    _ns_dirlist          ;#  ...but not both!
#ns_param  directorylisting  fancy              ;# Can be simple or fancy

#
# ADP (AOLserver Dynamic Page) configuration
#
ns_section ns/server/${server}/adp
ns_param  map          /*.adp    ;# Extensions to parse as ADP's
#ns_param  map          "/*.html" ;# Any extension can be mapped
ns_param  enableexpire  false    ;# Set "Expires: now" on all ADP's
ns_param  enabledebug  $debug    ;# Allow Tclpro debugging with "?debug"
ns_param  defaultparser fancy

ns_section ns/server/${server}/adp/parsers
ns_param  fancy    ".adp"

#
# Socket driver module (HTTP)  -- nssock
#
ns_section ns/server/${server}/module/nssock
ns_param  timeout            120
ns_param  address            $address
ns_section "ns/server/${server}/module/nsopenssl"

# Typically where you store your certificates
# Defaults to $AOLSERVER/servers/${servername}/modules/nsopenssl
#ns_param ModuleDir                      ${homedir}/servers/${server}/modules/nsopenssl
ns_param ModuleDir                      ${serverroot}/etc/certs

# NSD-driven connections:
ns_param ServerPort                      $httpsport
ns_param ServerHostname                  $hostname
ns_param ServerAddress                  $address
ns_param ServerCertFile                  certfile.pem
ns_param ServerKeyFile                  keyfile.pem
ns_param ServerProtocols                "SSLv2, SSLv3, TLSv1"
ns_param ServerCipherSuite              "ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP"
ns_param ServerSessionCache              false
ns_param ServerSessionCacheID            1
ns_param ServerSessionCacheSize          512
ns_param ServerSessionCacheTimeout      300
ns_param ServerPeerVerify                true
ns_param ServerPeerVerifyDepth          3
ns_param ServerCADir                    ca
ns_param ServerCAFile                    ca.pem
ns_param ServerTrace                    false

# For listening and accepting SSL connections via Tcl/C API:
ns_param SockServerCertFile              certfile.pem
ns_param SockServerKeyFile              keyfile.pem
ns_param SockServerProtocols            "SSLv2, SSLv3, TLSv1"
ns_param SockServerCipherSuite          "ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP"
ns_param SockServerSessionCache          false
ns_param SockServerSessionCacheID        2
ns_param SockServerSessionCacheSize      512
ns_param SockServerSessionCacheTimeout  300
ns_param SockServerPeerVerify            true
ns_param SockServerPeerVerifyDepth      3
ns_param SockServerCADir                internal_ca
ns_param SockServerCAFile                internal_ca.pem
ns_param SockServerTrace                false

# Outgoing SSL connections
ns_param SockClientCertFile              certfile.pem
ns_param SockClientKeyFile              keyfile.pem
ns_param SockClientProtocols            "SSLv2, SSLv3, TLSv1"
ns_param SockClientCipherSuite          "ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP"
ns_param SockClientSessionCache          false
ns_param SockClientSessionCacheID        3
ns_param SockClientSessionCacheSize      512
ns_param SockClientSessionCacheTimeout  300
ns_param SockClientPeerVerify            true
ns_param SockServerPeerVerifyDepth      3
ns_param SockClientCADir                ca
ns_param SockClientCAFile                ca.pem
ns_param SockClientTrace                false
# OpenSSL library support:
#ns_param RandomFile                      /some/file
ns_param SeedBytes                      1024

#
# Database drivers
# The database driver is specified here. PostgreSQL driver being loaded.
# Make sure you have the driver compiled and put it in {aolserverdir}/bin
#
ns_section "ns/db/drivers"
if { $database == "oracle" } {
    ns_param  ora8            ${bindir}/ora8.so
} else {
    ns_param  postgres        ${bindir}/nspostgres.so  ;# Load PostgreSQL driver
}

#
# Database Pools: This is how AOLserver  ``talks'' to the RDBMS. You need
# three for OpenACS: main, log, subquery. Make sure to replace ``yourdb''
# and ``yourpassword'' with the actual values for your db name and the
# password for it.

# AOLserver can have different pools connecting to different databases
# and even different different database servers.
#
ns_section ns/db/pools
ns_param  pool1      "Pool 1"
ns_param  pool2      "Pool 2"
ns_param  pool3      "Pool 3"

ns_section ns/db/pool/pool1
ns_param  maxidle            1000000000
ns_param  maxopen            1000000000
ns_param  connections        5
ns_param  verbose            $debug
ns_param  extendedtableinfo  true
ns_param  logsqlerrors      $debug
if { $database == "oracle" } {
    ns_param  driver            ora8
    ns_param  datasource        {}
    ns_param  user              $db_name
    ns_param  password          $db_password
} else {
    ns_param  driver            postgres
    ns_param  datasource        localhost::${db_name}
    ns_param  user              $server
    ns_param  password          ""
}

ns_section ns/db/pool/pool2
ns_param  maxidle            1000000000
ns_param  maxopen            1000000000
ns_param  connections        5
ns_param  verbose            $debug
ns_param  extendedtableinfo  true
ns_param  logsqlerrors      $debug
if { $database == "oracle" } {
    ns_param  driver            ora8
    ns_param  datasource        {}
    ns_param  user              $db_name
    ns_param  password          $db_password
} else {
    ns_param  driver            postgres
    ns_param  datasource        localhost::${db_name}
    ns_param  user              $server
    ns_param  password          ""
}

ns_section ns/db/pool/pool3
ns_param  maxidle            1000000000
ns_param  maxopen            1000000000
ns_param  connections        5
ns_param  verbose            $debug
ns_param  extendedtableinfo  true
ns_param  logsqlerrors      $debug
if { $database == "oracle" } {
    ns_param  driver            ora8
    ns_param  datasource        {}
    ns_param  user              $db_name
    ns_param  password          $db_password
} else {
    ns_param  driver            postgres
    ns_param  datasource        localhost::${db_name}
    ns_param  user              $server
    ns_param  password          ""
}

ns_section ns/server/${server}/db
ns_param  pools              "*"
ns_param  defaultpool        pool1

ns_section ns/server/${server}/redirects
ns_param  404                "global/file-not-found.html"
ns_param  403                "global/forbidden.html"

...........

===========================================================
it causes this error log

==========================================================

[07/Dec/2003:19:31:16][24165.134533120][-main-] Notice: nsmain: AOLserver/4.0 running
[07/Dec/2003:19:31:16][24165.134533120][-main-] Notice: nsmain: security info: uid=1002, euid=1002, gid=71, egid=71
[07/Dec/2003:19:31:16][24165.134533120][-main-] Error: nssock: failed to listen on 192.168.0.104:8000: Address already in use
[07/Dec/2003:19:31:16][24165.134752256][-sched-] Notice: sched: starting
[07/Dec/2003:19:31:16][24165.135159808][-driver-] Notice: starting
[07/Dec/2003:19:31:16][24165.135159808][-driver-] Notice: driver: accepting connections
[07/Dec/2003:19:42:46][24317.134533120][-main-] Notice: nsmain: AOLserver/4.0 starting
[07/Dec/2003:19:42:46][24317.134533120][-main-] Notice: nsmain: security info: uid=1002, euid=1002, gid=71, egid=71
[07/Dec/2003:19:42:46][24317.134533120][-main-] Notice: nsmain: max files: FD_SETSIZE = 1024, rl_cur = 1024, rl_max = 0
[07/Dec/2003:19:42:46][24317.134533120][-main-] Error: pidfile: failed to open pid file '/usr/local/aolserver/log/nspid.service0': 'Permission denied'
[07/Dec/2003:19:42:46][24317.134533120][-main-] Notice: adp[service0]: mapped /*.adp
[07/Dec/2003:19:42:46][24317.134533120][-main-] Notice: modload: loading '/usr/local/aolserver/bin/nssock.so'
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: modload: loading '/usr/local/aolserver/bin/nslog.so'
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: nslog: opened '/web/service0/log/service0.log'
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: modload: loading '/usr/local/aolserver/bin/nssha1.so'
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: modload: loading '/usr/local/aolserver/bin/nscache.so'
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: nscache module version @VER@
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: modload: loading '/usr/local/aolserver/bin/nsrewrite.so'
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: modload: loading '/usr/local/aolserver/bin/nsxml.so'
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: nsxml module starting
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: conf: [ns/server/service0]enabletclpages = 0
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: Loading OpenACS, rooted at /web/service0
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: Sourcing /web/service0/packages/acs-bootstrap-installer/bootstrap.tcl
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: Bootstrap: sourcing /web/service0/packages/acs-bootstrap-installer/tcl/00-proc-procs.tcl
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: Bootstrap: sourcing /web/service0/packages/acs-bootstrap-installer/tcl/10-utilities-procs.tcl
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: Bootstrap: sourcing /web/service0/packages/acs-bootstrap-installer/tcl/20-db-bootstrap-procs.tcl
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: Bootstrap: sourcing /web/service0/packages/acs-bootstrap-installer/tcl/30-apm-load-procs.tcl
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: Bootstrap: sourcing /web/service0/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tc
l
[07/Dec/2003:19:42:47][24317.134533120][-main-] Error: Server startup failed: Error during bootstrapping
invalid command name "ns_db"
    while executing
"ns_db pools"
    (procedure "db_bootstrap_set_db_type" line 72)
    invoked from within
"db_bootstrap_set_db_type database_problem"
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: Sourcing files for postload...
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: Done.
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: Executing initialization code blocks...
[07/Dec/2003:19:42:47][24317.134533120][-main-] Error: Error parsing queryfile /web/service0/www/index-oracle.xql:

invalid command name "xml_parse"
[07/Dec/2003:19:42:47][24317.134533120][-main-] Error: Error parsing queryfile /web/service0/www/index-postgresql.xql:

invalid command name "xml_parse"
[07/Dec/2003:19:42:47][24317.134533120][-main-] Error: Error parsing queryfile /web/service0/www/index.xql:

invalid command name "xml_parse"
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: nsmain: AOLserver/4.0 running
[07/Dec/2003:19:42:47][24317.134533120][-main-] Notice: nsmain: security info: uid=1002, euid=1002, gid=71, egid=71
============================================================

i think there are some problems with database driver and
xml parser (but my database driver and xml_parser was no problem with aolserver 3.4.2) but i can't find solution
plz help me. thx for reading 😊

The most interesting part of your config file is missing ;).

If you want to use AOLserver4 you need to add "ns_param nsdb ${bindir}/nsdb.so" to your modules section. In the config file it should actually say something like "you need this for AOLserver4".

I'm having a terrible time setting up virtual hosting using aolserver 4.  The error messages I've gotten include the bootstrapping and "invalid command name "ns_db" noted above.  I've added module Malte recommends.  Now I wonder if the problem might lie with the "nsrewrite.so" that I did not download (following Malte's current aolserver instructions on the openacs site) and so did not install (and when I found a post that says it was not needed I skipped it). But maybe that is the problem?  Also, I have followed Vinod's Virtual Hosting article, but I'd feel much better if I could see exactly what people have done for their frontend and backend files.  Anyone familiar with setting up virtual hosting on aolserver 4 who has seen this happen?  Thanks!

Bruce

Bruce,

did you include nsdb.so in your modules section of the config file? Like so:

ns_section ns/server/${server}/modules
    ns_param nsdb nsdb.so

AOLserver 4.x requires this module where as 3.x doesn't.

/Bart

Dear Bart:

MANY thanks for the tip, which I put to use: I'd put      "ns_param  nsdb              ${bindir}/nsdb.so"
in the wrong place, so now the program finds the database and runs with it, loading lots of openacs and dotlrn but with hundreds of queries and a final, concluding flurry of error messages.  So, we're making progress.

I'm hoping I might ask you and others for a quick review of these errors and my code as my partner and I are near our wits end.  I'll first list the errors, then the frontend.tcl and backend.tcl codes.  Many thanks for any advice you might offer!

Bruce

========================================
1) Errors.

Error: Error sourcing /var/lib/aolserver/service3400/packages/  notifications/tcl/reply-sweep-init.tcl: invalid command name "ns_cache"
Error: Error sourcing /var/lib/aolserver/service3400/packages/acs-templating/tcl/template-init.tcl: invalid command name "ns_cache" Debug: PLPGSQL: bypassed anon function
Error: duplicate server: service3400
Error: server: duplicate host mapping: happy.zedat.fu-berlin.de
Error: server: duplicate host mapping: happy.zedat.fu-berlin.de:80
Error: nslog: mkdir(/usr/local/aolserver40r2/modules/nslog) failed: Permission denied
Error: modload: init /usr/local/aolserver40r2/bin/nslog.so of Ns_ModuleInit returned: -1
Fatal: modload: failed to load module '/usr/local/aolserver40r2/bin/nslog.so'
Error: Error sourcing /var/lib/aolserver/service3400/packages/notifications/tcl/reply-sweep-init.tcl: invalid command name "ns_cache" while executing "ns_cache get util_memoize $script pair"
[plus: a thousand queries: Notice: Querying 'select apm_package__num_instances(...

2) frontend.tcl
#frontend.tcl
ns_log notice "reading front end"

set debug true
set homedir                /usr/local/aolserver40r2
set bindir                ${homedir}/bin
set serverdesc  "skidoo"

# Load nssock globally
ns_section ns/modules
  ns_param nssock /usr/local/aolserver40r2/bin/nssock.so
  ns_param  nssock            ${bindir}/nssock.so
  ns_param  nslog              ${bindir}/nslog.so
  ns_param  nssha1            ${bindir}/nssha1.so
  ns_param  nscache            ${bindir}/nscache.so
  ns_param  nsdb              ${bindir}/nsdb.so
  #ns_param  nsrewrite          ${bindir}/nsrewrite.so

ns_section ns/module/nssock
    ns_param  port            80
    ns_param  hostname        skidoo.zedat.fu-berlin.de
    ns_param  address        0.0.0.0

# Map headers to server-name
ns_section ns/module/nssock/servers
    ns_param  service3400    happy.zedat.fu-berlin.de
    ns_param  service3400    happy.zedat.fu-berlin.de:80
#    ns_param  backend2        backend2.com
#    ns_param  backend2        backend2.com:80
#    ns_param  backend2        myotherdomain.com
#    ns_param  backend2        myotherdomain.com:80

ns_section ns/servers
  ns_param  service3400        "My First Example Site"
#  ns_param  backend2        "My Second Example Site"

# global parameters
ns_section ns/parameters
  ns_param  serverlog          /usr/local/aolserver40r2/log/error.log
  ns_param  home              $homedir
  ns_param  maxkeepalive      0
  ns_param  logroll            on
  ns_param  maxbackup          5
  ns_param  debug              $debug

# Thread library (nsthread) parameters
ns_section ns/threads
  ns_param  mutexmeter        true
  ns_param  stacksize          [expr 128 * 8192]
# MIME types.
ns_section ns/mimetypes
  ns_param  Default            text/plain
  ns_param  NoExtension        text/plain
  ns_param  .pcd              image/x-photo-cd
  ns_param  .prc              application/x-pilot
  ns_param  .xls              application/vnd.ms-excel
  ns_param  .doc              application/vnd.ms-word

source /var/lib/aolserver/service3400/etc/config.tcl

ns_log notice "nsd.tcl: finished reading frontend config file."

3) The backend.tcl

#backend 3400

#set address                  0.0.0.0
#set httpport                3400
#set httpsport                143

set bindir                    /usr/local/aolserver40r2/bin
set server                    "service3400"
set servername                ${server}
set serverroot                /var/lib/aolserver/${server}

set hostname                  skidoo
set database                  postgres
set db_name                  $server
set db_host                  localhost
set db_port                  ""
set db_user                  $server

ns_section "ns/server/${servername}/modules"
    ns_param nsdb ${bindir}/nsdb.so

set pageroot                  ${serverroot}/www
set directoryfile            index.tcl,index.adp,index.html,index.htm

# Tcl Configuration
ns_section ns/server/${server}/tcl
  ns_param  library            ${serverroot}/tcl
  ns_param  autoclose          on
  ns_param  debug              $debug

ns_section ns/servers
  ns_param  $server            $servername

# Server parameters
ns_section ns/server/${server}
  ns_param  directoryfile      $directoryfile
  ns_param  pageroot          $pageroot
  ns_param  maxconnections    5
  ns_param  maxdropped        0
  ns_param  maxthreads        5
  ns_param  minthreads        5
  ns_param  threadtimeout      120
  ns_param  globalstats        false    ;# Enable built-in statistics
  ns_param  urlstats          false    ;# Enable URL statistics
  ns_param  maxurlstats        1000    ;# Max number of URL's to do stats on
  #ns_param  directoryadp      $pageroot/dirlist.adp ;# Choose one or the other
  #ns_param  directoryproc      _ns_dirlist          ;#  ...but not both!
  #ns_param  directorylisting  fancy              ;# Can be simple or fancy

# Special HTTP pages
  ns_param  NotFoundResponse  "/global/file-not-found.html"
  ns_param  ServerBusyResponse "/global/busy.html"
  ns_param  ServerInternalErrorResponse "/global/error.html"

# ADP (AOLserver Dynamic Page) configuration
ns_section ns/server/${server}/adp
  ns_param  map                /*.adp    ;# Extensions to parse as ADP's
  #ns_param  map                "/*.html" ;# Any extension can be mapped
  ns_param  enableexpire      false    ;# Set "Expires: now" on all ADP's
  ns_param  enabledebug        $debug    ;# Allow Tclpro debugging with "?debug"
  ns_param  defaultparser      fancy
  ns_section ns/server/${server}/adp/parsers
  ns_param  fancy    ".adp"

# Database drivers
ns_section "ns/db/drivers"
  ns_param  postgres      ${bindir}/nspostgres.so

# Database Pools: This is how AOLserver  ``talks'' to the RDBMS. You need
ns_section ns/db/pools
    ns_param  ${server}pool1          "$server Pool 1"
    ns_param  ${server}pool2          "$server Pool 2"
    ns_param  ${server}pool3          "$server Pool 3"

ns_section ns/db/pool/${server}pool1
  ns_param  maxidle            1000000000
  ns_param  maxopen            1000000000
  ns_param  connections        5
  ns_param  verbose            $debug
  ns_param  extendedtableinfo  true
  ns_param  logsqlerrors      $debug
if { $database == "oracle" } {
    ns_param  driver            ora8
    ns_param  datasource        {}
    ns_param  user              $db_name
    ns_param  password          $db_password
} else {
    ns_param  driver            postgres
    ns_param  datasource        ${db_host}:${db_port}:${db_name}
    ns_param  user              $db_user
    ns_param  password          ""
}

ns_section ns/db/pool/${server}pool2
  ns_param  maxidle            1000000000
  ns_param  maxopen            1000000000
  ns_param  connections        5
  ns_param  verbose            $debug
  ns_param  extendedtableinfo  true
  ns_param  logsqlerrors      $debug
if { $database == "oracle" } {
    ns_param  driver            ora8
    ns_param  datasource        {}
    ns_param  user              $db_name
    ns_param  password          $db_password
} else {
    ns_param  driver            postgres
    ns_param  datasource        ${db_host}:${db_port}:${db_name}
    ns_param  user              $db_user
    ns_param  password          ""
}

ns_section ns/db/pool/${server}pool3
  ns_param  maxidle            1000000000
  ns_param  maxopen            1000000000
  ns_param  connections        5
  ns_param  verbose            $debug
  ns_param  extendedtableinfo  true
  ns_param  logsqlerrors      $debug
if { $database == "oracle" } {
    ns_param  driver            ora8
    ns_param  datasource        {}
    ns_param  user              $db_name
    ns_param  password          $db_password
} else {
    ns_param  driver            postgres
    ns_param  datasource        ${db_host}:${db_port}:${db_name}
    ns_param  user              $db_user
    ns_param  password          ""
}

ns_section ns/server/${server}/db
  ns_param  pools              "${server}pool1,${server}pool2,${server}pool3"
  ns_param  defaultpool        ${server}pool1

ns_section ns/server/${server}/redirects
  ns_param  404                "global/file-not-found.html"
  ns_param  403                "global/forbidden.html"

# Access log -- nslog
ns_section ns/server/${server}/module/nslog
  ns_param  debug              false
  ns_param  dev                false
  ns_param  enablehostnamelookup false
  ns_param  file              ${serverroot}/log/${server}.log
  ns_param  logcombined        true
  ns_param  extendedheaders    COOKIE
  #ns_param  logrefer          false
  #ns_param  loguseragent      false
  ns_param  maxbackup          1000
  ns_param  rollday            *
  ns_param  rollfmt            %Y-%m-%d-%H:%M
  ns_param  rollhour          0
  ns_param  rollonsignal      true
  ns_param  rolllog            true

# nsjava - aolserver
ns_section ns/server/${server}/module/nsjava
  ns_param  enablejava        off  ;# Set to on to enable nsjava.
  ns_param  verbosejvm        off  ;# Same as command line -debug.
  ns_param  loglevel          Notice
  ns_param  destroyjvm        off  ;# Destroy jvm on shutdown.
  ns_param  disablejitcompiler off
  ns_param  classpath          /usr/local/jdk/jdk118_v1/lib/classes.zip:${bindir}/nsjava.jar:${pageroot}/webmail/java/activation.jar:${pageroot}/webmail/java/mail.jar:${pageroot}/webmail/java

# PAM authentication
ns_section ns/server/${server}/module/nspam
  ns_param  PamDomain          "pam_domain"

ns_log notice "nsd.tcl: finished reading service3400 config file."

I believe you need to explicitly load ns_cache for each virtual server, too, just like ns_db but don't have my virtual server example handy (I'm sitting in a library in rural New Mexico checking on stuff 'cause it's raining outside).
Thanks Don!  That good advice helped!  Bruce