13.6.3. ISAPI リダイレクターがクライアント要求を Enterprise Application Platform に送信するよう設定する

概要

このタスクでは、Enterprise Application Platform サーバーのグループが ISAPI リダイレクターから要求を受け入れるよう設定します。負荷分散または高可用性フェールオーバーの設定は含まれません。これらの機能が必要な場合は、「ISAPI がクライアント要求を複数の Enterprise Application Platform サーバーで分散するよう設定する」を参照してください。

この設定は IIS サーバーで行われます。また、Enterprise Application Platform がすでに設定されていることを前提とします (「Enterprise Application Platformが外部 HTTPD から要求を受け入れるように設定」を参照)。

手順13.13 タスク

  1. ログ、プロパティーファイル、およびロックファイルを格納するディレクトリーを作成します。

    この手順の残りでは、この目的のためにディレクトリー C:\connectors\ を使用していることを前提とします。異なるディレクトリーを使用する場合は、適切に手順を変更してください。
  2. isapi_redirect.properties ファイルを作成します。

    C:\connectors\isapi_redirect.properties という名前の新しいファイルを作成します。以下の内容をファイルにコピーします。値 JBOSS_NATIVE_HOME を、タスク 「Microsoft IIS が ISAPI リダイレクターを使用するよう設定する」 の実行時に JBoss ネイティブコンポーネントをインストールした実際の場所に置き換えます。
    # Configuration file for the ISAPI Redirector
    # Extension uri definition
    extension_uri=JBOSS_NATIVE_HOME/sbin/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)
    # Use debug only testing phase, for production switch to info
    log_level=debug
    
    # 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 ファイルを使用しない場合は、行の先頭に # 文字を記入して最後の行をコメントアウトします。詳細については、ステップ 5 を参照してください。
  3. 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
    
  4. 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 Enterprise Application Platform 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 Enterprise Application Platform server definition
    worker.worker02.host= 127.0.0.100
    worker.worker02.port=8009
    worker.worker02.type=ajp13
    
  5. rewrite.properties ファイルを作成します。

    rewrite.properties ファイルには、特定のアプリケーションの単純な URL 書き換えルールが含まれます。以下の例で示されているように、書き換えられたパスは名前と値のペアを使用して指定されます。このファイルを C:\connectors\ ディレクトリーに格納してください。
    #Simple example
    # Images are accessible under abc path
    /app-01/abc/=/app-01/images/
    
  6. IIS サーバーを再起動します。

    バージョンに応じて、IIS サーバーを再起動する適切な手順を実行します。
    • IIS 6

      C:\> net stop iisadmin /Y
      C:\> net start w3svc
      
    • IIS 7

      C:\> net stop was /Y
      C:\> net start w3svc
      
結果

IIS サーバーが、アプリケーションごとに、設定した特定の Enterprise Application Platform サーバーにクライアント要求を送信するよう設定されます。