Sun Microsystems Logo



Sun Java System Web Server
Administration CLI Sample Scripts
This directory contains scripts that one can run using the wadm command line utility. The utility can be found at <install-root>/bin/wadm. wadm is built on a Tcl engine and hence supports Tcl scripting. Some of these samples demonstrate how scripts can be used to perform common administrative tasks. They also demonstrate how new utilities can be built on top of existing commands.

Scripts

enable-ssl.tcl

Enables SSL on a given Virtual Server and port.
Usage: wadm -f enable-ssl.tcl <config> <vs> <server> <port>

filter-mime.tcl

Fetches the matching mime types from the given Configuration and Virtual Server.
Usage: wadm -f filter-mime.tcl "<regex>" <config> <vs>

remove-mime.tcl

Removes the matching mime types from the given Configuration and Virtual Server.
Usage: wadm -f remove-mime.tcl "<regex>" <config> <vs>

add-mime-ext.tcl

Add the specified extension to the matching mime types in given Configuration and Virtual Server.
Usage: wadm -f add-mime-ext.tcl "<regex>" "ext" <config> <vs>

summary.tcl

Provides a summary of the installation. It contains list of listeners, port, SSL status, bound vs.
Usage: wadm -f summary.tcl

list-webapps.tcl

Provides a summary of all the deployed webapps.
Usage: wadm -f list-webapps.tcl

collate-logs.tcl

Provides a collated logs across multiple nodes.
Usage: wadm -f collate-logs.tcl <config> <node1> <node2> ..

renew-selfsigned-cert.tcl

Allows renewal of self signed certificates with a given nickname.
Usage: wadm -f renew-selfsigned-cert.tcl <config> <cert-nickname> [<validity>]

Utilities

To be used from within wadm> prompt
Usage:
wadm>source utils.tcl
wadm>source date.tcl
wadm><proc> <arg1> <arg2>

append-to-classpath <config> <path>
Appends a given path to the server class path for the given config.

trim-last-classpath <config>
Removes the last class path element from the server class path.

list-ssl-listeners <config>
Listing SSL enabled listeners for the given config.

certs-expiry-time <config>
Outputs the number of days before the certs expire.

restart-instances <node>
Restarts all instances on a given node.

create-secure-server <config> <server> <instance> <port> <nick>
Create an SSL enabled server and start it.

Wizards

share-dav.tcl

Sharing multiple dav collections for a list of users.
Usage: wadm -f share-dav.tcl

Debugging

debug.tcl

Allows debugging of the wadm script files.
Usage:
wadm -f debug.tcl -x myfile.tcl arg1 arg2
wadm -f debug.tcl myfile.tcl arg1 arg2