[ Previous ] [ Contents ] [ Index ] [ Next ]

Example Configuration Files

Default Configuration File

The default nsd.tcl file is shown below. There is one server defined, server1, which contains the nscp, nslog, and nssock modules. You can define multiple servers, but only one of them can be run with each command line execution. See page 5 for more information on the AOLserver command line.

    ns_section "ns/parameters"
    ns_param debug        on
    ns_param User         [exec whoami]
    ns_param Home         [exec pwd]
    
    ns_section "ns/servers"
    ns_param server1      "Server One"
    
    ns_section "ns/server/server1"
    ns_param DirectoryFile index.html
    
    ns_section "ns/server/server1/adp"
    ns_param Map          /*.adp
    ns_param fancy        on
    
    
    ns_section "ns/server/server1/modules"
    ns_param nssock       nssock.so
    ns_param nscp         nscp.so
    ns_param nslog        nslog.so
    
    ns_section "ns/server/server1/module/nssock"
    ns_param Port         80
    ns_param Hostname     [exec hostname]
    
    ns_section "ns/server/server1/module/nscp/users"
    # password=x
    ns_param user "nsadmin:t2GqvvaiIUbF2:"

Configuration for Multiple Database Pools

This configuration file defines one server named default and two database pools named defdb and otherdb. A few things to note about this configuration file are:

SOLID and Postgres database pools: The defdb database pool is associated with an SOLID database, and the otherdb database pool is associated with a Postgres database. (See the driver parameters in the ns/db/pool/pool-name sections.)

SOLID and Postgres drivers: The drivers used for all of the defined database pools are listed in the ns/db/drivers section.

Database pools accessible by each server: The pools parameter in the ns/server/default/db section specifies which database pool the default server has access to. In this example, the default server can access both the otherdb and the defdb database pools.

    ns_section "ns/parameters"
    ns_param home /home/mary/ns
    
    ns_section "ns/servers"
    ns_param default "The Default Server"
    
    ns_section "ns/server/default"
    ns_param directoryfile index.htm
    ns_param verbose y
    ns_param pageroot /servers/default/pages
    
    ns_section "ns/server/default/modules"
    ns_param nssock nssock.so
    ns_param nslog nslog.so
    ns_param nsperm nsperm.so
    
    ns_section "ns/server/default/module/nssock"
    ns_param port 8000
    
    ns_section "ns/server/default/module/nslog"
    ns_param maxsizekb 100
    ns_param maxbackup 5
    
    ns_section "ns/server/default/module/nsperm"
    ns_param model small
    
    ns_section "ns/server/default/db"
    ns_param pools *
    
    ns_section "ns/db/drivers"
    ns_param postgres nspostgres.so
    ns_param solid nssolid.so
    
    ns_section "ns/db/pools"
    ns_param defdb "The Default Database Pool"
    ns_param otherdb "The Other Database Pool"
    
    ns_section "ns/db/pool/defdb"
    ns_param driver postgres
    ns_param connections 2
    ns_param datasource host:port:database
    
    ns_section "ns/db/pool/otherdb"
    ns_param driver solid
    ns_param connections 4
    ns_param datasource "TCP/IP hostname 1313"

Configuration for Multiple IP Addresses

This section describes how to get your computer to listen to multiple IP addresses at the same time, which you will need to do if you plan to run several servers and want them all to listen on port 80. The instructions vary by operating system.

Solaris 2.5:

The Solaris operating system already has the necessary functionality to support multiple IP addresses on a single interface. Note that it is not supported by Sun, and not mentioned in the man pages. Here is the description from Casper Dik's FAQ for Solaris 2:

4.11) How can I have multiple addresses per interface?

Solaris 2.5 provides an undocumented feature in ifconfig that allows having more than one IP address per interfaces.

Syntax:

    ifconfig IF:N ip-address up

where "IF" is an interface (e.g., le0) and N is a number between 1 and 255. Removing the pseudo interface and associated address is done with "ifconfig IF:N 0.0.0.0 down".

DEC OSF/1 (aka Digital Unix):

The Digital Unix operating system already has the necessary functionality to support multiple IP addresses on a single interface. You can use the ifconfig command to create as many aliases as needed with following syntax:

    ifconfig interface alias address [netmask mask]

This command is well documented in the Digital Unix man pages.

HP-UX 10.x:

The HP-UX 10.x operating system already has the necessary support for multiple IP addresses per interface. If you want a solution supported by HP, you need to buy the ServiceGuard product. If you just want the functionality, a small program from Julian Perry will do the job. See the http://www.limitless.co.uk/hp_ifalias.html web site for detailed information.

Linux:

  1. Load dummy device (if you do not have it compiled in):

        % insmod dummy.o
    

  2. Configure the dummy device:

        % ifconfig dummy different_IP
    

    (or dummy0 etc. if using insmod)

  3. Add an entry to your routing table:

        % route add different_IP dev dummy
    

  4. Set up a proxy ARP entry:

        arp -t ether -s different_IP your_ethernet_number pub"
    

    (Note that different_IP must be on the same subnet as your primary_IP)

    You can determine your_ethernet_number just by typing

        % ifconfig
    

Top of Page

[ Previous ] [ Contents ] [ Index ] [ Next ]
Copyright © 1998-99 America Online, Inc.