19.8.4. ISAPI リダイレクターがクライアント要求を JBoss EAP 6 に送信するよう設定
概要
このタスクでは、JBoss EAP 6 サーバーのグループが ISAPI リダイレクターから要求を受け入れるよう設定します。負荷分散または高可用性フェイルオーバーの設定は含まれません。これらの機能が必要な場合は、「ISAPI がクライアント要求を複数の JBoss EAP 6 サーバーで分散するよう設定」 を参照してください。
この設定は IIS サーバーで行われ、JBoss EAP 6 がすでに 「外部 Web サーバーからの要求を許可するよう JBoss EAP 6 を設定」 どおりに設定されていることを前提とします。
前提条件
- IIS サーバーへの完全な管理者アクセスが必要です。
手順19.18 プロパティーファイルの編集およびリダイレクトの設定
ログ、プロパティーファイル、およびロックファイルを格納するディレクトリーを作成します。
この手順では、ディレクトリーC:\connectors\
の使用を前提としています。異なるディレクトリーを使用する場合は、適切に手順を変更してください。isapi_redirect.properties
ファイルを作成します。C:\connectors\isapi_redirect.properties
という新しいファイルを作成します。このファイルに次の内容をコピーします。# Configuration file for the ISAPI Redirector # Extension uri definition extension_uri=/jboss/isapi_redirect.dll # Full path to the log file for the ISAPI Redirector 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
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
ファイルには、ワーカーラベルとサーバーインスタンス間のマッピング定義が含まれます。以下のサンプルファイルはファイルの構文を示しています。このファイルを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 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
rewrite.properties
ファイルを作成します。rewrite.properties
ファイルには、特定のアプリケーションの単純な URL 書き換えルールが含まれます。以下の例で示されているように、書き換えられたパスは名前と値のペアを使用して指定されます。このファイルをC:\connectors\
ディレクトリーに格納してください。#Simple example # Images are accessible under abc path /app-01/abc/=/app-01/images/
IIS サーバーを再起動します。
net stop
およびnet start
コマンドを使用して IIS サーバーを再起動します。C:\> net stop was /Y C:\> net start w3svc
結果
アプリケーションごとに、設定した特定の JBoss EAP 6 サーバーにクライアント要求を送信するよう IIS サーバーが設定されます。