适用于 Microsoft Windows 的 Sun Java System Application Server Enterprise Edition 8.2 发行说明

解决方法

要配置负载平衡器 Apache 或 IIS,请执行以下步骤:

    配置 Apache 2.x:

  1. 安装 Apache 2.x。

    Apache 安装在 APDIR=C:\Apache2\Apache2 目录中

  2. 使用最小安装安装 JES5。

    取消选定除负载平衡器之外的所有组件。Java ES 5 安装在 JES5DIR=C:\Program Files\Sun\JavaES5 目录中。

  3. Apache2 目录中创建 resourceerrorpages 目录。

    mkdir %APDIR%\modules\resource

    mkdir %APDIR%\modules\errorpages

  4. 将资源文件复制到 resource 目录。

    cd %APDIR%\modules\resource

    copy %JES5DIR%\appserver\lib\webserver-plugin\windows\apache2\LBPlugin*.res

  5. 将负载平衡器 DLL 复制到 modules 目录。

    cd %APDIR%\modules

    copy %JES5DIR%\appserver\lib\webserver-plugin\windows\apache2\mod_loadbalancer.dll

  6. 将模板 errorpages 复制到 errorpages 目录。

    cd %APDIR%\modules\errprpages

    copy %JES5DIR%appserver\lib\webserver-plugin\windows\iws\errorpages

  7. 将负载平衡器模板和其他 DTD 复制到 Apache config 目录。

    cd %APDIR%\config

    copy %JES5DIR%\appserver\lib\install\templates\loadbalancer.xml.template

    copy %JES5DIR%\appserver\lib\dtds\sun-loadbalancer*

  8. 创建 httpd.conf 文件的备份。

    cd %APDIR%\config

    copy httpd.conf httpd.conf.orig

  9. 编辑 httpd.conf 文件。

    将下列行附加到 httpd.conf 文件:

    ##BEGIN EE LB Plugin Parameters
    LoadModule apachelbplugin_module modules/mod_loadbalancer.dll
    <IfModule mod_apache2lbplugin.cpp>
    		config-file "C:\Apache2\Apache2/conf/loadbalancer.xml"
    		locale en
    </IfModule>
    <VirtualHost 10.12.8.107>
    DocumentRoot "C:\Apache2\Apache2/htdocs"
    ServerName vm07
    </VirtualHost>
    ##END EE LB Plugin Parameters
  10. C:\Apache2\Apache2 替换为实际的 %APDIR% 目录。

    此外还需替换 IP、ServerName 和 DocumentRoot 目录。

  11. %APDIR% 中创建新的 sec_db_files 目录。

    cd %APDIR%

    mkdir sec_db_files

  12. 将 NSS 密钥存储复制到 %APDIR%\sec_db_files 目录。

    cd %APDIR%\sec_db_files

    copy %JES5DIR%\appserver\lib\webserver-plugin\windows\iis\*.db

  13. 设置包含所需库的 PATH。

    并将下列附加路径添加到其前面:

    PATH %JES5DIR%\share\lib;%JES5DIR%\appserver\lib;%JES5DIR%\appserver\bin

  14. %JES5DIR% 替换为实际的 Java ES 5 目录。

  15. 在系统环境中添加 NSPR_NATIVE_THREADS_ONLY 变量(其值为 1)。

  16. 重新引导并测试 Apache 2(配置完 loadbalancer.xml 后)。

    配置 IIS LBPlugin:

  1. c:\inetpub\wwwroot 目录中创建 sun-passthrough 目录。

    cd c:\inetpub\wwwroot

    mkdir sun-passthrough

  2. c:\inetpub\wwwroot\sun-passthrough 目录中创建 errorpagesresourcesec_db_files 目录。

    cd c:\inetpub\wwwroot\sun-passthrough

    mkdir errorpages

    mkdir resources

    mkdir sec_db_files

  3. 将 DLL 文件复制到 sun-passthrough 目录。

    copy <as_install_dir>/appserver/lib/webserver-plugin/iis/*.dll c:\inetpub\wwwroot\sun-passthrough\

  4. 将 DTD 复制到 sun-passthrough 目录。

    copy <as_install_dir>/appserver/lib/dtds/sun-loadbalancer*.dtd c:\inetpub\wwwroot\sun-passthrough\

  5. sun-passthrough.properties 文件复制到 sun-passthrough 目录。

    copy <as_install_dir>/appserver/lib/webserver-plugin/iis c:\inetpub\wwwroot\sun-passthrough\

  6. 将安全性 DB 文件复制到 sun-passthrough 目录。

    copy <as_install_dir>/appserver/lib/webserver-plugin/iis/*.db c:\inetpub\wwwroot\sun-passthrough\sec_db_files\

  7. 将资源文件复制到 sun-passthrough 目录。

    copy <as_install_dir>/appserver/lib/webserver-plugin/iws/*.res c:\inetpub\wwwroot\sun-passthrough\resource\

  8. 将错误页面复制到 sun-passthrough 目录。

    copy <as_install_dir>/appserver/lib/webserver-plugin/iws/errorpages/*.html c:\inetpub\wwwroot\sun-passthrough\errorpages\

  9. loadbalancer.xml.example 模板复制到 sun-passthrough 目录。

    copy <as_install_dir>/appserver/lib/install/templates/loadbalancer.xml.example c:\inetpub\wwwroot\sun-passthrough\

  10. 编辑 sun-passthrough.properties 文件。

    ##BEGIN EE LB Plugin Parameters
    log-file = C:\InetPub\wwwroot\sun-passthrough\lb.log
    ### The valid options for different logging levels are FATAL, SEVERE, WARNING, INFO and FINE.
    log-level = INFO
    lb-config-file = C:\InetPub\wwwroot\sun-passthrough\loadbalancer.xml
    ##END EE LB Plugin Parameters

注 –

如果正在配置 IIS6,请确保按照 AS82 文档所述设置权限并执行附加步骤。 可能还需将 IIS6 隔离模式设置为 IIS5 兼容。