Creating a Liberty server manually

You can create a server from the command line.

Distributed: [AIX MacOS Linux Windows]

Before you begin

Distributed: [AIX MacOS Linux Windows]You can create a server as described here, or as described in Creating a Liberty server by using developer tools.

Procedure

  1. Open a command line, then change directory to the wlp/bin directory.

    Where path_to_liberty is the location you installed Liberty on your operating system.

    For UNIX platformsFor LINUX platformsFor Solaris platformsFor HP UNIX platformsFor Windows platformsFor IBM i platformsFor AIX platforms
    cd path_to_liberty/wlp/bin
  2. Run the following command to create a server. If you do not specify a server name, defaultServer is used.

    Where server_name is the name you want to give your server.

    For UNIX platformsFor LINUX platformsFor Solaris platformsFor HP UNIX platformsFor Windows platformsFor IBM i platformsFor AIX platforms
    server create server_name

    server_name must use only Unicode alphanumeric (for example, 0-9, a-z, A-Z), underscore (_), dash (-), plus (+), and period (.) characters. The name cannot begin with a dash or period. Your file system, operating system, or compressed file directory might impose more restrictions.

Results

If the server is created successfully, you receive message: Server server_name created.

If the specified server exists, no server is created and you receive an exception message:
CWWKE0005E: The runtime environment could not be launched.
CWWKE0045E: It was not possible to create the server called server_name because 
the server directory C:\wlp\usr\servers\server_name already exists.

A directory with the name of the new server is created under the ${wlp.user.dir}/servers directory, containing 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. You can also set these values by using variables in a bootstrap.properties file in the same directory. For more information, see Specifying Liberty bootstrap properties.

What to do next

Configure your server to have the features that your application requires. See Administering Liberty manually.