<< OutOfMemoryError: unable to create new native thread | 首页 | 我收藏的链接(9) >>

为Weblogic9.2安装和配置Apache HTTP 服务器插件

 

下面内容来自Installing and Configuring the Apache HTTP Server Plug-In:

To install the Apache HTTP Server Plug-In as a dynamic shared object:

  1. Locate the shared object directory for your platform using Table 3-1.
  2. Identify the plug-in shared object file for your version of Apache in Table 3-2.
  3. Verify that the WebLogic Server Apache HTTP Server Plug-In mod_so.c module is enabled.

    The Apache HTTP Server Plug-In will be installed in your Apache HTTP Server installation as a Dynamic Shared Object (DSO). DSO support in Apache is based on a module mod_so.c, which must be enabled before mod_wl_20.so is loaded. If you installed Apache HTTP Server using the script supplied by Apache, mod_so.c is already enabled. Verify that mod_so.c is enabled by executing the following command:

    APACHE_HOME\bin\apache -l

    (Where APACHE_HOME is the directory containing your Apache HTTP Server installation.)

    This command lists all enabled modules. If mod_so.c is not listed, you must rebuild your Apache HTTP Server, making sure that the following options are configured:

    ...
    --enable-module=so
    --enable-rule=SHARED_CORE
    ...
    See Apache 2.0 Shared Object (DSO) Support at   http://httpd.apache.org/docs/2.0/dso.html.
  4. Install the Apache HTTP Server Plug-In module for Apache 2.0.x by copying the mod_wl_20.so file to the APACHE_HOME\modules directory and adding the following line to your APACHE_HOME/conf/httpd.conf file manually:
    LoadModule weblogic_module     modules/mod_wl_20.so
  5. Define any additional parameters for the Apache HTTP Server Plug-In.

    The Apache HTTP Server Plug-In recognizes the parameters listed in General Parameters for Web Server Plug-Ins. To modify the behavior of your Apache HTTP Server Plug-In, define these parameters:

    • In a Location block, for parameters that apply to proxying by path, or
    • In an IfModule block, for parameters that apply to proxying by MIME type.
  6. Verify the syntax of the APACHE_HOME\conf\httpd.conf file with the following command:
    APACHE_HOME\bin\apachectl -t 

    The output of this command reports any errors in your httpd.conf file or returns:

    Syntax OK
  7. Restart Weblogic Server.
  8. Start (or restart if you have changed the configuration) Apache HTTP Server.
  9. Test the plug-in by opening a browser and setting the URL to the Apache Server + "/weblogic/", which should bring up the default WebLogic Server HTML page, welcome file, or default servlet, as defined for the default Web Application on WebLogic Server. For example:
    http://myApacheserver.com/weblogic/

 

Configuring the Apache HTTP Server Plug-In

After installing the plug-in in the Apache HTTP Server, configure the WebLogic Server Apache Plug-In and configure the server to use the plug-in. This section explains how to edit the Apache httpd.conf file to instruct the Apache server to load the WebLogic Server library for the plug-in as an Apache module, and to specify the application requests that should be handled by the module.

Editing the httpd.conf File

Edit the httpd.conf file in your Apache HTTP server installation to configure the Apache HTTP Server Plug-In.

This section explains how to locate and edit the httpd.conf file, to configure the server to use the WebLogic Server Apache Plug-In, to proxy requests by path or by MIME type, to enable HTTP tunneling, and to use other WebLogic Server plug-in parameters.

  1. Open the httpd.conf file.

    The file is located at APACHE_HOME\conf\httpd.conf (where APACHE_HOME is the root directory of your Apache HTTP server installation). See a sample httpd.conf file at Setting Up Perimeter Authentication.

  2. Ensure that the WebLogic Server modules are included for Apache 2.0.x, manually add the following line to the httpd.conf file:
    LoadModule weblogic_module   modules\mod_wl_20.so
  3. Add an IfModule block that defines one of the following:

    For a non-clustered WebLogic Server:

    The WebLogicHost and WebLogicPort parameters.

    For a cluster of WebLogic Servers:

    The WebLogicCluster parameter.

    For example:

    <IfModule mod_weblogic.c>
      WebLogicHost myweblogic.server.com
      WebLogicPort 7001
    </IfModule>
  4. To proxy requests by MIME type, add a MatchExpression line to the IfModule block. Note that if both MIME type and proxying by path are enabled, proxying by path takes precedence over proxying by MIME type.

    For example, the following IfModule block for a non-clustered WebLogic Server specifies that all files with MIME type .jsp are proxied:

    <IfModule mod_weblogic.c>
      WebLogicHost myweblogic.server.com
      WebLogicPort 7001
      MatchExpression *.jsp
    </IfModule>

    You can also use multiple MatchExpressions, for example:

    <IfModule mod_weblogic.c>
      WebLogicHost myweblogic.server.com
      WebLogicPort 7001
      MatchExpression *.jsp
      MatchExpression *.xyz
    </IfModule>

    If you are proxying requests by MIME type to a cluster of WebLogic Servers, use the WebLogicCluster parameter instead of the WebLogicHost and WebLogicPort parameters. For example:

    <IfModule mod_weblogic.c>
      WebLogicCluster w1s1.com:7001,w1s2.com:7001,w1s3.com:7001
      MatchExpression *.jsp
      MatchExpression *.xyz
    </IfModule>
  5. To proxy requests by path, use the Location block and the SetHandler statement. SetHandler specifies the handler for the Apache HTTP Server Plug-In module. For example the following Location block proxies all requests containing /weblogic in the URL:
    <Location /weblogic>
      SetHandler weblogic-handler
    PathTrim /weblogic
    </Location>

    The PathTrim parameter specifies a string trimmed from the beginning of the URL before the request is passed to the WebLogic Server instance (see General Parameters for Web Server Plug-Ins).

  6. Optionally, enable HTTP tunneling for t3 or IIOP.
    1. To enable HTTP tunneling if you are using the t3 protocol and weblogic.jar, add the following Location block to the httpd.conf file:
      <Location /HTTPClnt>
        SetHandler weblogic-handler
      </Location>
    2. To enable HTTP tunneling if you are using the IIOP, the only protocol used by the WebLogic Server thin client, wlclient.jar, add the following Location block to the httpd.conf file:
      <Location /iiop>
        SetHandler weblogic-handler
      </Location>
  7. Define any additional parameters for the Apache HTTP Server Plug-In.

    The Apache HTTP Server Plug-In recognizes the parameters listed in General Parameters for Web Server Plug-Ins. To modify the behavior of your Apache HTTP Server Plug-In, define these parameters either:

    • In a Location block, for parameters that apply to proxying by path, or
    • In an IfModule block, for parameters that apply to proxying by MIME type.

General Parameters for Web Server Plug-Ins

Parameters are case sensitive.

Table 7-1 General Parameters for Web Service Plug-Ins
Parameter
Default
Description
WebLogicHost
(Required when proxying to a single WebLogic Server.)
none
WebLogic Server host (or virtual host name as defined in WebLogic Server) to which HTTP requests should be forwarded.
If you are using a WebLogic cluster, use the WebLogicCluster parameter instead of WebLogicHost.
WebLogicPort
(Required when proxying to a single WebLogic Server.)
none
Port at which the WebLogic Server host is listening for connection requests from the plug-in (or from other servers). (If you are using SSL between the plug-in and WebLogic Server, set this parameter to the SSL listen port (see Configuring the SSL Protocol) and set the SecureProxy parameter to ON).
If you are using a WebLogic Cluster, use the WebLogicCluster parameter instead of WebLogicPort.
WebLogicCluster
(Required when proxying to a cluster of WebLogic Servers.)
none
List of WebLogic Servers that can be used for load balancing. The server or cluster list is a list of host:port entries. If a mixed set of clusters and single servers is specified, the dynamic list returned for this parameter will return only the clustered servers.
The method of specifying the parameter, and the required format vary by plug-in. See the examples in:
  • Installing and Configuring the Netscape Enterprise Server Plug-In (NSAPI)
  • Installing and Configuring the Microsoft Internet Information Server (ISAPI) Plug-In
  • Installing and Configuring the Apache HTTP Server Plug-In
If you are using SSL between the plug-in and WebLogic Server, set the port number to the SSL listen port (see Configuring the SSL Protocol) and set the SecureProxy parameter to ON.
The plug-in does a simple round-robin between all available servers. The server list specified in this property is a starting point for the dynamic server list that the server and plug-in maintain. WebLogic Server and the plug-in work together to update the server list automatically with new, failed, and recovered cluster members.
You can disable the use of the dynamic cluster list by setting the DynamicServerList parameter to OFF
The plug-in directs HTTP requests containing a cookie, URL-encoded session, or a session stored in the POST data to the server in the cluster that originally created the cookie.
PathTrim
null
String trimmed by the plug-in from the beginning of the original URL, before the request is forwarded to WebLogic Server. For example, if the URL
http://myWeb.server.com/weblogic/foo
is passed to the plug-in for parsing and if PathTrim has been set to strip off /weblogic before handing the URL to WebLogic Server, the URL forwarded to WebLogic Server is:
http://myWeb.server.com:7001/foo
Note that if you are newly converting an existing third-party server to proxy requests to WebLogic Server using the plug-in, you will need to change application paths to /foo to include weblogic/foo. You can use PathTrim and PathPrepend in combination to change this path.
PathPrepend
null
String that the plug-in prepends to the beginning of the original URL, after PathTrim is trimmed and before the request is forwarded to WebLogic Server.
ConnectTimeoutSecs
10
Maximum time in seconds that the plug-in should attempt to connect to the WebLogic Server host. Make the value greater than ConnectRetrySecs. If ConnectTimeoutSecs expires without a successful connection, even after the appropriate retries (see ConnectRetrySecs), an HTTP 503/Service Unavailable response is sent to the client.
You can customize the error response by using the ErrorPage parameter.
ConnectRetrySecs
2
Interval in seconds that the plug-in should sleep between attempts to connect to the WebLogic Server host (or all of the servers in a cluster). Make this number less than the ConnectTimeoutSecs. The number of times the plug-in tries to connect before returning an HTTP 503/Service Unavailable response to the client is calculated by dividing ConnectTimeoutSecs by ConnectRetrySecs.
To specify no retries, set ConnectRetrySecs equal to ConnectTimeoutSecs. However, the plug-in attempts to connect at least twice.
You can customize the error response by using the ErrorPage parameter.
Debug
OFF
Sets the type of logging performed for debugging operations. The debugging information is written to the /tmp/wlproxy.log file on UNIX systems and c:\TEMP\wlproxy.log on Windows NT/2000 systems. Override this location and filename by setting the WLLogFile parameter to a different directory and file. Ensure that the tmp or TEMP directory has write permission assigned to the user who is logged in to the server. Set any of the following logging options (HFC,HTW,HFW, and HTC options may be set in combination by entering them separated by commas, for example "HFC,HTW"):

ON

The plug-in logs informational and error messages.

OFF

No debugging information is logged.

HFC

The plug-in logs headers from the client, informational, and error messages.

HTW

The plug-in logs headers sent to WebLogic Server, and informational and error messages.

HFW

The plug-in logs headers sent from WebLogic Server, and informational and error messages.

HTC

The plug-in logs headers sent to the client, informational messages, and error messages.

ERR

Prints only the Error messages in the plug-in.

ALL

The plug-in logs headers sent to and from the client, headers sent to and from WebLogic Server, information messages, and error messages.
WLLogFile
See the Debug parameter
Specifies path and file name for the log file that is generated when the Debug parameter is set to ON. You must create this directory before setting this parameter.
WLDNSRefreshInterval
0 (Lookup once, during startup)
Only applies to NSAPI and Apache.
If defined in the proxy configuration, specifies number of seconds interval at which WebLogic Server refreshes DNS name to IP mapping for a server. This can be used in the event that a WebLogic Server instance is migrated to a different IP address, but the DNS name for that server's IP remains the same. In this case, at the specified refresh interval the DNS<->IP mapping will be updated.
WLTempDir
See the Debug parameter
Specifies the directory where a wlproxy.log will be created. If the location fails, the Plug-In resorts to creating the log file under C:/temp in Windows and /tmp in all Unix platforms.
Also specifies the location of the _wl_proxy directory for post data files.
When both WLTempDir and WLLogFile are set, WLLogFile will override as to the location of wlproxy.log. WLTempDir will still determine the location of _wl_proxy directory.
DebugConfigInfo
OFF
Enables the special query parameter "__WebLogicBridgeConfig". Use it to get details about configuration parameters from the plug-in.
For example, if you enable "__WebLogicBridgeConfig" by setting DebugConfigInfo and then send a request that includes the query string ?__WebLogicBridgeConfig, then the plug-in gathers the configuration information and run-time statistics and returns the information to the browser. The plug-in does not connect to WebLogic Server in this case.
This parameter is strictly for debugging and the format of the output message can change with releases. For security purposes, keep this parameter turned OFF in production systems.
StatPath
(Not available for the Microsoft Internet Information Server Plug-In)
false
If set to true, the plug-in checks the existence and permissions of the translated path ("Proxy-Path-Translated") of the request before forwarding the request to WebLogic Server.
If the file does not exist, an HTTP 404 File Not Found response is returned to the client. If the file exists but is not world-readable, an HTTP 403/Forbidden response is returned to the client. In either case, the default mechanism for the Web server to handle these responses fulfills the body of the response. This option is useful if both the WebLogic Server Web Application and the Web Server have the same document root.
You can customize the error response by using the ErrorPage parameter.
ErrorPage
none
You can create your own error page that is displayed when your Web server is unable to forward requests to WebLogic Server.
WLSocketTimeoutSecs
2 (must be greater than 0)
Set the timeout for the socket while connecting, in seconds.
WLIOTimeoutSecs (new name for HungServerRecoverSecs)
300
Defines the amount of time the plug-in waits for a response to a request from WebLogic Server. The plug-in waits for HungServerRecoverSecs for the server to respond and then declares that server dead, and fails over to the next server. The value should be set to a very large value. If the value is less than the time the servlets take to process, then you may see unexpected results.
Minimum value: 10
Maximum value: Unlimited
Idempotent
ON
When set to ON and if the servers do not respond within WLIOTimeoutSecs (new name for HungServerRecoverSecs), the plug-ins fail over.
If set to "OFF" the plug-ins do not fail over. If you are using the Netscape Enterprise Server Plug-In, or Apache HTTP Server you can set this parameter differently for different URLs or MIME types.
CookieName
JSESSIONID
If you change the name of the WebLogic Server session cookie in the WebLogic Server Web application, you need to change the CookieName parameter in the plug-in to the same value. The name of the WebLogic session cookie is set in the WebLogic-specific deployment descriptor, in the <session-descriptor> element.
DefaultFileName
none
If the URI is "/" then the plug-in performs the following steps:
  1. Trims the path specified with the PathTrim parameter.
  2. Appends the value of DefaultFileName.
  3. Prepends the value specified with PathPrepend.
This procedure prevents redirects from WebLogic Server.
Set the DefaultFileName to the default welcome page of the Web Application in WebLogic Server to which requests are being proxied. For example, If the DefaultFileName is set to welcome.html, an HTTP request like "http://somehost/weblogic" becomes "http://somehost/weblogic/welcome.html". For this parameter to function, the same file must be specified as a welcome file in all the Web Applications to which requests are directed. For more information, see " Configuring Welcome Pages".
Note for Apache users: If you are using Stronghold or Raven versions, define this parameter inside of a Location block, and not in an IfModule block.
MaxPostSize
-1
Maximum allowable size of POST data, in bytes. If the content-length exceeds MaxPostSize, the plug-in returns an error message. If set to -1, the size of POST data is not checked. This is useful for preventing denial-of-service attacks that attempt to overload the server with POST data.
MatchExpression
(Apache HTTP Server only)
none
When proxying by MIME type, set the filename pattern inside of an IfModule block using the MatchExpression parameter.
Example when proxying by MIME type:
<IfModule mod_weblogic.c>
MatchExpression *.jsp    WebLogicHost=myHost|paramName=value
</IfModule>
Example when proxying by path:
<IfModule mod_weblogic.c>
MatchExpression /weblogic    WebLogicHost=myHost|paramName=value
</IfModule>
It is possible to define a new parameter for MatchExpression using the following syntax:
MatchExpression *.jsp PathPrepend=/test PathTrim=/foo
FileCaching
ON
When set to ON, and the size of the POST data in a request is greater than 2048 bytes, the POST data is first read into a temporary file on disk and then forwarded to the WebLogic Server in chunks of 8192 bytes. This preserves the POST data during failover, allowing all necessary data to be repeated to the secondary if the primary goes down.
Note that when FileCaching is ON, any client that tracks the progress of the POST will see that the transfer has completed even though the data is still being transferred between the WebServer and WebLogic. So, if you want the progress bar displayed by a browser during the upload to reflect when the data is actually available on the WebLogic Server, you might not want to have FileCaching ON.
When set to OFF and the size of the POST data in a request is greater than 2048 bytes, the reading of the POST data is postponed until a WebLogic Server cluster member is identified to serve the request. Then the Plugin reads and immediately sends the POST data to the WebLogic Server in chunks of 8192 bytes.
Note that turning FileCaching OFF limits failover. If the WebLogic Server primary server goes down while processing the request, the POST data already sent to the primary cannot be repeated to the secondary.
Finally, regardless of how FileCaching is set, if the size of the POST data is 2048 bytes or less the plugin will read the data into memory and use it if needed during failover to repeat to the secondary.
FilterPriorityLevel
(Microsoft Internet Information Server only)
2
The values for this parameter are 0 (low), 1 (medium), and 2 (high). The default value is 2. This priority should be put in iisforward.ini file. This property is used to set the priority level for the iisforward.dll filter in IIS. Priority level is used by IIS to decide which filter will be invoked first, in case multiple filters match the incoming request.
WLExcludePathOrMimeType
none
This parameter allows you make exclude certain requests from proxying.
This parameter can be defined locally at the Location tag level as well as globally. When the property is defined locally, it does not override the global property but defines a union of the two parameters.
WlForwardPath
(Microsoft Internet Information Server only)
null
If WlForwardPath is set to "/" all requests are proxied. To forward any requests starting with a particular string, set WlForwardPath to the string. For example, setting WlForwardPath to /weblogic forwards all requests starting with /weblogic to Weblogic Server.
This parameter is required if you are proxying by path. You can set multiple strings by separating the strings with commas. For example: WlForwardPath=/weblogic,/bea.
KeepAliveSecs
20
The length of time after which an inactive connection between the plug-in and WebLogic Server is closed. You must set KeepAliveEnabled to true (ON when using the Apache plug-in) for this parameter to be effective.
The value of this parameter must be less than or equal to the value of the Duration field set in the Administration Console on the Server/HTTP tab, or the value set on the server Mbean with the KeepAliveSecs attribute.
KeepAliveEnabled
true (Netscape and Microsoft IIS plug-ins)
ON (Apache plug-in)
Enables pooling of connections between the plug-in and WebLogic Server.
Valid values for the Netscape and Microsoft IIS plug-ins are true and false.
Valid values for the Apache plug-in are ON and OFF.
QueryFromRequest
(Apache HTTP Server only)
OFF
When set to ON, specifies that the Apache plug-in use
(request_rec *)r->the request
to pass the query string to WebLogic Server. (For more information, see your Apache documentation.) This behavior is desirable in the following situations:
  • When a Netscape version 4.x browser makes requests that contain spaces in the query string
  • If you are using Raven Apache 1.5.2 on HP
When set to OFF, the Apache plug-in uses
(request_rec *)r->args to pass the query string to WebLogic Server.
MaxSkipTime
10
If a WebLogic Server listed in either the WebLogicCluster parameter or a dynamic cluster list returned from WebLogic Server fails, the failed server is marked as "bad" and the plug-in attempts to connect to the next server in the list.
MaxSkips sets the amount of time after which the plug-in will retry the server marked as "bad." The plug-in attempts to connect to a new server in the list each time a unique request is received (that is, a request without a cookie).
DynamicServerList
ON
When set to OFF, the plug-in ignores the dynamic cluster list used for load balancing requests proxied from the plug-in and only uses the static list specified with the WebLogicCluster parameter. Normally this parameter should remain set to ON.
There are some implications for setting this parameter to OFF:
  • If one or more servers in the static list fails, the plug-in could waste time trying to connect to a dead server, resulting in decreased performance.
  • If you add a new server to the cluster, the plug-in cannot proxy requests to the new server unless you redefine this parameter. WebLogic Server automatically adds new servers to the dynamic server list when they become part of the cluster.
WLProxySSL
OFF
Set this parameter to ON to maintain SSL communication between the plug-in and WebLogic Server when the following conditions exist:
  • An HTTP client request specifies the HTTPS protocol
  • The request is passed through one or more proxy servers (including the WebLogic Server proxy plug-ins)
  • The connection between the plug-in and WebLogic Server uses the HTTP protocol
When WLProxySSL is set to ON, the location header returned to the client from WebLogic Server specifies the HTTPS protocol.
WLLocalIP
none
Defines the IP address to bind to when the plug-in connects to a WebLogic Server instance running on a multihomed machine.
If WLLocalIP is not set, a random IP address on the multi-homed machine is used.



发表评论 发送引用通报