About this task
The
wlp/bin directory
contains a script called
server to
help with controlling the server process. The syntax of this script
is as follows:
server <action> [server] [options]
For
available values of the options, see Liberty profile: server command options.
This script supports
the following actions:
- create
- A command that creates
a new server.
- run
- A command that launches the server in the foreground.
- debug
- A command that runs the named server in the console foreground
after a debugger connects to the debug port. The default port is 7777. You can use the WLP_DEBUG_ADDRESS variable
to specify an alternative port.
- dump
- A command that creates a snapshot of a server and saves the result into
an archive file for further tuning and diagnosis.
- javadump
- A command that creates a snapshot of the server JVM and saves the result
into files. Each dump type creates a file in ${server.output.dir},
but not all dump types are supported by all virtual machines.
- package
- A command that packages a server.
- start
- A command that launches the server as a background process.
- stop
- A command that stops a running server.
- status
- A command that checks to see whether a specified server is running.
- version
- A command that displays the version information of current server
and Java™ runtime environment.
- help
- A command that gets command-line script help, including details
of additional options.
Note: If a server is not specified on
the command line, the action is performed against the default server
instance, defaultServer, if it exists.
You can also carry out similar actions by using the
executable JAR file
ws-server.jar that is in
the
${wlp.install.dir}/bin/tools directory.
Example
To run the
server script
on Windows systems:
server.bat create server_name
server.bat package server_name
server.bat run server_name
server.bat help server_name
To run the
server script
on other systems:
server create server_name
server package server_name
server run server_name
server help server_name
To run the executable JAR file
ws-server.jar without
using the
server script:
java -javaagent:bin/tools/ws-javaagent.jar -jar bin/tools/ws-server.jar server_name --create
java -javaagent:bin/tools/ws-javaagent.jar -jar bin/tools/ws-server.jar server_name
java -javaagent:bin/tools/ws-javaagent.jar -jar bin/tools/ws-server.jar --help
The
--help option
provides information about additional command-line parameters for
the executable JAR file
ws-server.jar , such
as
--stop, --version, --clean, --include.