server create command
The server create
command creates an Open Liberty server.
Syntax
Run the command from the path_to_liberty/wlp/bin
directory.
server create serverName [options]
- serverName
A name for the server. If no server is specified, a server called
defaultServer
is automatically created.
This command is subject to the following naming constraints:
Use only Unicode alphanumeric (e.g. 0-9, a-z, A-Z), underscore (_), dash (-), plus (+), and period (.) characters.
Do not begin the name with a dash (-) or a period (.).
Be aware that your file system, operating system, or compressed file directory might impose more restrictions.
When the server is created successfully, you receive the following message: Server serverName created
.
A directory with the name of the new server is created under the ${wlp.user.dir}/servers
directory, which contains the configuration of the new server. The HTTP port numbers for the new server are assigned to default values and are shown in the generated server.xml
file to make it easy to edit them.
If the specified server already exists, then no server is created and you receive an exception message.
Options
Option | Description |
---|---|
--no-password | When this option is specified, no default keystore password is generated when the server is created. |
--template=templateName | This option specifies the name of a template to use when a new server is created. The template is a customized By default, the available templates are in the |
Exit codes
The following exit codes are available for the server create
command and the equivalent executable JAR file ws-server.jar
:
Code | Explanation |
---|---|
0 | This code indicates successful completion of the requested operation. |
1 | This code indicates invocation of a redundant operation. For example, starting a started server or stopping a stopped server. This code might also be returned by JVM if invalid Java options are used. |
>=20 | Exit codes that are greater than or equal to 20 indicate that an error occurred while performing the request. Messages are printed and captured in log files with more information about the error. |