RAD サーバー エンジンの構成の手動編集

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

RAD サーバー エンジンのセットアップ への移動


RAD サーバー エンジンは、最初にRAD サーバー環境を構成した際に、デフォルト パラメータで設定されます。

RAD サーバー エンジンの設定は、EMSServer.ini ファイル(C:\Users\Public\Documents\Embarcadero\EMS にある)を編集して変更できます。 このファイルを編集したら、RAD サーバー エンジン(EMS サーバー)を停止、再起動して、emsserver.ini ファイルを再読み込みする必要があります。

RAD サーバー データベースの設定

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

  • InstanceName: RAD サーバー データベースのホストとなる InterBase インスタンスを指定します。
  • Database: RAD サーバー データベース ファイルのローカル ディレクトリ。
  • UserName: RAD サーバー データベースにアクセスするユーザー名
  • Password: RAD サーバー データベースにアクセスするパスワード
  • SEPassword暗号化 InterBase データベースに接続するためのパスワード
  • PooledFireDAC 接続プールを、RAD サーバー データベースに対して有効にし、待機時間を削減します。
  • PooledMax: RAD サーバー データベースに許可されるプール接続の最大数。
  • SessionTimeout: セッションが非アクティブでいられる最大時間(秒数)。
  • ClientLib: FireDAC FDConnectionDef.ini への任意のパス
  • DriverFile: 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 サーバーのログ

RAD サーバーのログを設定できます。

[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 サーバー エンジンの制限

RAD サーバー データベースに対する同時接続数、または RAD サーバー ユーザーの最大数のデフォルト情報を変更できます。 EMSServer.ini ファイルで、[Server.Limits] セクションに移動します:

  • MaxConnections: RAD サーバー エンジンへの同時 HTTP リクエストの最大数
  • MaxUsers: RAD サーバー データベースに RAD サーバー ユーザーの最大数。 この値は、使用する RAD サーバー ライセンスによって変わります。
  • SessionInactivityTimeout: ユーザーのセッションがタイムアウトまたはクローズするまでの、ユーザー セッションが非アクティブでいられる最大時間(秒数)これは、セッション トークンに作用します。デフォルトは 0 (タイムアウトしない)です。
  • SessionLiveTimeout: ユーザーのセッションがタイムアウトまたはクローズするまでの、ユーザー セッションが存在していられる最大時間(秒数) これは、セッション トークンに作用します。 デフォルトは 0 (タイムアウトしない)です。
[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 サーバー エンジン認証の設定

RAD サーバー エンジン(EMS サーバー)の認証のデフォルト情報を変更することができます。 EMSServer.ini ファイルで、[Server.Keys] セクションに移動します:

  • MasterSecret。 所有権にかかわらずあらゆる操作が可能になるキー(たとえば、RAD サーバー データベース内のユーザーの更新など)。
  • AppSecret。認可されたエンドポイントへのあらゆるリクエストを可能にするキー。
  • ApplicationID。RAD サーバー エンジンの識別子。 この識別子は、RAD サーバー エンジンを識別します。 RAD サーバー クライアントからのリクエストは、リクエスト内の ApplicationID が RAD サーバー エンジン(EMS サーバー)に対して定義された ApplicationID と一致しない場合、拒否されます。
[Server.Keys]
MasterSecret=MasterSecretKey
AppSecret=AppSecretKey
ApplicationID=ApplicationIDKey

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

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

RAD サーバー エンジン API クロス ドメイン

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

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

RAD サーバー エンジンの接続

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

  • Port。RAD サーバー エンジンへの HTTP リクエストの接続ポートを定義します。
  • HTTPS。RAD サーバー エンジン向け 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

RAD サーバー FireBase クラウド メッセージング

RAD サーバー エンジン(EMS サーバー) に対して、FireBase または Google のクラウド メッセージング(FCM / GCM)の設定を構成することができます。EMSServer.ini ファイルで、[Server.Push.GCM] セクションに移動します:

[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 サーバー エンジン テナント

このセクションでは、RAD Server のテナント構成の修整方法について説明します。 次のテナント モードから 1 つ選択することができます:

  • シングル テナント モード
  • マルチ テナントモード

マルチテナントの詳細については、トピック「RAD サーバーのマルチテナントのサポート」を参照してください。

EMSServer.ini ファイルで、セクション [Server.Tenants] に移動します:

  • MultiTenantMode: RAD サーバーのモードを指定します。 マルチテナント モードに切り替えるには、この行のコメントを外します。 MultiTenantMode=1 の場合、マルチテナントが有効になります。 MultiTenantMode=0 の場合、RAD サーバーは、シングル テナント モードで動作します。
  • DefaultTenantId: デフォルトの TenantId をシングル テナント モードのカスタムの ID に変更します。
  • TenantIdCookieName: RAD サーバー コンソールにおいて TenantId を格納するカスタム Cookie 名を指定します。
[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 サーバー エンジン ファイルのディスパッチ サポート

RAD サーバーを設定して、静的ファイルが配置されるディレクトリや、それらへマッピングされる URL を指定することができます。 各エントリは JSON オブジェクトで定義され、そのエントリの数に制限はありません。 EMSServer.ini ファイルで、[Server.PublicPaths] セクションに移動します。 含まれるオブジェクトのプロパティ:

  • path: 相対 URL。
  • directory: 静的ファイルの物理的位置。
  • default: 仮想ディレクトリのルートを参照した際にディスパッチされるデフォルト ファイルを定義します(任意)。
  • mimes: MIME ファイル タイプ マスクの配列(任意)
  • extensions: ファイル拡張子の配列(任意)
[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 サーバー エンジン スレッド管理

RAD サーバー開発スレッド管理の詳細オプションを構成することにより、環境のワークロードにより適したものにすることができます。[Server.Threads.Dev] セクションには、次のオプションがあります:

  • Thread pool オプション
  • Queueing オプション
  • Connection オプション
[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.

関連項目