Sun Java System Application Server 9.1 高可用性管理指南

Procedure配置 Sun Java System Web Server

開始之前

備註 –

Application Server 9.1 的安裝程式會自動執行下列步驟。但若是使用 GlassFish v2,則需要手動執行這些步驟。


  1. 前往 Web 伺服器實例的 magnus.conf 檔案,新增下列幾行:

    ##BEGIN EE LB Plug-in Parameters
    Init fn="load-modules"
    shlib="web-server-install-dir/plugins/lbplugin/bin/libpassthrough.so"
    funcs="init-passthrough,service-passthrough,name-trans-passthrough" Thread="no"
    Init fn="init-passthrough"
    ##END EE LB Plug-in Parameters=
  2. 若不存在下行,請予以新增:

    Init fn="load-modules" shlib=".../libj2eeplugin.so" shlib_flags="(global|now)"
  3. web-server-install-dir/config/obj.conf 檔案中,在首次出現字串 nametrans 前,於單行中插入下列資訊:

    Nametrans fn="name-trans-passthrough" name="lbplugin"
    config-file="web-server-install-dir/config/loadbalancer.xml"

    NameTrans 項目在 obj.conf 中的顯示順序非常重要。安裝程式會將 NameTrans 項目擺在正確的位置,但是如果您為了其他目的而編輯 obj.conf,則必須確定維持正確的順序。尤其是負載平衡器資訊必須位在 document-root 函數之前。如需有關 obj.conf 檔案的更多資訊,請參閱 「Sun Java System Web Server 7.0 Administrator’s Configuration File Reference 」

  4. 將下列幾行新增到 web-server-install-dir/config/obj.conf 檔案:

    <Object name = "lbplugin"> 
    ObjectType fn="force-type" type="magnus-internal/lbplugin"
    PathCheck fn="deny-existence" path="*/WEB-INF/*"
    Service type="magnus-internal/lbplugin" fn="service-passthrough"
    Error reason="Bad Gateway" fn="send-error" uri="$docroot/badgateway.html"
    </Object>
  5. 編輯 web-server-install-dir /start 程序檔,更新 LD_LIBRARY_PATH 值以併入 app-server-install-dir/lib/lbplugin/lib

    app-server-install-dir /lib/lbplugin/lib 目錄包含負載平衡器外掛程式所需的二進位碼。

  6. (可選擇) 若為新的 DAS 型負載平衡器管理,請配置 Web 伺服器的 SSL 功能。

    如需 Web Server 6.1 的詳細說明,請參閱在 SSL 模式中為 Sun Java System Web Server 6.1 設定負載平衡器

    如需 Web Server 7 的詳細說明,請參閱在 SSL 模式中為 Web Server 7 設定負載平衡器

  7. 若 Web 伺服器未執行,請啟動 Web 伺服器。