EMS サーバーの構成を手動で編集する

提供: RAD Studio
移動先: 案内検索

EMS サーバーのセットアップ への移動


初めて EMS 環境を構成したとき、EMS サーバーはデフォルト パラメータで構成されています。

C:\Users\Public\Documents\Embarcadero\EMS にある EMSServer.ini ファイルを編集することにより、EMS サーバー構成を変更できます。このファイルを編集した場合は、emsserver.ini ファイルを再読み込みするために EMS サーバーを終了して再起動する必要があります。

EMS データベース構成

EMS サーバーで使用される EMS データベースのデフォルト情報を変更することができます。EMSServer.ini ファイルで、[Data] セクションに移動します。

  • InstanceName: EMS データベースをホストする InterBase インスタンスを指定します。
  • Database: EMS データベース ファイルのローカル ディレクトリ。
  • UserName: EMS データベースにアクセスするためのユーザー名。
  • Password: EMS データベースにアクセスするためのパスワード。
  • SEPassword暗号化された InterBase データベースに接続するためのパスワード。
  • PooledFireDAC 接続のプールを有効にして、EMS データベースの待ち時間を短縮できるようにします。
  • PooledMax: EMS データベースに許可されたプール済み接続の最大数。
[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 サーバーの制限

EMS データベースへの同時接続数や EMS ユーザーの最大数のデフォルト情報を変更することができます。EMSServer.ini ファイルで、[Server.Limits] セクションに移動します。

  • MaxConnections。EMS サーバーに対する同時 HTTP 要求の最大数です。
  • MaxUsers。EMS データベースで許可された EMS ユーザーの最大数です。この値は、使用している EMS ライセンスによって異なります。
[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 サーバーの権限付与の構成

EMS サーバーデフォルトの権限付与情報は変更することができます。EMSServer.ini ファイルで、[Server.Keys] セクションに移動します。

  • MasterSecret。所有権にかかわらずあらゆる操作が可能になるキー(たとえば、EMS Database 内のユーザーを更新します)。
  • AppSecret。権限付与されたエンドポイントへの要求を許可するキー。
  • ApplicationID。EMS サーバーを識別します。この識別子は、EMS サーバーを区別します。EMS クライアントからの要求は、要求内の ApplicationID が EMS サーバー用に定義された ApplicationID と一致しない場合、拒否されます。
[Server.Keys]
MasterSecret=MasterSecretKey
AppSecret=AppSecretKey
ApplicationID=ApplicationIDKey

また、アクセス ルールを設定して、EMS リソースまたは EMS エンドポイントへのアクセスを許可/拒否することができます。 EMSServer.ini ファイルで、[Server.Authorization] セクションへ移動し、独自のアクセス ルールを追加します。

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

EMS サーバー API クロスドメイン

権限を変更して、異なるドメイン(EMS サーバー ドメインの外)から、公開 EMS サーバー API に HTTP リクエストを送ることができます。EMSServer.ini ファイルにて、[Server.APICrossDomain] セクションに移動します:

  • CrossDomainEMS サーバー API へのクロス ドメイン HTTP リクエストを許可するドメインのリスト。ドメインに許可するには、ワイルドカード値 * を使用してください。
[Server.APICrossDomain]
;# Write here the domains allowed to call the API. Used for Cross-Domains
CrossDomain = *

EMS サーバー接続

EMS サーバーに接続するためのデフォルト情報を変更することができます。EMSServer.ini ファイルで、[Server.Connection.Dev] セクションに移動します。

  • Port: EMS サーバーへの HTTP 要求の接続ポートを定義します。
  • [HTTPS]:EMS サーバー向け HTTPS サポートを有効にします。 有効にする場合、OpenSSL をインストールし、認証ファイル情報を構成する必要があります。
  • CertFile: 自己署名認証ファイルへの絶対パス(.pem ファイル)。
  • RootCertFile: CA 認証ファイルへの絶対パス(.pem ファイル)。自己署名証明書を使用する場合、ここは空白のままにします。
  • KeyFile: 自己署名キー ファイルへの絶対パス(.pem ファイル)。
  • KeyFilePassword: 認証ファイルを使用するために設定するパスワード。
[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 サーバー. 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

関連項目