Setting the session timeout in the server.xml file

You can edit the WebSphere® Application Server Liberty Profile server.xml file to define a session timeout for IBM® Intelligent Operations Center.

About this task

To change the session timeout value in the server.xml file, modify the invalidationTimeout attribute on the httpSession element and modify the expiration attribute on the ltpa element.

Note: In a multi-server environment, update the server.xml file for the WebSphere Application Server Liberty Profile instance on the application server only.

In the commands that are given in the following procedure, replace the variables with the values that are configured in the ioc.install.properties installation properties file. Variables are indicated with the following formatting: variable_name.

Procedure

  1. Choose one of the following options:
    • In a multi-server environment, log on to the application server as a root user.
    • In a single-server environment, log on to the server as a root user.
  2. Enter the following command to ensure that the ioc.user user owns the contents of the WebSphere Application Server Liberty Profile installation directory:
    chown -R ioc.user:ioc.user.group liberty.install.dir
    For example,
    chown -R iocadmin:iocadmins /opt/IBM/WebSphere/wlp
  3. Enter the following command to stop WebSphere Application Server Liberty Profile, where liberty.instance.name is the WebSphere Application Server Liberty Profile server:
    su - ioc.user -c "liberty.install.dir/bin/server stop liberty.instance.name"
    For example,
    su - iocadmin -c "/opt/IBM/WebSphere/wlp/bin/server stop iocsvr1"
    The default value for ioc.user is iocadmin.
  4. Edit the liberty.install.dir/usr/servers/iocsvr1/server.xml file. For example, edit the /opt/IBM/WebSphere/wlp/usr/servers/iocsvr1/server.xml file.
    1. Modify the invalidationTimeout attribute on the httpSession element to set the session timeout value in hours (h) or minutes (m).
    2. Set the same value for the expiration attribute on the ltpa element.
    The following excerpt from the server.xml file shows the session timeout set to 8 hours:
    <httpSession cookieHttpOnly="false" cookieName="JSESSIONID" invalidationTimeout="8h"/>
    <ltpa expiration="8h" keysFileName="${server.config.dir}/resources/security/ltpa.keys"
         keysPassword="{xor}KixsLS8+ZZ2="/>
  5. Enter the following command to start WebSphere Application Server Liberty Profile:
    su - ioc.user -c "liberty.install.dir/bin/server start liberty.instance.name --clean"
    For example,
    su - iocadmin -c "/opt/IBM/WebSphere/wlp/bin/server start iocsvr1 --clean"
    Note: Always start the WebSphere Application Server Liberty Profile server instances as the ioc.user user.