+

Search Tips   |   Advanced Search

Configure the Liberty profile manually

To configure the WAS Liberty profile manually, we edit server.xml, and modify declarations for the runtime and the operations console.

Environment IDs are optional, but if specified:

The environment ID is defined as an application JNDI variable, prefixed by the context root of the application.

In addition to modifications for the databases, make the following modifications to server.xml.

In the following procedure, when the example uses the worklight.war project file, use the name of the project. for example, myProject.war.

  1. In the installation directory of Liberty, open the user data directory.

    • If the installation directory of Liberty contains a etc/server.env file and if this file defines a WLP_USER_DIR variable, the user data directory is the value of this variable.

    • Otherwise, it is the usr directory in the installation directory of Liberty.

  2. Copy the MobileFirst JAR file into the shared/resources/lib/ directory that is in the user data directory.

    If there is no etc/server.env file in the installation directory of Liberty, enter the following commands, according to your operating system:

    • On UNIX and Linux:

        mkdir -p WLP_DIR/usr/shared/resources/lib
        cp MF_HOME/WorklightServer/worklight-jee-library.jar WLP_DIR/usr/shared/resources/lib

    • On Windows:

        mkdir WLP_DIR\usr\shared\resources\lib
        copy /B MF_HOME\WorklightServer\worklight-jee-library.jar WLP_DIR\usr\shared\resources\lib\worklight-jee-library.jar

    • Ensure that the <featureManager> element contains at least the following <feature> elements:

        <feature>ssl-1.0</feature>
        <feature>servlet-3.0</feature>
        <feature>jdbc-4.0</feature>
        <feature>appSecurity-1.0</feature>

    • Copy the worklight.war file to the apps directory of the Liberty server.

      The apps directory is in the same directory as the server.xml file.

    • Add the following declarations in the <server> element for the MobileFirst runtime and the operations console.

      The id attribute of the privateLibrary tag must identify a unique MobileFirst runtime. By convention, it takes this form:

        <privateLibrary id="worklightlib_<context root>">

      The version number of the cryptographic JAR file might changed based on version of WAS Liberty profile or its fix packs.

        
        <application id="worklight" 
                     name="worklight" 
                     location="worklight.war" 
                     type="war">
        
            <classloader delegation="parentLast">
        
                <privateLibrary id="worklightlib_worklight">
        
                    <fileset dir="${shared.resource.dir}/lib" 
                             includes="worklight-jee-library.jar"/>
        
                    <fileset dir="${wlp.install.dir}/lib" 
                             includes="com.ibm.ws.crypto.passwordutil_1.0.4.jar"/>
        
                </privateLibrary>
            </classloader>
        </application>
        
        <webContainer invokeFlushAfterService="false"/>

      This declaration installs the MobileFirst Server application with the context root /worklight. To assign a different context root /app_context, start the declaration with one of the following code snippets:

        <application id="app_context" 
                     name="app_context" 
                     location="worklight.war" 
                     type="war">

      ...or...

        <application id="worklight" 
                     name="worklight" 
                     location="worklight.war" 
                     context-root="/app_context" 
                     type="war">

      In either case, also change the privateLibrary tag accordingly:

        <privateLibrary id="worklightlib_app_context">

    • If the MobileFirst Server administration component uses an environment ID, declare that environment ID for MobileFirst Server application:

        <jndiEntry jndiName="worklight/ibm.worklight.admin.environmentid" 
                   value='"ValueOfEnvironmentID"'/>

      • worklight is the context root of the MobileFirst Server application. If we choose another value in previous step, replace worklight with that value.
      • Replace ValueOfEnvironmentID with the value used for the MobileFirst Server administration component


Parent topic: Deploy a project WAR file manually.

Related:

Configure a MobileFirst project in production using JNDI environment entries
Deploy application to the Liberty Profile