NaviServer Control Port Guide - NaviServer Control Port Guide
TABLE OF CONTENTS
DESCRIPTION
Introduction
Configuring the Control Port Interface
Using the Control Port Interface
Useful Commands
NaviServer 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.
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:
See the Configuration Reference for complete information on configuration.
To use the control port interface, follow these steps:
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
login:
|
login: nsadmin
|
password:
|
Welcome to servername running at /usr/local/ns/bin/nsd (pid 22413)
NaviServer/4.99.2 for linux built on Sep 7 2006 at 20:38:59
CVS Tag: $Name: $
servername:nscp 1>
|
Type "lsort [info commands]" for a complete list of commands available to you. You can type nearly any Tcl command available to NaviServer 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 NaviServer Tcl commands.
Useful commands: