Administrator

Deploying Relay Server Components to Apache on Linux

Configure and deploy Relay Server files to each computer in the Relay Server farm before running the Relay Server with Apache.

Prerequisites

The SAP Mobile Platform Server installation includes Relay Server components. Relay Server files are installed to <SMP_HOME>/Server/extras/relayserver in a RelayServer-Linux-<SMP_version>.gz file.

Context

Relay Server for Apache consists of the following executables:

  • mod_rs_ap_client.so
  • mod_rs_ap_server.so
  • rshost
  • dblgen16.res
  • libdbtasks16.so
  • libdbtasks16_r.so
  • libdbicudt16.so
  • libdbicu16_r.so
  • mod_rs_ap_admin.so

Procedure

  1. Create the Relay Server configuration file rs.config.
  2. Copy rs.config into the <install-dir> /relayserver/apache??/bin64 directory. ?? is 22 for Apache 2.2.x and 24 for Apache 2.4.x.
  3. Edit the Relay Server configuration file rs.config using the following guidelines.
    • The file has four sections, and each section starts with a section tag that is enclosed in square brackets:

      • Relay server section
      • Backend farm section
      • Backend server section
      • Options section
    • Add the appropriate properties to each section. Define each property as a keyword=value pair.

    • The configuration file only supports 7-bit ASCII characters.

  4. Add the following directories to the LD_LIBRARY_PATH environment variable:
    • <install-dir>/lib64
    • <install-dir>/relayserver/apache??/bin64

    Edit the /<<apache-dir>>/bin/envvars file to set and then export LD_LIBRARY_PATH.

  5. Source /<<apache-dir>>/bin/envvars before running client- or server-facing Apache instances.
  6. Configure the server-facing Apache instance:
    1. Copy the Apache conf/httpd.conf file and name the copy httpd.conf.server.
    2. For Apache 2.4, add the lines below to support 200 clients going through the Apache Linux Relay Server, with two outbound enablers in the back end using default JSL and JSH settings. See Apache documentation for more information on these settings.
      ThreadsPerChild 150
      ThreadLimit 150
      MaxRequestWorkers 2400
      MinSpareThreads 450
      
    3. Add the following line to conf/httpd.conf.server to load the Relay Server server module:
      LoadModule iarelayserver_server_module <install-dir>/relayserver/apache??/bin64/mod_rs_ap_server.so
    4. Add the following line to load the Remote Administration support module:
      LoadModule iarelayserver_admin_module <install-dir>/relayserver/apache??/bin64/mod_rs_ap_admin.so
    5. Add the following lines to create a <LocationMatch> section for the server module:
      <LocationMatch /srv/iarelayserver/* >
          SetHandler iarelayserver-server-handler
           "/<install-dir>/relayserver/apache??/bin64/rs.config"
      </LocationMatch>
    6. Add the following lines to create a <LocationMatch> section for the Remote Administration module:
      <LocationMatch /admin/iarelayserver/* >
        SetHandler iarelayserver-admin-handler
      </LocationMatch>
    7. Update the Listen directive and ensure the server instance listens on a different port or adapter than the client instance. This port must also be accessible to the computer running the Outbound Enabler.
    8. Update the ErrorLog directive and change the name of the error log file so that the server-facing instance logs to a separate file.
    9. Update the CustomLog directive and change the name of the access log file so that the server-facing instance logs to a separate file.
    10. Add a PidFile directive so that the client pid file and server pid file cannot overwrite each other. For example:
      PidFile "logs/httpd_server.pid"
    11. If Apache is set up for HTTPS, make another copy of conf/extra/httpd-ssl.conf (for example httpd-ssl.conf.server) and change the SSL listening port. If both Apache instances include the same file, a socket bind error occurs on the Apache instance that is started second.
    12. Set the Timeout directive to 60 seconds. The Timeout value must be greater than both the max_junction_idle_sec value and the value expected in the application's timeout logic.
    13. Disable the Apache reqtimeout_module.
  7. Configure the client-facing Apache instance.
    1. Edit the Apache conf/httpd.conf file.
    2. Add the following line to load the Relay Server client module:
      LoadModule iarelayserver_client_module <install-dir>/relayserver/apache??/bin64/mod_rs_ap_client.so
    3. For Apache 2.4, add the lines below to support 200 client requests. See Apache documentation for more information on these settings.
      ThreadsPerChild 75
      ThreadLimit 75
      MaxRequestWorkers 1200
      MinSpareThreads 200
      
      
    4. Add the following lines to create a <LocationMatch> section for the client module:
      <LocationMatch /cli/iarelayserver/* >
          SetHandler iarelayserver-client-handler
      </LocationMatch>
    5. Set the Timeout directive to 60 seconds. The Timeout value must be greater than the value expected in the application's timeout logic.
  8. On Linux, if the $TMP, $TMPDIR, or $TEMP environment variable is set globally when Apache spawns a process, then Apache configuration is complete.

    If any of the above environment variables are not set globally, or if you want to place the default Relay Server log file in a specific temporary directory, then edit the file /<<apache-dir>>/bin/envvars to set and then export $TMP.

    If you start Apache by using the httpd command line directly, then source /<<apache-dir>>/bin/envvars first.

    For example, to edit the location of $TMP in the envvars file, do the following:

    set TMP="/tmp"
    export TMP

    This environment variable is set in the shell that Apache creates before it spawns its processes.

  9. To update the Relay Server configuration while it is started:
    1. Copy the updated configuration file to <install-dir>/relayserver/apache??/bin64.
      Where "??" is 22 for Apache 2.2, or "24" for Apache 2.4.
    2. From the <install-dir>/relayserver/apache??/bin64 directory, run the following command line to apply the configuration update:
      rshost -u -f rs.config
    3. If the Relay Server is set up as a farm with more than one server, repeat the previous steps for each computer in the Relay Server farm.
  10. Test if the Relay Server is running and the farm is available.
    In a Web browser, check the Relay Server status using the following URL: http://localhost/cli/iarelayserver/<<farmId>>

Results

The Relay Server is up and running with Relay Server farms in rs.config connected to all back-end servers. You can check the rs.log file to verify that Relay Server is started properly and to get other information on its operation.

Next Steps

Perform Relay Server administration using the following URL: http://localhost/admin/iarelayserver .