This section describes the Command Line Interface for Web Server and defines all the commands that are supported for configuring and administering the server.
Web Server has introduced a new CLI called wadm.
The earlier version of the Server supported a few discrete command
lines, which together addressed only a subset of whole administration functionality
provided in the GUI. The
command line interfaces supported in Web Server 6.1 were HttpServerAdmin
, wdeploy
and flexanlg
. The new CLI (wadm) features include:
Embedded JACL shell for scripting.
Extensible CLI — more commands can be added to the CLI by third party plug-ins.
Web Server does not support HttpServerAdmin
.
wdeploy is supported in Web Server only for backward compatibility with 6.x versions and will work only on the Administration Server node.
wadm
supports invocation in the following three modes. They
are:
Standalone mode —
In this mode, you invoke wadm
from a command shell,
specifying the desired command, options and operands. When the command finishes
execution, CLI exits back to the shell. This mode can support both interactive
and non-interactive execution of commands. Interactive execution, which is
the default, will prompt you for the password if the password is not already specified in
the password file and
if it has not already passed through the --password-file option. Non-interactive execution will result in an error if the --password-file
option is not specified.
For example,
Non-interactive Standalone mode
bash-3.00# cat /passwd wadm_password=mypassword bash-3.00# /opt/sun7ur2websvr/bin/wadm list-configs --user=admin --port=8800 --no-ssl --password-file=/passwd instance1 |
Interactive Standalone mode
bash-3.00# /opt/sun7ur2websvr/bin/wadm list-configs --user=admin --port=8800 --no-ssl Please enter admin-user-password> instance1 |
Shell Mode — In this
mode, you invoke wadm
from a command shell with no
command. wadm
prompts the user for a command. After
the command is executed, it will return back to the shell. This shell can
be exited by typing exit or quit command. Interactive and non-interactive
executions are applicable to this mode. For example,
bash-3.00# /opt/sun7ur2websvr/bin/wadm --user=admin --port=8800 --host=serverhost --no-ssl Please enter admin-user-password> Connected to serverhost:8800 Sun Java System Web Server 7.0U2 B12/09/2007 07:28 wadm> list-configs instance1 wadm> list-jvm-options --config=instance1 -Djava.security.auth.login.config=login.conf -Xms128m -Xmx256m wadm> list-instances --config=instance1 sunhost1.sun.com wadm> quit bash# |
File Mode — In this
mode, you can add a list of commands in a file and pass the file as an argument
to wadm
. For example,
wadm -user=admin -host=serverhost --password-file=admin.pwd --port=8989 -commands-file=/space/scripts/admscr |
The following figure depicts the syntax for invoking wadm commands.
With the wadm CLI, you can perform all of the same tasks as the Administration Console.
Where can I find the CLI for Web Server administration?
Answer:The administration CLI is located at install-root/bin/wadm
. To use the CLI, you need to know:
Administration server hostname (default is localhost
).
SSL port for the administration server (default is 8989).
Administration server user name (default is admin
).
Administration server password.
The Administration server needs to be running in order to use the CLI.
You can start the server by running install-root/admin-server/bin/startserv
.
wadm will use the username and password of the administrator to authenticate the Administration Server. A valid username and password file must be passed as arguments to each command running in single mode. The shell mode accepts the username and password file when the wadm executable is invoked. Commands invoked in the shell mode do not require the connection options (for example, user, password-file, host, port and ssl). If connection options are specified, they will be ignored.
Some commands supported by the CLI require password inputs. For example, bindpw, user-password and token-pin. The user can specify these passwords in the same file that contains the administration user password. If the password-file is not specified with the command, then user will be prompted for the password.
The wadm communicates with the Administration Server through SSL if SSL is enabled on Administration Server. The Certificate passed by the Administration Server will be verified against the truststore (~/.wadmtruststore). If the certificate exists and is valid, the command proceeds normally. Otherwise, wadm displays the certificate and gives the user the choice of accepting it. If the user accepts it, the certificate will be added to the truststore and the command will proceed normally.
truststore need not be password protected since it does not contain any sensitive data.
Open a command prompt terminal and navigate to install-root/bin/wadm directory and type the following command to reset the password:
./wadm reset-admin-password.
You will be prompted to type the new admin password. Type the password again to confirm. Restart the server in order for the password to take effect. Then use the new password to login to the server.
While changing the password using set-admin-prop command you must restart the Administration Server from install-root/admin-server/bin/restart directory. Do not use restart-admin command to restart the server.
You can use the Admin Console to register the Web Server with Sun Connection. Click the Register with Sun Connection tab from the home page, and a wizard opens up. Follow the wizard to complete the registration. By registering the Web Server with Sun Connection you receive the following benefits.
Patch information and bug updates
News and events
Support and training offerings