default
and other
. A few things to note about this configuration file are:
Modules for each server: The default
server contains several modules (nssock, nstext, nslog, and nsperm), while the other
server contains only nssock. The other
server has no defined database pools. It therefore cannot contain the nstext module, because the nstext module (which performs full-text capabilities such as AutoLinking, indexing, and archiving) requires an Illustra database pool. (See the [ns/server/server-name/modules] sections.)
CGI configuration for the default server: The CGI capability in the default server includes two maps: one for the GET method to scripts which end in .cgi and are located in the pages directory, and the other for the POST method which maps URLs which begin with /cgi to scripts in the /usr/local/cgi directory. In addition, the "myinterps" Interps section is defined so that before CGI programs are executed the AOLserver will check for a cooresponding interpreter program. In this case, any script which ends in .pl will be interpreted by the /usr/local/bin/perl program. Finally, the .pl interpreter map specifies the name of an environment section, perlEnv. Before invoking /usr/local/bin/perl, the AOLserver will set the PERLLIB and DATA environment variables in addition to the standard CGI environment variables.
Pages directories for each server: The pages for each server are stored in different directories. The pages for the default
server are stored in the /servers/default/pages
directory under the home directory, and the pages for the other
server are stored in the /servers/other/pages
directory under the home directory.
Each virtual server will not be able to access pages stored by the other server. (See the pageroot
parameters in the [ns/server/server-name] sections.)
Separate ports for each server: The two virtual servers are differentiated by port number. The default server uses port 8000, and the other server uses port 8001. (See the port
parameter in the [ns/server/server-name/modules/nssock] sections).
Alternatively, you can differentiate the servers by IP address with the address
parameter. To use different IP addresses on the same host, you must have either additional physical network cards installed on your system, or support from the operating system to provide IP address aliases for a single physical interface.
[ns/parameters] home=/home/mary/ns [ns/servers] default=The Default Server other=The Other Server [ns/server/default] directoryfile=index.htm verbose=y pageroot=/servers/default/pages [ns/server/default/modules] nssock=nssock.so nstext=nstext.so nslog=nslog.so nsperm=nsperm.so [ns/server/default/module/nssock] port=8000 [ns/server/default/module/nstext] dbpool=defdb index=y archive=y searchable=y [ns/server/default/module/nslog] maxsizekb=100 maxbackup=5 [ns/server/default/module/nsperm] model=small [ns/server/default/db] pools=* ; Configure CGI to execute .cgi scripts in the pages ; directory with the GET method and to execute scripts ; in the /usr/local/cgi directory with the POST method. [ns/server/default/cgi] map=GET /*.cgi map=POST /cgi /usr/local/cgi interps=myinterps ; CGI scripts which end in .pl will be executed by perl. [ns/interps/myinterps] .pl=/usr/local/bin/perl(perlEnv) ; Before perl is invoked, set the PERLLIB and DATA environment ; variables. [ns/environment/perlEnv] PERLLIB=/usr/local/lib/perl DATA=/usr/local/data [ns/server/other] directoryfile=index.htm minthreads=1 maxthreads=1 pageroot=/servers/other/pages [ns/server/other/modules] sock=nssock.so [ns/server/other/module/nssock] port=8001 [ns/db/drivers] illustra=nsill.so [ns/db/driver/illustra] ;miparams= [ns/db/pools] defdb=The Default Database Pool ; Define the defdb pool which connects to the nsdb ; Text Datablade database on the default Illustra server. [ns/db/pool/defdb] driver=illustra connections=2 datasource=default:nsdb user=nsadmin
default
and two database pools named defdb
and otherdb
. A few things to note about this configuration file are:
Illustra and ODBC database pools: The defdb
database pool is associated with an Illustra database, and the otherdb
database pool is associated with an ODBC database. (See the driver
parameters in the [ns/db/pool/pool-name] sections.)
Illustra and ODBC drivers: The drivers used for all of the defined database pools are listed in the [ns/db/drivers] section. There is one configuration parameter for the Illustra driver (in the [ns/db/driver/illustra] section, but there are no configuration parameters for an ODBC driver.
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.
Database pool for the nstext module: The nstext module must access an Illustra database pool. In this example, the dbpool
parameter in the [ns/server/default/module/nstext] section specifies the defdb
database pool, which is an Illustra database pool.
[ns/parameters] home=/home/mary/ns [ns/servers] default=The Default Server [ns/server/default] directoryfile=index.htm verbose=y pageroot=/servers/default/pages [ns/server/default/modules] nssock=nssock.so nstext=nstext.so nslog=nslog.so nsperm=nsperm.so [ns/server/default/module/nssock] port=8000 [ns/server/default/module/nstext] dbpool=defdb index=y archive=y searchable=y [ns/server/default/module/nslog] maxsizekb=100 maxbackup=5 [ns/server/default/module/nsperm] model=small [ns/server/default/db] pools=* [ns/db/drivers] illustra=nsill.so odbc=nsodbc.so [ns/db/pools] defdb=The Default Database Pool otherdb=The Other Database Pool [ns/db/pool/defdb] driver=illustra connections=2 datasource=default:nsdb user=nsadmin ; Define the otherdb database pool which connects to the ; Microsoft SQL Server pubs database which is a system ; datasource in the 32-bit ODBC Administrator. [ns/db/pool/otherdb] driver=odbc connections=4 datasource=pubs