Starting off with Web Server 7.0 CLI
One of the salient features of Web Server 7.0 is the presence of a Command Line Interface called wadm for performing administrative tasks. wadm can run in 3 modes:
- Single mode where you type the whole command with options like
how you would use any other command.
- Shell mode which takes you to an embedded JACL shell. This mode can be used to utilize JACL features that can be used for scripting purposes.
- File mode where you can store all the commands into a file and input it to wadm.
This blog will take you through the steps to use some of the simple features of running wadm in shell mode to perform various tasks.
-
Invoke the CLI, this will display the usage.
-bash-3.00$ wadm
Usage: wadm [--user=admin-user] [--password-file=admin-pswd-file] [--host=admin-host] [--port=admin-port] [--no-ssl] [--rcfile=rcfile] [--no-prompt] [--help] [--commands-file=filename]
CLI014 user is a required option. -
To connect to the Administration Server, run
-bash-3.00$ wadm –user=admin –host=abc.sun.com –port=2222 –no-ssl
Please enter admin-user-password>
Sun Java System Web Server 7.0 B05/12/2006 09:47
wadm>
-
You can store the password into a plain text file and then pass this file to wadm to avoid typing the password each time
-bash-3.00$ echo “wadm_password=secret” >admin.pwd
-bash-3.00$ wadm –user=admin –password-file=./admin.pwd
Sun Java System Web Server 7.0 B05/12/2006 09:47
wadm>
-
One of the cool features of the CLI is that the wadm command options and their values can be stored into a default file called .wadmrc in the user home directory. Or you can choose to pass the path to this startup file and pass it to wadm. This will avoid typing all the options each time.
-bash-3.00$ wadm --user=admin --rcfile=./rcfile
Please enter admin-user-password>
Sun Java System Web Server 7.0 B05/12/2006 09:47
wadm>
-
You can set a variety of options in the .wadmrc file. You would just need to prefix wadm_ to the option name and store it in this file. Suppose you need the CLI to be more verbose set the wadm_verbose to true. Or if you are interested in looking at the complete command that goes to the administration server, set wadm_echo to true. To enable JACL set wadm_script to true.
The startup file contents would look like this:
|
set wadm_user admin |
-
To list all the variables in shell, run
wadm> info vars
wadm_echo argv wadm_histfile auto_execs auto_index errorInfo wadm_user wadm_ssl auto_oldpath wadm_script tcl_library errorCode wadm_verbose wadm_password argc wadm_port wadm_savehist wadm_mode tcl_patchLevel wadm_host tcljava tcl_platform env tcl_version tcl_interactive wadm_prompt argv0 auto_path
wadm>
-
To get Tcl and Jacl versions, do
wadm> echo $tcl_version
8.0
wadm> package require java
1.3.2
wadm>
-
In shell mode wadm also supports command completion using the tab key, command history and command editing.
|
wadm> list- |
The quickest way to get more info on any command are the man pages. Use wadm --help to get a list of commands.