使用 WebLogic Server 的 Web 服务器插件

     上一页  下一页    在新窗口中打开目录     
在此处开始内容

安装和配置 Netscape Enterprise Server 插件

以下部分描述如何安装和配置 Netscape Enterprise Server (NES) 代理插件:

 


Netscape Enterprise Server 插件概述

通过 Netscape Enterprise Server 插件,可以将请求从 Netscape Enterprise Server(NES,也称为 iPlanet)代理到 WebLogic Server。该插件允许 WebLogic Server 处理要求使用 WebLogic Server 动态功能的请求,从而增强了 NES 安装。

Netscape Enterprise Server 插件设计用于这样的环境:其中 Netscape Enterprise Server 提供静态页,Weblogic Server 实例(在不同的进程中,在可能不同的计算机上进行操作)被委托提供动态页(如 JSP 或由 HTTP Servlet 生成的页面)。WebLogic Server 和 Netscape Enterprise Server 插件之间的连接是使用明文或安全套接口层(Secure Sockets Layer,简称 SSL)建立的。对于最终用户(浏览器),委托给 WebLogic Server 的 HTTP 请求看似来自与静态页相同的源。此外,WebLogic Server 的 HTTP 隧道工具也可以通过 Netscape Enterprise Server 插件操作,以提供对所有 WebLogic Server 服务(并非只是动态页)的访问。

Netscape Enterprise Server 插件充当 Netscape Enterprise Server 中的 NES module。NES 模块由 NES 在启动时加载,然后某些 HTTP 请求会委托给它。NES 类似于 HTTP (Java) Servlet(除了 NES 模块是用平台本地代码编写的之外)。

有关支持的 Netscape Enterprise Server 和 iPlanet 服务器版本的详细信息,请参阅 BEA WebLogic Server Certifications Page

保持活动的缓冲池连接

WebLogic Server Netscape Enterprise Server 插件通过使用从插件到 WebLogic Server 的可重用连接缓冲池来提供高效的性能。NES 插件自动在插件和 WebLogic Server 之间实现“保持活动”的连接。如果连接处于非活动状态的时间超过 30 秒(或用户定义的时间),则会关闭该连接。可以根据需要禁用此功能。有关详细信息,请参阅 KeepAliveEnabled

代理请求

插件根据指定的配置将请求代理到 WebLogic Server。可以根据请求的 URL(或 URL 的一个部分)代理请求。这称为按路径进行代理。还可以根据请求文件的 MIME 类型代理请求。或者可以使用这两种方法的组合。如果请求同时符合这两个条件,则按路径代理请求。还可以为这些类型的请求中的每一个指定其他参数,以定义插件的其他行为。有关详细信息,请参阅安装和配置 Netscape Enterprise Server 插件

 


安装和配置 Netscape Enterprise Server 插件

要安装和配置 Netscape Enterprise Server 插件,请执行下列操作:

  1. 复制库
  2. WebLogic NES 插件模块在 UNIX 平台上作为共享对象 (.so) 分发,在 Windows 上作为动态链接库 (.dll) 分发。这些文件位于 WebLogic Server 分发的 WL_HOME/server/plugin/OperatingSystem/Architecture 目录中。WL_HOME 表示 WebLogic 平台的顶级安装目录。服务器目录包含 WebLogic Server 的安装文件。OperatingSystem 是指操作系统,如 UNIX 或 Windows。

    从位于 certifications/certifications/index.htmlCertifications table 中选择适用于您的环境的相应库文件,并将该文件复制到 NES 所在的文件系统中。

  3. 阅读修改 obj.conf 文件的准则,然后按下列步骤中所述修改 NES obj.conf 文件。 obj.conf 文件定义代理到 WebLogic Server 的请求以及其他配置信息。
  4. 查找并打开 obj.conf
  5. NES 实例的 obj.conf 文件位于以下位置:

    NETSCAPE_HOME/https-INSTANCE_NAME/config/obj.conf

    其中 NETSCAPE_HOME 是 NES 安装的根目录,INSTANCE_NAME 是您正在使用的特殊“实例”或服务器配置。例如,在名为 myunixmachine 的 UNIX 计算机上,obj.conf 文件将位于以下位置:

    /usr/local/netscape/enterprise-351/
    https-myunixmachine/config/obj.conf
  6. 指示 NES 将本地库(.so.dll 文件)作为 NES 模块加载。
  7. 要使用 iPlanet 4.x 或早期版本,请将下列行添加到 obj.conf 文件的开头。

    Init fn="load-modules" funcs="wl_proxy,wl_init"\
    shlib=/usr/local/netscape/plugins/
    SHARED_LIBRARY
    Init fn="wl_init"

    其中 SHARED_LIBRARY 是您在安装和配置 Netscape Enterprise Server 插件下的步骤 1 中安装的共享对象或 dll(例如 libproxy.so)。函数“load-modules”标记在 NES 启动时加载的共享库。值“wl_proxy”和“wl_init”标识 Netscape Enterprise Server 插件执行的函数。

    要使用 iPlanet 6.0,请将下列行添加到 magnus.conf 文件的开头。这些行指示 NES 将本地库(.so.dll 文件)作为 NES 模块加载:

    Init fn="load-modules" funcs="wl_proxy,wl_init"\
    shlib=/usr/local/netscape/plugins/
    SHARED_LIBRARY
    Init fn="wl_init"

    其中 SHARED_LIBRARY 是您在安装和配置 Netscape Enterprise Server 插件下的步骤 1 中安装的共享对象或 dll(例如 libproxy.so)。函数“load-modules”标记在 NES 启动时加载的共享库。值“wl_proxy”和“wl_init”标识 Netscape Enterprise Server 插件执行的函数。

  8. 如果希望按 URL 代理请求(也称为按路径进行代理),请为您要代理的每个 URL 创建一个单独的 <Object> 标记,并定义 PathTrim 参数。(除了按路径代理请求之外,或不按路径代理请求时,可按 MIME 类型代理请求。请参阅步骤 6。按路径进行的代理优先于按 MIME 类型进行的代理。)以下是 <Object> 标记的示例,它代理包含字符串 */weblogic/* 的请求。
  9. <Object name="weblogic" ppath="*/weblogic/*">
    Service fn=wl_proxy WebLogicHost=myserver.com\
     WebLogicPort=7001 PathTrim="/weblogic"
    </Object>

    要创建 <Object> 标记以便按 URL 代理请求,请执行下列操作:

    1. 在打开的 <Object> 标记中,使用 name 特性指定此对象的名称(可选)。name 特性仅用于提供信息,Netscape Enterprise Server 插件并不会使用它。例如:
    2. <Object name=myObject ...>
    3. <Object> 标记中,使用 ppath 特性指定要代理的 URL。例如:
    4. <Object name=myObject ppath="*/weblogic/*>

      ppath 特性的值可以是标识专门向 Weblogic Server 做出的请求的任何字符串。使用 ppath 时,将重定向包含该路径的每个请求。例如,ppath 为“*/weblogic/*”会将以“http://enterprise.com/weblogic”开头的每个请求重定向到 Netscape Enterprise Server 插件,该插件将请求发送到指定的 Weblogic 主机或群集。

    5. <Object></Object> 标记中添加 Service指令。在 Service 指令中,可以将任何有效的参数作为名称=值对指定。使用一个且仅一个空格分隔多个名称=值对。例如:
    6. Service fn=wl_proxy WebLogicHost=myserver.com\
       WebLogicPort=7001 PathTrim="/weblogic"

      有关参数的完整列表,请参阅 Web 服务器插件的常规参数必须指定下列参数:

      对于非群集 WebLogic Server:
             WebLogicHostWebLogicPort 参数。

      对于 WebLogic Server 实例的群集:
             WebLogicCluster 参数。

      总是以服务 fn=wl_proxy开始 Service 指令,后跟有效的参数名称=值对。

      以下是两个单独 ppaths(用于标识要发送到 WebLogic Server 的不同实例的请求)的对象定义示例:

      <Object name="weblogic" ppath="*/weblogic/*">
      Service fn=wl_proxy WebLogicHost=myserver.com\
       WebLogicPort=7001 PathTrim="/weblogic"
      </Object>
      <Object name="si" ppath="*/servletimages/*">
      Service fn=wl_proxy WebLogicHost=otherserver.com\
       WebLogicPort=7008
      </Object>
注意: 非必需的参数(如 PathTrim)可用于进一步配置通过 Netscape Enterprise Server 插件传递 ppath 的方式。有关插件参数的完整列表,请参阅
  1. 如果按 MIME 类型代理请求,请将 obj.conf 文件中引用的任何新的 MIME 类型添加到 MIME.types 文件中。可以通过使用 Netscape 服务器控制台或通过直接编辑 MIME.types 文件来添加 MIME 类型。
  2. 要直接编辑 MIME.types 文件,请打开要编辑的文件并键入以下行:

    type=text/jsp        exts=jsp
    注意: 对于 NES 4.0 (iPlanet),请不要添加 JSP 的 MIME 类型,而要将现有 MIME 类型从
    magnus-internal/jsp

    更改为

    text/jsp。 

    要使用 Netscape 控制台,请依次选择“管理首选项”箭头符号“Mime 类型”,然后进行添加或编辑。

  3. 具有指定 MIME 类型扩展名(例如,.jsp)的所有请求都可以被代理到 WebLogic Server,而不管 URL 如何。要将特定文件类型的所有请求代理到 WebLogic Server,请执行下列操作:
    1. 在现有 default Object 定义中添加 Service指令。(<Object name=default ...>)
    2. 例如,要将所有 JSP 代理到 WebLogic Server,应将以下 Service 指令添加到以下面的字符串开头的最后一行之后:

      NameTrans fn=....

      以下面的字符串开始的行之前:

      PathCheck

      Service method="(GET|HEAD|POST|PUT)" type=text/jsp fn=wl_proxy\
       WebLogicHost=192.1.1.4 WebLogicPort=7001 PathPrepend=/jspfiles

      Service 指令会将具有 .jsp 扩展名的所有文件代理到指定的 WebLogic Server,在该 WebLogic Server 中,会使用如下所示的 URL 提供这些文件:

      http://WebLogic:7001/jspfiles/myfile.jsp

      PathPrepend 参数的值应对应于将请求代理到的 WebLogic Server 或群集上部署的 Web 应用程序的上下文根目录。

      添加 Netscape Enterprise Server 插件条目后,默认 Object 定义将类似于以下示例:

      <Object name=default>
      NameTrans fn=pfx2dir from=/ns-icons\
       dir="c:/Netscape/SuiteSpot/ns-icons"
      NameTrans fn=pfx2dir from=/mc-icons\
       dir="c:/Netscape/SuiteSpot/ns-icons"
      NameTrans fn="pfx2dir" from="/help" dir=\
       "c:/Netscape/SuiteSpot/manual/https/ug"
      NameTrans fn=document-root root="c:/Netscape/SuiteSpot/docs"
      Service method="(GET|HEAD|POST|PUT)" type=text/jsp\
       fn=wl_proxy WebLogicHost=localhost WebLogicPort=7001\  PathPrepend=/jspfiles
      PathCheck fn=nt-uri-clean
      PathCheck fn="check-acl" acl="default"
      PathCheck fn=find-pathinfo
      PathCheck fn=find-index index-names="index.html,home.html"
      If a required parameter is missing from the configuration, when the object is invoked it issues an HTML error that notes the missing parameter from the configuration.
      ObjectType fn=type-by-extension
      ObjectType fn=force-type type=text/plain
      Service method=(GET|HEAD) type=magnus-internal/imagemap\  fn=imagemap
      Service method=(GET|HEAD) \
       type=magnus-internal/directory fn=index-common
      Service method=(GET|HEAD) \
       type=*~magnus-internal/* fn=send-file
      AddLog fn=flex-log name="access"
      </Object>
    3. 对要代理到 WebLogic Server 的所有其他 MIME 类型,将一条类似的 Service 语句添加到默认对象定义中。
    4. 要为 JSP 配置按 MIME 进行的代理,必须将以下条目添加到 mime.types 文件中:
    5. type=text/jsp exts=jsp

      要使按 MIME 进行的代理可正常工作,需要从 Sun One Web Server 禁用 JAVA,否则 SUN One 将尝试为所有以 *.jsp 结尾的请求提供服务并将返回 404 错误,因为它将无法在 $doc_root 下找到资源。

      要从 Sun One Web Server 禁用 JAVA,请将 obj.conf 文件中 name="default"#NameTrans fn="ntrans-j2ee" name="j2ee" 下的部分标记为注释,然后重新启动 Web 服务器。

  4. (可选)如果按路径进行代理,则可启用 HTTP 隧道:
    1. 如果使用 weblogic.jar 并为 t3 协议建立隧道,请将以下对象定义添加到 obj.conf 文件中,替换 WebLogic Server 主机名和 WebLogic Server 端口号,或所希望的处理 HTTP 隧道请求的 WebLogic 群集的名称。
      <Object name="tunnel" ppath="*/HTTPClnt*">
      Service fn=wl_proxy WebLogicHost=192.192.1.4\  WebLogicPort=7001
      </Object>
    2. 如果为 IIOP(IIOP 是 WebLogic Server 瘦客户端 wlclient.jar使用的唯一协议)建立隧道,请将以下对象定义添加到 obj.conf 文件,替换 WebLogic Server 主机名和 WebLogic Server 端口号,或所希望的处理 HTTP 隧道请求的 WebLogic 群集的名称。
      <Object name="tunnel" ppath="*/iiop*">
      Service fn=wl_proxy WebLogicHost=192.192.1.4\  WebLogicPort=7001
      </Object>
  5. 部署和测试 Netscape Enterprise Server 插件
    1. 启动 WebLogic Server。
    2. 启动 Netscape Enterprise Server。如果 NES 已在运行,则必须重新启动它或从控制台应用新设置才能使新设置生效。
    3. 要测试 Netscape Enterprise Server 插件,请打开浏览器并将 URL 设置为 Netscape Enterprise Server + /weblogic/,这将打开默认 WebLogic Server HTML 页、欢迎文件或默认 Servlet,如此示例中所示对默认 Web 应用程序的定义:
    4. http://myenterprise.server.com/weblogic/

      有关如何创建默认 Web 应用程序的信息,请参阅开发 WebLogic Server 的 Web 应用程序、Servlet 和 JSP

修改 obj.conf 文件的准则

要使用 Netscape Enterprise Server 插件,必须对 NES obj.conf 文件做出几项修改。这些修改指定如何将请求代理到 WebLogic Server。可以按 URL 或按 MIME 类型代理请求。安装和配置 Netscape Enterprise Server 插件中描述了进行每种代理的过程。

Netscape obj.conf 文件对于文本的放置要求非常严格。为避免出现问题,请注意 obj.conf 文件的下列相关注意事项:

示例 obj.conf 文件(不使用 WebLogic 群集)

以下是在不使用群集的情况下应添加到 obj.conf 文件中的行示例。可以将此示例用作模板,对其进行修改以满足您的环境和服务器的需要。以 # 开始的行是注释。

注意: 请确保 obj.conf 文件中不包含任何额外的空格。从下面的示例中复制内容并对其进行粘贴有时会添加额外的空格,这可能导致在读取文件时出现问题。

您可以在 Netscape Enterprise Server 插件文档中阅读有关 Enterprise Server 配置文件的完整文档。

## ------------- BEGIN SAMPLE OBJ.CONF CONFIGURATION  ---------
# (no cluster)
# The following line locates the NES library for loading at
# startup, and identifies which functions within the library are
# NES functions.Verify the path to the library (the value
# of the shlib=<...> parameter) and that the file is
# readable, or the server fails to start.
Init fn="load-modules" funcs="wl_proxy,wl_init"\
 shlib=/usr/local/netscape/plugins/libproxy.so
Init fn="wl_init"
# Configure which types of HTTP requests should be handled by the
# NES module (and, in turn, by WebLogic).This is done
# with one or more "<Object>" tags as shown below.
# Here we configure the NES module to pass requests for
# "/weblogic" to a WebLogic Server listening at port 7001 on
# the host myweblogic.server.com.
<Object name="weblogic" ppath="*/weblogic/*">
Service fn=wl_proxy WebLogicHost=myweblogic.server.com\
 WebLogicPort=7001 PathTrim="/weblogic"
</Object>
# Here we configure the plug-in so that requests that
# match "/servletimages/" is handled by the
# plug-in/WebLogic.
<Object name="si" ppath="*/servletimages/*">
Service fn=wl_proxy WebLogicHost=192.192.1.4 WebLogicPort=7001
</Object>
# This Object directive works by file extension rather than
# request path.To use this configuration, you must also add
# a line to the mime.types file:
#
# type=text/jsp exts=jsp
#
# This configuration means that any file with the extension
# ".jsp" are proxied to WebLogic.Then you must add the
# Service line for this extension to the Object "default",
# which should already exist in your obj.conf file:
<Object name=default>
NameTrans fn=pfx2dir from=/ns-icons\
 dir="c:/Netscape/SuiteSpot/ns-icons"
NameTrans fn=pfx2dir from=/mc-icons\
 dir="c:/Netscape/SuiteSpot/ns-icons"
NameTrans fn="pfx2dir" from="/help" dir=\
 "c:/Netscape/SuiteSpot/manual/https/ug"
NameTrans fn=document-root root="c:/Netscape/SuiteSpot/docs"
Service method="(GET|HEAD|POST|PUT)" type=text/jsp fn=wl_proxy\
 WebLogicHost=localhost WebLogicPort=7001 PathPrepend=/jspfiles
PathCheck fn=nt-uri-clean
PathCheck fn="check-acl" acl="default"
PathCheck fn=find-pathinfo
PathCheck fn=find-index index-names="index.html,home.html"
ObjectType fn=type-by-extension
ObjectType fn=force-type type=text/plain
Service method=(GET|HEAD) type=magnus-internal/imagemap\  fn=imagemap
Service method=(GET|HEAD) \
 type=magnus-internal/directory fn=index-common
Service method=(GET|HEAD) type=*~magnus-internal/* fn=send-file
AddLog fn=flex-log name="access"
</Object>
# The following directive enables HTTP-tunneling of the 
# WebLogic protocol through the NES plug-in.
<Object name="tunnel" ppath="*/HTTPClnt*">
Service fn=wl_proxy WebLogicHost=192.192.1.4 WebLogicPort=7001
</Object>
#
## ------------- END SAMPLE OBJ.CONF CONFIGURATION ---------

示例 obj.conf 文件(使用 WebLogic 群集)

以下是在使用 WebLogic Server 群集的情况下应添加到 obj.conf 中的行示例:可以将此示例用作模板,对其进行修改以满足您的环境和服务器的需要。以 # 开始的行是注释。

注意: 请确保 obj.conf 文件中不包含任何额外的空格。从下面的示例中复制内容并对其进行粘贴有时会添加额外的空格,这可能导致在读取文件时出现问题。

有关详细信息,请参阅来自 Netscape 的有关 Enterprise Server 配置文件的完整文档。

## ------------- BEGIN SAMPLE OBJ.CONF CONFIGURATION ---------
# (using a WebLogic Cluster)
#
# The following line locates the NES library for loading at
# startup, and identifies which functions within the library are
# NES functions.Verify the path to the library (the value
# of the shlib=<...> parameter) and that the file is
# readable, or the server fails to start.
Init fn="load-modules" funcs="wl_proxy,wl_init"\
 shlib=/usr/local/netscape/plugins/libproxy.so
Init fn="wl_init"
# Configure which types of HTTP requests should be handled by the
# NES module (and, in turn, by WebLogic).This is done
# with one or more "<Object>" tags as shown below.
# Here we configure the NES module to pass requests for
# "/weblogic" to a cluster of WebLogic Servers.
<Object name="weblogic" ppath="*/weblogic/*">
Service fn=wl_proxy \
 WebLogicCluster="myweblogic.com:7001,yourweblogic.com:7001,\
 theirweblogic.com:7001" PathTrim="/weblogic"
</Object>
# Here we configure the plug-in so that requests that
# match "/servletimages/" are handled by the
# plug-in/WebLogic.
<Object name="si" ppath="*/servletimages/*">
Service fn=wl_proxy \
WebLogicCluster="myweblogic.com:7001,yourweblogic.com:7001,\
 theirweblogic.com:7001"
</Object>
# This Object directive works by file extension rather than
# request path.To use this configuration, you must also add
# a line to the mime.types file:
#
# type=text/jsp exts=jsp
#
# This configuration means that any file with the extension
# ".jsp" is proxied to WebLogic.Then you must add the
# Service line for this extension to the Object "default",
# which should already exist in your obj.conf file:
<Object name=default>
NameTrans fn=pfx2dir from=/ns-icons\
 dir="c:/Netscape/SuiteSpot/ns-icons"
NameTrans fn=pfx2dir from=/mc-icons\
 dir="c:/Netscape/SuiteSpot/ns-icons"
NameTrans fn="pfx2dir" from="/help" dir=\
 "c:/Netscape/SuiteSpot/manual/https/ug"
NameTrans fn=document-root root="c:/Netscape/SuiteSpot/docs"
Service method="(GET|HEAD|POST|PUT)" type=text/jsp fn=wl_proxy\
 WebLogicCluster="myweblogic.com:7001,yourweblogic.com:7001,\
 theirweblogic.com:7001",PathPrepend=/jspfiles
PathCheck fn=nt-uri-clean
PathCheck fn="check-acl" acl="default"
PathCheck fn=find-pathinfo
PathCheck fn=find-index index-names="index.html,home.html"
ObjectType fn=type-by-extension
ObjectType fn=force-type type=text/plain
Service method=(GET|HEAD) type=magnus-internal/imagemap\  fn=imagemap
Service method=(GET|HEAD) \
 type=magnus-internal/directory fn=index-common
Service method=(GET|HEAD) type=*~magnus-internal/* fn=send-file
AddLog fn=flex-log name="access"
</Object>
# The following directive enables HTTP-tunneling of the 
# WebLogic protocol through the NES plug-in.
<Object name="tunnel" ppath="*/HTTPClnt*">
Service fn=wl_proxy WebLogicCluster="myweblogic.com:7001,\
 yourweblogic.com:7001,theirweblogic.com:7001"
</Object>
#
## ------------- END SAMPLE OBJ.CONF CONFIGURATION ---------

 


设置边界身份验证

使用边界身份验证可确保通过 Netscape Enterprise Server 插件访问的 WebLogic Server 应用程序的安全。

WebLogic 标识声明提供程序对来自外部系统的访问 WebLogic Server 应用程序的标记进行身份验证,包括通过 Netscape Enterprise Server 插件访问 WebLogic Server 应用程序的用户。可按如下所示创建将确保插件安全的标识声明提供程序:

  1. 在 WebLogic Server 应用程序上创建一个自定义标识声明提供程序。请参阅“开发 WebLogic Server 的安全提供程序”中的如何开发自定义标识声明提供程序
  2. 配置自定义标识声明提供程序以支持“证书”标记类型并使其成为活动标记类型。请参阅“开发 WebLogic Server 的安全提供程序”中的如何创建新标记类型
  3. 在 Web 应用程序的 web.xml 部署描述符文件中将 clientCertProxy 特性设置为 True(如果使用群集,也可以选择在管理控制台中,依次选择“群集”-->“配置”-->“常规”选项卡,在该选项卡上对整个群集将 Client Cert Proxy Enabled 特性设置为 True)。请参阅“开发 WebLogic Server 的 Web 应用程序、Servlet 和 JSP”中的 context-param
  4. 设置了 clientCertProxy之后,请务必使用连接筛选器来确保 WebLogic Server 仅接受来自运行 Netscape Enterprise Server 插件的计算机的连接。请参阅“WebLogic 安全性编程”中的使用网络连接筛选器
  5. Web 服务器插件需要可信证书颁发机构文件才能在插件和 WebLogic Server 之间使用 SSL。使用 Sun Microsystems 的 Keytool 实用工具可从驻留在 BEA_HOME/weblogic90/server/lib 中的 DemoTrust.jks 密钥库文件中导出可信证书颁发机构文件。
    1. 例如,要解压缩 wlsdemoca 文件,可使用如下命令:
      keytool -export -file trustedcafile.der -keystore DemoTrust.jks -alias wlsdemoca
    2. 更改别名以从密钥库中获得不同的可信 CA 文件。

      要查看密钥库中的所有可信 CA 文件,请使用如下命令:
      keytool -list -keystore DemoTrust.jks

      如果提示输入密码,请按 Enter 键。

    3. 要将证书颁发机构文件转换为 pem 格式,请使用如下命令:java utils.der2pem trustedcafile.der

有关标识声明提供程序的详细信息,请参阅“开发 WebLogic Server 的安全提供程序”中的标识声明提供程序

 


将 SSL 与 NES 插件一起使用

可以使用安全套接口层 (SSL) 协议保护 Netscape Enterprise Server 插件和 WebLogic Server 之间的连接。SSL 协议对 Netscape Enterprise Server 插件和 WebLogic Server 之间传递的数据提供机密性和完整性。

Netscape Enterprise Server 插件不使用 HTTP 请求中(通常由浏览器)指定的传输协议(httphttps)来确定是否使用 SSL 协议来保护 Netscape Enterprise Server 插件和 WebLogic Server 之间的连接。

要在 Netscape Enterprise Server 插件和 WebLogic Server 之间使用 SSL 协议,请执行下列操作:

  1. 针对 SSL 配置 WebLogic Server。有关详细信息,请参阅配置 SSL
  2. 配置 WebLogic Server SSL 监听端口。有关详细信息,请参阅配置 SSL
  3. obj.conf 文件中,将 Service指令的 WebLogicPort 参数设置为步骤 2 中配置的监听端口
  4. obj.conf文件中,将 Service 指令中的 SecureProxy 参数设置为 ON
  5. obj.conf 文件的 Service指令中设置可定义有关 SSL 连接的信息的其他参数。有关参数的完整列表,请参阅 Web 服务器插件的 SSL 参数

 


连接错误和群集故障转移

当 Netscape Enterprise Server 插件尝试连接到 WebLogic Server 时,插件使用几个配置参数确定等待连接到 WebLogic Server 主机的时间长度,以及建立连接后插件等待响应的时间长度。如果插件无法连接或未收到响应,则插件将尝试连接到群集中的其他 WebLogic Server 并向其发送请求。如果连接失败或者没有来自群集中任何 WebLogic Server 的响应,则会发送错误消息。

图 5-1 说明插件如何处理故障转移。

连接失败的可能原因

WebLogic Server 主机无法响应连接请求可能表明存在主机计算机问题、网络问题或其他服务器故障。

所有 WebLogic Server 实例都无法做出响应可能表明 WebLogic Server 未运行或不可访问、服务器挂起、数据库问题或其他应用程序故障。

单个非群集 WebLogic Server 的故障转移

如果运行一个 WebLogic Server 实例,则插件将尝试连接到使用 WebLogicHost 参数定义的服务器。如果尝试失败,则会返回 HTTP 503 错误消息。插件继续尝试连接到 WebLogic Server,直到超出 ConnectTimeoutSecs

动态服务器列表

WebLogicCluster 参数中指定 WebLogic Server 列表时,插件将该列表用作在群集成员之间进行负载平衡的起点。将第一个请求路由到这些服务器之一后,会返回一个动态服务器列表,其中包含群集中已更新的服务器列表。更新的列表添加群集中的任何新服务器并删除不再属于群集或无法响应请求的任何服务器。当群集中发生更改时,会使用 HTTP 响应自动更新此列表。

故障转移、Cookie 和 HTTP 会话

当请求包含存储在 Cookie 或 POST 数据中的会话信息或按 URL 编码进行存储的会话信息时,会话 ID 会包含对最初建立会话的特定服务器(称为主服务器)的引用,并包含对复制原始会话的其他服务器(称为次级服务器)的引用。包含 Cookie 的请求会尝试连接到主服务器。如果该尝试失败,则会将该请求路由到次级服务器。如果主服务器和次级服务器均故障,则会话将丢失,插件将尝试与动态群集列表中的其他服务器建立新的连接。有关详细信息,请参阅图 5-1 连接故障转移

注意: 如果 POST 数据大于 64K,则插件将不会解析 POST 数据以获取会话 ID。因此,如果将会话 ID 存储在 POST 数据中,则插件无法将请求路由到正确的主服务器或次级服务器,从而可能导致会话数据丢失。

使用防火墙和负载调度器时的故障转移行为

在大多数配置中,Netscape Enterprise Server 插件将请求发送到群集的主实例。如果该实例不可用,则会将请求故障转移到次级实例。但是,在对防火器和负载调度器进行组合使用的一些配置中,任何一个服务器(防火器或负载调度器)都可以在 WebLogic Server 的主实例不可用时接受请求并返回一个成功连接。尝试将请求定向到 WebLogic Server 的主实例(该实例不可用)后,会将该请求作为“connection reset”返回给插件。

通过防火墙组合(有或没有负载调度器)发送的请求由 WebLogic Server 进行处理。换句话说,connection reset 的响应会故障转移到 WebLogic Server 的次级实例。由于在这些配置中 connection reset 的响应可以进行故障转移,因此 Servlet 必须是幂等的。否则可能导致重复的事务处理。

图 5-1 连接故障转移
连接故障转移<img src=" id="wp115261"/>

  返回顶部       上一页  下一页