|
|
http://e-docs.bea.com/wls/docs100/cluster/setup.html#wp684345
To use the HTTP cluster servlet, configure it as the default web application on your proxy server machine, as described in the steps below. For an introduction to web applications, see Overview of Web Applications in Developing Web Applications for WebLogic Server.
web.xml deployment descriptor file for the servlet. This file must reside in the \WEB-INF subdirectory of the web application directory. A sample deployment descriptor for the proxy servlet is provided in Sample web.xml. For more information on web.xml, see Understanding Web Applications, Servlets, and JSPs in Developing Web Applications, Servlets, and JSPs for WebLogic Server.
<servlet> element in web.xml. The servlet name is HttpClusterServlet. The servlet class is weblogic.servlet.proxy.HttpClusterServlet.
<servlet> element in web.xml, by defining the WebLogicCluster parameter.
<KeyStore> initialization parameters to use two-way SSL with your own identity certificate and key. If no <KeyStore> is specified in the deployment descriptor, the proxy will assume one-way SSL.
<KeyStore> - The key store location in your Web application.
<KeyStoreType> - The key store type. If it is not defined, the default type will be used instead.
<PrivateKeyAlias> - The private key alias.
<KeyStorePasswordProperties> - A property file in your Web application that defines encrypted passwords to access the key store and private key alias. The file contents looks like this: KeyStorePassword={3DES}i4+50LCKenQO8BBvlsXTrg\=\=
PrivateKeyPassword={3DES}a4TcG4mtVVBRKtZwH3p7yA\=\=
weblogic.security.Encrypt command-line utility to encrypt the password. For more information on the Encrypt utility, as well as the CertGen, and der2pem utilities, see Using the WebLogic Server Java Utilities in the WebLogic Server Command Reference. <servlet-mapping> stanzas to specify the requests that the servlet will proxy to the cluster, using the <url-pattern> element to identify specific file extensions, for example *.jsp, or *.html. Define each pattern in a separate <servlet-mapping> stanza.
You can set the <url-pattern> to "/" to proxy any request that cannot be resolved by WebLogic Server to the remote server instance. If you do so, you must also specifically map the following extensions: *.jsp, *.html, and *.html, to proxy files ending with those extensions. For an example, see Sample web.xml.
weblogic.xml deployment descriptor file for the servlet. This file must reside in the \WEB-INF subdirectory of the web application directory.
Assign the proxy servlet as the default web application for the Managed Server on the proxy machine by setting the <context-root> element to a forward slash character (/) in the <weblogic-web-app> stanza. For an example, see Sample weblogic.xml.
This section contains a sample deployment descriptor file (web.xml) for HttpClusterServlet.
web.xml defines parameters that specify the location and behavior of the proxy servlet: both versions of the servlet:
DOCTYPE stanza specifies the DTD used by WebLogic Server to validate web.xml.
servlet stanza:
weblogic.jar in your WL_HOME/server/lib directory. You do not have to specify the servlet's full directory path in web.xml because weblogic.jar is put in your CLASSPATH when you start WebLogic Server.
WebLogicCluster parameter.
servlet-mapping stanzas specify that the servlet will proxy URLs that end in '/', 'htm', 'html', or 'jsp' to the cluster. For parameter definitions see Proxy Servlet Deployment Parameters.
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd";>
<web-app>
<servlet>
<servlet-name>HttpClusterServlet</servlet-name>
<servlet-class>
weblogic.servlet.proxy.HttpClusterServlet
</servlet-class>
<init-param>
<param-name>WebLogicCluster</param-name>
<param-value>hostname1:7736|hostname2:7736|hostname:7736</param-value>
</init-param>
<init-param><param-name>KeyStore</param-name><param-value>/mykeystore</param-value></init-param>
<init-param><param-name>KeyStoreType</param-name><param-value>jks</param-value></init-param>
<init-param><param-name>PrivateKeyAlias</param-name><param-value>passalias</param-value></init-param>
<init-param><param-name>KeyStorePasswordProperties</param-name><param-value>mykeystore.properties</param-value></init-param>
<servlet-mapping>
<servlet-name>HttpClusterServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>HttpClusterServlet</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>HttpClusterServlet</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>HttpClusterServlet</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
This section contains a sample weblogic.xml file. The <context-root> deployment parameter is set to "/". This makes the proxy servlet the default web application for the proxy server.
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 9.1//EN" "http://www.bea.com/servers/wls810/dtd/weblogic
810-web-jar.dtd">
<weblogic-web-app>
<context-root>/</context-root>
</weblogic-web-app>
Key parameters for configuring the behavior of the proxy servlet in web.xml are listed in Table 10-1.
The parameters for the proxy servlet are the same as those used to configure WebLogic Server plug-ins for Apache, Microsoft, and Netscape web servers. For a complete list of parameters for configuring the proxy servlet and the plug-ins for third-part web servers see Parameters for Web Server Plug-insin Using WebLogic Server with Plug-ins.
The syntax for specifying the parameters, and the file where they are specified, is different for the proxy servlet and for each of the plug-ins.
For the proxy servlet, specify the parameters in web.xml, each in its own <init-param> stanza within the <servlet> stanza of web.xml. For example:
<init-param>
<param-name>ParameterName</param-name>
<param-value>ParameterValue</param-value>
</init-param>
<init-param>port|WLS2.com:port</param-value> | |
<init-param> ParameterValue</param-value> If set to ON, you can query the HttpClusterServlet for debugging information by adding a request parameter of ?__WebLogicBridgeConfig to any request. (Note: There are two underscore ( _ ) characters after the ?.) For security reasons, it is recommended that you set the DebugConfigInfo parameter to OFF in a production environment. | |
|
Interval in seconds that the servlet will sleep between attempts to connect to a server instance. Assign a value less than
ConnectTimeoutSecs. | |
|
Maximum time in seconds that the servlet will attempt to connect to a server instance. Assign a value greater than
ConnectRetrySecs. | |
|
String trimmed by the plug-in from the beginning of the original URL, before the request is forwarded to the cluster.
| |
|
This setting is useful if user authentication is performed on the proxy server—setting
clientCertProxy to true causes the proxy server to pass on the certs to the cluster in a special header, WL-Proxy-Client-Cert. The
WL-Proxy-Client-Cert header can be used by any client with direct access to WebLogic Server. WebLogic Server takes the certificate information from that header, trusting that is came from a secure source (the plug-in) and uses that information to authenticate the user. For this reason, if you set clientCertProxy to true, use a connection filter to ensure that WebLogic Server accepts connections only from the machine on which the plug-in is running. See Using Network Connection Filters in Programming WebLogic Security. | |
Ensure that applications clients will access via the proxy server are deployed to your cluster. Address client requests to the listen address and listen port of the proxy server.
Each of the server instances in the configuration must have a unique combination of Listen Address and Listen Port.
If you get a page not found error when you try to your application, make sure that weblogic.xml is in \WEB-INF for the application and that it sets the context-root deployment parameter to "/".
If you are having problems try rebooting all your servers, some of the changes you made while configuring your setup may not have been persisted to the configuration file.
To verify the configuration of the HttpClusterServlet:
DebugConfigInfo parameter in web.xml to ON.
http://myServer:port/placeholder.jsp?__WebLogicBridgeConfig
myServer is the Managed Server on the proxy machine where HttpClusterServlet runs,
port is the port number on that server that is listening for HTTP requests, and
placeholder.jsp is a file that does not exist on the server.
The plug-in gathers configuration information and run-time statistics and returns the information to the browser. For more information, see Parameters for Web Server Plug-insin Using WebLogic Server with Plug-ins.
