17.9.4. ISAPI コネクターがクライアントリクエストを JBoss EAP 6 に送信するよう設定
概要
このタスクでは、JBoss EAP 6 サーバーのグループが ISAPI コネクターからのリクエストを受け入れるように設定します。ロードバランシングまたは高可用性フェイルオーバーの設定は含まれません。これらの機能が必要な場合は、「ISAPI コネクターがクライアントリクエストを複数の JBoss EAP 6 サーバーで分散するよう設定」 を参照してください。
前提条件
- IIS サーバーへの完全な管理者アクセスが必要です。
手順17.23 プロパティーファイルの編集およびリダイレクトの設定
ログ、プロパティーファイル、およびロックファイルを格納するディレクトリーを作成します。
この手順では、ディレクトリーC:\connectors\
の使用を前提としています。異なるディレクトリーを使用する場合は、適切に手順を変更してください。isapi_redirect.properties
ファイルを作成します。C:\connectors\isapi_redirect.properties
という新しいファイルを作成します。このファイルに次の内容をコピーします。Configuration file for the ISAPI Connector Extension uri definition Full path to the log file for the ISAPI Connector Log level (debug, info, warn, error or trace) Full path to the workers.properties file Full path to the uriworkermap.properties file
# 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
Copy to Clipboard Copied! uriworkermap.properties
ファイルを作成します。uriworkermap.properties
ファイルには、デプロイされたアプリケーション URL と、それらへの要求を処理するワーカー間のマッピングが含まれます。以下のサンプルファイルはファイルの構文を示しています。uriworkermap.properties
ファイルをC:\connectors\
に配置します。images and css files for path /status are provided by 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 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 Requests to /app-02 or /app-02/something will be routed to worker02
# 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
Copy to Clipboard Copied! workers.properties
ファイルを作成します。workers.properties
ファイルには、ワーカーラベルとサーバーインスタンス間のマッピング定義が含まれます。以下のサンプルファイルはファイルの構文を示しています。このファイルをC:\connectors\
ディレクトリーに置きます。An entry that lists all the workers defined Entries that define the host and port associated with these workers First JBoss EAP 6 server definition, port 8009 is standard port for AJP in EAP Second JBoss EAP 6 server definition
# 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 6 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 6 server definition worker.worker02.host=127.0.0.100 worker.worker02.port=8009 worker.worker02.type=ajp13
Copy to Clipboard Copied! rewrite.properties
ファイルを作成します。rewrite.properties
ファイルには、特定のアプリケーションの単純な URL 書き換えルールが含まれます。以下の例で示されているように、書き換えられたパスは名前と値のペアを使用して指定されます。このファイルをC:\connectors\
ディレクトリーに置きます。Images are accessible under abc path
#Simple example # Images are accessible under abc path /app-01/abc/=/app-01/images/
Copy to Clipboard Copied! IIS サーバーを再起動します。
net stop コマンドおよび net start コマンドを使用して IIS サーバーを再起動します。net stop was /Y net start w3svc
C:\> net stop was /Y C:\> net start w3svc
Copy to Clipboard Copied!
結果
アプリケーションごとに、設定した特定の JBoss EAP 6 サーバーにクライアント要求を送信するよう IIS サーバーが設定されます。