Editing the Configuration of Your EMS Server Manually

From RAD Studio
Jump to: navigation, search

Go Up to Setting Up Your EMS Server


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

You can change your EMS Server 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 EMS Server to reload the emsserver.ini file.

EMS Database Configuration

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

  • InstanceName. Specifies the InterBase instance that hosts the EMS database.
  • Database. EMS Database file local directory.
  • UserName. User name to access the EMS Database.
  • Password. Password to access the EMS Database.
  • SEPassword. Password to connect to an encrypted InterBase database.
  • Pooled. Enables FireDAC connection pooling to the EMS Database to reduce latency.
  • PooledMax. Maximum number of pooled connection allowed to the EMS 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.

EMS Server Limits

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

  • MaxConnections. Maximum number of concurrent HTTP requests to the EMS Server.
  • MaxUsers. Maximum number of EMS Users allowed in the EMS Database. This value depends on the EMS 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.

EMS Server Authentication Configuration

You can modify the default information of authentication for your 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 EMS Database, for instance).
  • AppSecret. Key that allows any request to the endpoints that are authorized.
  • ApplicationID. Identifier for the EMS Server. This identifier differentiates EMS servers. Requests from the EMS Clients are rejected if the ApplicationID in the request does not match the ApplicationID defined for the EMS Server.
[Server.Keys]
MasterSecret=MasterSecretKey
AppSecret=AppSecretKey
ApplicationID=ApplicationIDKey

You can also set access rules to allow or deny access to an EMS Resource or EMS Endpoint. 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}

EMS Server API Cross-Domain

You can modify the permission to allow different domains (outside the EMS Server domain) to make HTTP requests to the public EMS Server 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 EMS Server 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 = *

EMS Server Connection

You can modify the default information for the connection to your 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 EMS Server.
  • HTTPS. Enables HTTPS support for the EMS Server. 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

EMS Google Cloud Messaging

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

[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

EMS Server 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 EMS 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 EMS Console.
;TenantIDCookieName=TenantID

EMS Server File Dispatching Support

You can configure EMS 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"]}

See Also