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
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. Maximum number of pooled connection allowed to the RAD Server Database.
[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.
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.
[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.
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 Google Cloud Messaging
You can configure the Google Cloud Messaging (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 obtained when Setting Up the Messaging Service.
[Server.Push.GCM] ;# This section is for Google Cloud Messaging (GCM) settings. ;# These settings are needed to send push notificatons to an Android device. ApiKey=XXXXXXXXXXXX
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"]}