AOLserver Control Port Guide

$Header: /cvsroot/aolserver/aolserver.com/docs/admin/nscp.html,v 1.2 2002/09/26 19:51:32 kriston Exp $

Introduction

AOLserver includes a control port interface that can be enabled with the nscp module. This control port interface allows you to telnet to a specified host and port where you can administer the server and execute database commands while the server is running.

The control port interface is a Tcl interface. Within it, you can execute any Tcl command that Tcl libraries and ADP can; the only exceptions being the ns_conn commands.

To administer a server with the control port interface while it is running, the nscp module must be loaded into the server. To set permissions for the server, the nsperm module must also be loaded. To execute database commands while the server is running, you must also configure database services for the server, including database drivers and pools.

Configuring the Control Port Interface

An example configuration for the control port interface is shown below. Three sections of the configuration file are included. The nscp module is loaded into the /modules section for servername. The /module/nscp section defines the control port parameters, and the /module/nscp/users section defines the users who can log into the control port.

#
# Control port -- nscp
#
ns_section "ns/server/${servername}/module/nscp"
ns_param   port            9999        ;# Control port listens on port 9999
ns_param   address         "127.0.0.1" ;# For security, use 127.0.0.1 only

# Control port users
ns_section "ns/server/${servername}/module/nscp/users"
# The default password for nsadmin is "x". You should change it.
# type "ns_crypt newpassword salt" and put the encrypted string below.
ns_param user "nsadmin:t2GqvvaiIUbF2:" ;# sample user="nsadmin", pw="x".

ns_section "ns/server/${servername}/modules"
# ...
ns_param   nscp               nscp.so

Some things to notice about the configuration are:


* The port parameter defines the port that the interface will listen on. The default is 9999.
* The address parameter defines the hostname to bind to. The default is 127.0.0.1 so that you can only connect to the control port if you are already logged on to the computer where the server is running.
* The user parameter defines users who can log into the control port. There are three semicolon-separated fields. The first is username (nsadmin); the second is a Unix-like password hash. You can create a password by typing "ns_crypt mypasswd salt". As with Unix, only the first four characters are used.

See the Configuration Reference for complete information on configuration.

Using the Control Port Interface

To use the control port interface, follow these steps:

1. Telnet to the address and port number defined in the /module/nscp section for the server. For example:

telnet localhost 9999

The session responds with:

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
login: 

2. At the login prompt, type a valid username. The username must be one of the usernames defined in the /module/nscp/users section of the configuration file. For example:

login: nsadmin
The session responds with:
password:

3. At the password prompt, type the password associated with the username you specified. The default is "x".

The session responds with:

Welcome to servername running at /usr/local/aolserver/bin/nsd (pid 22413)
AOLserver/3.4.2 (nsd_v3_r4_p2) for solaris built on Sep 18 2001 at 16:59:11
CVS Tag: $Name:  $

servername:nscp 1> 

4. At the prompt you can type nearly any Tcl command available to AOLserver Tcl libraries and ADPs.

5. When you're done, just type "exit" and you will be logged off.

Useful Commands

Type "lsort [info commands]" for a complete list of commands available to you. You can type nearly any Tcl command available to AOlserver Tcl libraries and ADPs. This includes the complete Tcl core and nearly any ns_* command. Type "lsort [info commands ns*]" for a sorted list of AOLserver Tcl commands.

Useful commands:

* ns_shutdown -- Shuts down the server.
* ns_info uptime -- How long the server has been running.
* exit -- Exit the control port.