Editing the Configuration of Your RAD Server Engine Manually
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.
Contents
- 1 RAD Server Database Configuration
- 2 RAD Server Logging
- 3 RAD Server Engine Limits
- 4 RAD Server Engine Authentication Configuration
- 5 RAD Server Engine API Cross-Domain
- 6 RAD Server Engine Connection
- 7 RAD Server FireBase Cloud Messaging
- 8 RAD Server Apple Push Notification Service Messaging
- 9 RAD Server Engine Tenants
- 10 RAD Server Engine File Dispatching Support
- 11 RAD Server Engine Threads Management
- 12 RAD Server Sqids decoding
- 13 See Also
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:
- MasterSecret. Key that allows any operation regardless of ownership (update any user in the RAD Server Database, for instance).
- RAD Server Client property: TEMSProvider.MasterSecret.
- AppSecret. Key that allows any request to the endpoints that are authorized.
- RAD Server Client property: TEMSProvider.AppSecret.
- ApplicationID. Identifier for the RAD Server Engine. This identifier differentiates RAD Server Engines. Requests from the RAD Server Clients are rejected if the ApplicationID in the request does not match the ApplicationID defined for the RAD Server Engine (EMS Server).
- RAD Server Client property: TCustomEMSConnectionInfo.ApplicationId.
[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:
- APIKey. The API Key is obtained when Setting Up the Messaging Service.
[Server.Push.GCM] ;# This section is for FireBase Cloud Messaging (FCM) settings. ;# These settings are needed to send push notifications to an Android device ClientID= ;# Set your OAuth2 client ID ClientSecret= ;# Set your OAuth2 client secret ProjectID= ;# Set your FCM project ID RefreshToken= ;# Set your OAuth2 refresh token. You can get it using EMSDevServer using the "Sign in FCM" button.
RAD Server Apple Push Notification Service Messaging
You can configure the Apple Push Notification Service Messaging settings:
[Server.Push.APNS] ;# This section is for Apple Push Notification Service (APNS). ;# These settings are needed to send push notificatons to an iOS device CertificateFileName= ;# Name of .p12 or .pem file CertificateFilePassword= ;# Password of certificate file. Leave blank if file does not have a password. ProductionEnvironment= ;# Set ProductionEnvironment=1 when the certificate has been created for production. ;# Set ProductionEnvironment=0 when the certificate has been created for development. ;# Default value is 0 (development). ApplicationID= ;# Set the optional topic for notifications. The topic is your app’s bundle ID/app ID.
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. IfMultiTenantMode=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