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.
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.
Relay Server for Apache consists of the following executables:
- Create the Relay Server configuration file rs.config.
- 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.
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.
Add the following directories to the LD_LIBRARY_PATH environment variable:
Edit the /<<apache-dir>>/bin/envvars file to set and then export LD_LIBRARY_PATH.
- Source /<<apache-dir>>/bin/envvars before running client- or server-facing Apache instances.
Configure the server-facing Apache instance:
- Copy the Apache conf/httpd.conf file and name the copy httpd.conf.server.
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
ThreadsPerChild 150 ThreadLimit 150 MaxRequestWorkers 2400 MinSpareThreads 450
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
Add the following line to load the Remote Administration support
LoadModule iarelayserver_admin_module <install-dir>/relayserver/apache??/bin64/mod_rs_ap_admin.so
Add the following lines to create a <LocationMatch> section for the server
<LocationMatch /srv/iarelayserver/* > SetHandler iarelayserver-server-handler "/<install-dir>/relayserver/apache??/bin64/rs.config" </LocationMatch>
Add the following lines to create a <LocationMatch> section for the Remote
<LocationMatch /admin/iarelayserver/* > SetHandler iarelayserver-admin-handler </LocationMatch>
- 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.
- Update the ErrorLog directive and change the name of the error log file so that the server-facing instance logs to a separate file.
- Update the CustomLog directive and change the name of the access log file so that the server-facing instance logs to a separate file.
Add a PidFile directive so that the client pid file and server pid file cannot overwrite
each other. For example:
- 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.
- 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.
- Disable the Apache reqtimeout_module.
Configure the client-facing Apache instance.
- Edit the Apache conf/httpd.conf file.
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
For Apache 2.4, add the lines below to support 200 client requests. See Apache
documentation for more information on these
ThreadsPerChild 75 ThreadLimit 75 MaxRequestWorkers 1200 MinSpareThreads 200
Add the following lines to create a <LocationMatch> section for the client
<LocationMatch /cli/iarelayserver/* > SetHandler iarelayserver-client-handler </LocationMatch>
- Set the Timeout directive to 60 seconds. The Timeout value must be greater than the value expected in the application's timeout logic.
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.
To update the Relay Server configuration while it is started:
Copy the updated configuration file to <install-dir>/relayserver/apache??/bin64.
Where "??" is 22 for Apache 2.2, or "24" for Apache 2.4.
From the <install-dir>/relayserver/apache??/bin64
directory, run the following command line to apply the configuration
rshost -u -f rs.config
- 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.
- Copy the updated configuration file to <install-dir>/relayserver/apache??/bin64.
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>>
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.
Perform Relay Server administration using the following URL: http://localhost/admin/iarelayserver .