24.9.2. ISAPI コネクターがクライアントリクエストを JBoss EAP に送信するよう設定
このタスクでは、JBoss EAP サーバーのグループが ISAPI コネクターからのリクエストを受け入れるよう設定します。ロードバランシングまたは高可用性フェイルオーバーの設定は含まれません。
この設定は IIS サーバーで行われ、外部 Web サーバーからのリクエストを許可 するよう JBoss EAP が設定されていることを前提としています。また、IIS への完全な管理者アクセスが必要で、IIS が ISAPI コネクターを使用するよう設定 されている必要があります。
プロパティーファイルの作成およびリダイレクトの設定
ログ、プロパティーファイル、およびロックファイルを格納するディレクトリーを作成します。
以下の手順では、ディレクトリー
C:\connectors\
の使用を前提としています。異なるディレクトリーを使用する場合は、適切に手順を変更してください。isapi_redirect.properties
ファイルを作成します。C:\connectors\isapi_redirect.properties
という新しいファイルを作成します。このファイルに次の内容をコピーします。# Configuration file for the ISAPI Connector # Extension uri definition extension_uri=/jboss/isapi_redirect.dll # Full path to the log file for the ISAPI Connector log_file=c:\connectors\isapi_redirect.log # Log level (debug, info, warn, error or trace) log_level=info # Full path to the workers.properties file worker_file=c:\connectors\workers.properties # Full path to the uriworkermap.properties file worker_mount_file=c:\connectors\uriworkermap.properties #Full path to the rewrite.properties file rewrite_rule_file=c:\connectors\rewrite.properties
rewrite.properties
ファイルを使用しない場合は、行の先頭に#
文字を記入して最後の行をコメントアウトします。uriworkermap.properties
ファイルの作成uriworkermap.properties
ファイルには、デプロイされたアプリケーション URL と、それらへの要求を処理するワーカー間のマッピングが含まれます。以下のサンプルファイルはファイルの構文を示しています。uriworkermap.properties
ファイルをC:\connectors\
に格納します。# images and css files for path /status are provided by worker01 /status=worker01 /images/*=worker01 /css/*=worker01 # Path /web-console is provided by worker02 # IIS (customized) error page is used for http errors with number greater or equal to 400 # css files are provided by worker01 /web-console/*=worker02;use_server_errors=400 /web-console/css/*=worker01 # Example of exclusion from mapping, logo.gif won't be displayed # !/web-console/images/logo.gif=* # Requests to /app-01 or /app-01/something will be routed to worker01 /app-01|/*=worker01 # Requests to /app-02 or /app-02/something will be routed to worker02 /app-02|/*=worker02
workers.properties
ファイルを作成します。workers.properties
ファイルには、ワーカーラベルとサーバーインスタンス間のマッピング定義が含まれます。このファイルは、 Apache mod_jk ワーカープロパティー 設定で使用される同じファイルの構文を使用します。以下は
workers.properties
ファイルの例になります。ワーカー名、worker01
、およびworker02
は、JBoss EAP のundertow
サブシステムで設定 されたinstance-id
に一致する必要があります。このファイルを
C:\connectors\
ディレクトリーに格納してください。# An entry that lists all the workers defined worker.list=worker01, worker02 # Entries that define the host and port associated with these workers # First JBoss EAP server definition, port 8009 is standard port for AJP in EAP worker.worker01.host=127.0.0.1 worker.worker01.port=8009 worker.worker01.type=ajp13 # Second JBoss EAP server definition worker.worker02.host=127.0.0.100 worker.worker02.port=8009 worker.worker02.type=ajp13
rewrite.properties
ファイルを作成します。rewrite.properties
ファイルには、特定のアプリケーションの単純な URL 書き換えルールが含まれます。以下の例で示されているように、書き換えられたパスは名前と値のペアを使用して指定されます。このファイルをC:\connectors\
ディレクトリーに格納してください。#Simple example # Images are accessible under abc path /app-01/abc/=/app-01/images/
net stop
およびnet start
コマンドを使用して IIS サーバーを再起動します。C:\> net stop was /Y C:\> net start w3svc
アプリケーションごとに、設定した特定の JBoss EAP サーバーにクライアントリクエストを送信するよう IIS サーバーが設定されます。