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:"
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"
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.
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.
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".
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.
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.
% insmod dummy.o
% ifconfig dummy different_IP
% route add different_IP dev dummy
arp -t ether -s different_IP your_ethernet_number pub"
different_IP
must be on the same subnet as your primary_IP
)
% ifconfig