Editing the Configuration of Your RAD Server Engine Manually

From RAD Studio
Jump to: navigation, search

Go Up to Setting Up Your RAD Server Engine


The RAD Server Engine is configured with default parameters, after configuring your RAD Server environment for the first time.

You can change your RAD Server Engine configuration by editing the EMSServer.ini file that is located at C:\Users\Public\Documents\Embarcadero\EMS. If you modify this file, you must terminate and restart the RAD Server Engine (EMS Server) to reload the emsserver.ini file.

RAD Server Database Configuration

You can modify the default information of the RAD Server Database that the RAD Server Engine uses. In the EMSServer.ini file, go to the [Data] section:

  • InstanceName. Specifies the InterBase instance that hosts the RAD Server database.
  • Database. RAD Server Database file local directory.
  • UserName. User name to access the RAD Server Database.
  • Password. Password to access the RAD Server Database.
  • SEPassword. Password to connect to an encrypted InterBase database.
  • Pooled. Enables FireDAC connection pooling to the RAD Server Database to reduce latency.
  • PooledMax. A maximum number of pooled connections allowed to the RAD Server Database.
  • SessionTimeout. The maximum time of session inactivity in seconds.
  • ClientLib. Optional path to FireDAC FDConnectionDef.ini
  • DriverFile. Optional path to FireDAC FDDrivers.ini
[Data]
; Interbase connection parameters
InstanceName=EMS
Database=C:\Users\Public\Documents\Embarcadero\EMS\emsserver.ib
UserName=sysdba
Password=masterkey
SEPassword=
;# SEPassword connects to an encrypted database
Pooled=
;# Set Pooled=0 to disable connection pooled, Pooled=1 to enable. Default value is 1.
PooledMax=
;# Set PooledMax=10 to limit maximum pooled connection.  Default value is 50.
SessionTimeout=
;# Set SessionTimeout=60 to limit the maximum time of session inactivity in seconds.
;# This operates on a session token.  Default is 0 (no timeout).

RAD Server Logging

You can set your RAD Server logging.

[Server.Logging]
;# The following options control EMS server log output
;#
;# Set log output file name. If blank, then log output will be disabled. Default is blank.
; FileName=c:\temp\emsserver_log.json
;# Set Append=1 to append log output to existing log file. Otherwise log file will be 
;# rewritten on each EMS server or console run.  Default is 1.
Append=1
; Set log output prefixes. Where T-thread #, D-date/time, I-IP address of a client,
; C-number of log item. The order of items is controlled by this parameter. Default is TD.
; Prefixes=CDI
; Set log date/time output format. If blank, then it is C (current date and time formats).
; TimeFormat=hh:nn:ss.zzz
[Console.Logging]
;# The following options control EMS console log output
;#
;# Set log output file name. If blank, then log output will be disabled. Default is blank.
; FileName=c:\temp\emsconsole_log.json
;# Set Append=1 to append log output to existing log file. Otherwise log file will be 
;# rewritten on each EMS console run.  Default is 1.
Append=1
; Set log output prefixes. Where T-thread #, D-date/time, I-IP address of a client,
; C-number of log item. The order of items is controlled by this parameter. Default is TD.
; Prefixes=CDI
; Set log date/time output format. If blank, then it is C (current date and time formats).
; TimeFormat=hh:nn:ss.zzz

RAD Server Engine Limits

You can modify the default information of the number of simultaneous connections to the RAD Server database or the maximum number of RAD Server Users. In the EMSServer.ini file, go to the [Server.Limits] section:

  • MaxConnections. Maximum number of concurrent HTTP requests to the RAD Server Engine.
  • MaxUsers. Maximum number of RAD Server Users allowed in the RAD Server Database. This value depends on the RAD Server license used.
  • SessionInactivityTimeout. Maximum time in seconds a user session can be inactive before the user's session times out and closes. This operates on a session token. Default is 0 (no timeout).
  • SessionLiveTimeout. Maximum time in seconds of a user session can exist before the user's session times out and closes. This operates on a session token. Default is 0 (no timeout).
[Server.Limits]
MaxConnections=
;# Set MaxConnections=10 to limit maximum concurrent HTTP requests. Default is 32.
MaxUsers=
;# Set MaxUsers=3 to limit the number of users in the EMS database.  This value is only used 
;# when less than the maximum users permitted by the EMS runtime license.
SessionInactivityTimeout=
;# Set SessionInactivityTimeout=60 to limit maximum time of a session inactivity in seconds.
;# This operates on a session token.  Default is 0 (no timeout).
SessionLiveTimeout=
;# Set SessionLiveTimeout=60 to limit maximum time of a session live in seconds.
;# This operates on a session token.  Default is 0 (no timeout).

RAD Server Engine Authentication Configuration

You can modify the default information of authentication for your RAD Server Engine (EMS Server). In the EMSServer.ini file, go to the [Server.Keys] section:

[Server.Keys]
MasterSecret=MasterSecretKey
AppSecret=AppSecretKey
ApplicationID=ApplicationIDKey

You can also set access rules to allow or deny access to an RAD Server Resource Overview. In the EMSServer.ini file, go to the [Server.Authorization] section and add your custom access rules.

[Server.Authorization]
Users={"public": false}
Users.LoginUser={"public": true}
Users.SignupUser={"public": true}

RAD Server Engine API Cross-Domain

You can modify the permission to allow different domains (outside the RAD Server Engine domain) to make HTTP requests to the public RAD Server Engine API. In the EMSServer.ini file, go to the [Server.APICrossDomain] section:

  • CrossDomain. List of domains that are allowed to make cross domain HTTP requests to the RAD Server Engine API. To allow any domain, use the wildcard value *.
[Server.APICrossDomain]
;# Write here the domains allowed to call the API. Used for Cross-Domains
CrossDomain = *

RAD Server Engine Connection

You can modify the default information for the connection to your RAD Server Engine (EMS Server). In the EMSServer.ini file, go to the [Server.Connection.Dev] section:

  • Port. Defines the connection port for the HTTP request to the RAD Server Engine.
  • HTTPS. Enables HTTPS support for the RAD Server Engine. If enabled, you need to install OpenSSL and configure the certification file information.
  • CertFile. Absolute path to the self-signed certification file (.pem file).
  • RootCertFile. Absolute path to the CA certification file (.pem file). If you use a self-signed certificate, leave this blank.
  • KeyFile. Absolute path to the self-signed key file (.pem file).
  • KeyFilePassword. Password set to use the certification file.
[Server.Connection.Dev]
Port=8080
;# The following options enable HTTPS support.
HTTPS=1
;# Set HTTPS=1 to enable HTTPS, HTTPS=0 to disable.
 CertFile=C:\Users\Public\Documents\Embarcadero\EMS\cacert.pem
; RootCertFile=
;# When using a self-signed certificate, RootCertFile is left blank.
 KeyFile=C:\Users\Public\Documents\Embarcadero\EMS\cakey.pem
 KeyFilePassword=certpassword

RAD Server FireBase Cloud Messaging

You can configure the FireBase or Google Cloud Messaging (FCM / GCM) settings for your RAD Server Engine (EMS Server). In the EMSServer.ini file, go to the [Server.Push.GCM] section:

[Server.Push.GCM]
;# This section is for FireBase and Google Cloud Messaging (FCM / GCM) settings.
;# These settings are needed to send push notifications to an Android device.
ApiKey=XXXXXXXXXXXX
;# Set your server key
ApiURL=
;# Set send message to REST API URL
;# See the default vale here.

RAD Server Engine Tenants

In this section, you can modify the tenant configurations for your RAD Server. You can select one of the following tenant modes:

  • Single Tenant mode
  • Multi-Tenant mode

For more information about Multi-Tenancy, please see the RAD Server Multi-Tenancy Support topic.

In the EMSServer.ini file, go to the [Server.Tenants] section:

  • MultiTenantMode: specifies the mode for your RAD Server. To switch to the Multi-Tenant mode, uncomment this line. If MultiTenantMode=1, the Multi-Tenancy is activated. If MultiTenantMode=0, RAD Server works in the Single Tenant mode.
  • DefaultTenantId: changes the default TenantId to the custom one in the Single Tenant mode.
  • TenantIdCookieName: specifies the custom cookie name to store the TenantId in RAD Server Console.
[Server.Tenants]
;# This section defines settings for Single or Multi-Tenant modes.
;#
;# The MultiTenantMode option is used to turn on the Multi-Tenant mode. 
;# If the Multi-Tenant mode is turned on, then TenantId and TenantSecret is required to access EMS Server.
;MultiTenantMode=1
;#
;# Default Tenant is used only in the Single Tenant mode.
;DefaultTenantId=00000000-0000-0000-0000-000000000001
;#
;# Define custom cookie name to store TenantId in RAD Server Console.
;TenantIDCookieName=TenantID

RAD Server Engine File Dispatching Support

You can configure RAD Server to identify the directories where static files are located and the URLs they are mapped to. Each entry is defined with a JSON object and the number of entries is unlimited. In the EMSServer.ini file, go to the [Server.PublicPaths] section. The properties of the object include:

  • path: the relative URL.
  • directory: Physical location of the static files.
  • default: Defines the default file that will be dispatched when browsing to the root of the virtual directory (optional).
  • mimes: Array of MIME file type masks(optional).
  • extensions: Array of file extensions (optional).
[Server.PublicPaths]
Path1={"path": "images", "directory": "C:\\web\\images\\", "default": "index.html", "mimes": ["image/*"]}
Path2={"path": "content", "directory": "C:\\web\\content\\", "default": "index.html", "extensions": ["js", "html", "css"]}

RAD Server Engine Threads Management

You can configure the RAD Server Development Threads Management advanced option to better suit your environment workload. The [Server.Threads.Dev] section contains the following options:

  • Thread pool options
  • Queueing options
  • Connection options
[Server.Threads.Dev]
;# The following options control how EMSDevServer manages threads to handle requests
;#
;# Thread pool options
; ThreadPool=1
;# Set ThreadPool=1 to enable thread pool scheduler, ThreadPool=0 to disable.
; ThreadPoolSize=5
;# ThreadPoolSize indicates how many threads are available to handle requests
;#
;# Queueing options
; ListenQueue=100
;# ListenQueue indicates how many requests can be queued when all threads are busy
;#
;# Connection options
; KeepAlive=1
;# Set KeepAlive=1 to enable HTTP connections to keep alive, KeepAlive=0 to disable.

RAD Server Sqids decoding

You can modify the default setting of the TSqidsEncoding instance that the RAD Server Engine uses. In the EMSServer.ini file, go to the [Server.Sqids] section, and change the following parameters:

  • Alphabet: Optional alphabet for Sqids decoding.
  • MinHashLength: Optional minimal hash length for Sqids decoding.
[Server.Sqids]
;# The following options control URL parameters Sqids decoding
;#
;# Optional alphabet for Sqids decoding
Alphabet=
;# Optional minimal hash length for Sqids decoding
MinHashLength=0
Note: To learn more about Sqids in RAD Studio, please visit Tutorial: Using Sqids encoding.

See Also