A Proxy Server Setup

In a clustered environment, you typically have multiple servers running on different machines. To transparently connect to one of the servers, a central routing server is required to direct the client to one of the clustered servers. The routing server can be a hardware-based (load balancer) or software-based (proxy server) solution. This appendix describes how to configure and set up the optional Oracle-provided proxy server.

The Oracle proxy server is not recommended because it cannot support more than 150 concurrent user sessions.

Figure A-1 shows a proxy server in a clustered environment. The proxy server directs the data traffic between the clustered servers, mslv01 and mslv02.

Proxy Server Files

The following files (web.xml and weblogic.xml) are necessary for the proxy server setup. Refer to "Setting up the Proxy Server" for the steps required to create the files.

  • web.xml

<!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>
       srvrchosa1:6001|srvrchosa2:6001
    </param-value> 
  </init-param>
<!--The following two init-parameter tags are required if the proxy server is set up using SSL in a clustered environment.-->
<init-param>
  <param-name>SecureProxy</param-name> 
  <param-value>ON</param-value> 
</init-param>
<init-param>
  <param-name>DebugConfigInfo</param-name>
  <param-value>ON</param-value>
</init-param>
</servlet>
<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>
</web-app>
  • weblogic.xml

<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
  <weblogic-web-app>
    <context-root>/</context-root>
  </weblogic-web-app>

Setting up the Proxy Server

Figure A-2 shows the procedure for setting up the proxy server.

Figure A-2 Setting Up a Proxy Server

Description of Figure A-2 follows
Description of "Figure A-2 Setting Up a Proxy Server"

To set up a proxy server:

  1. Create the directory structure.

    For example: /opt/g63/mslvcluster/m63domain.

  2. Install Oracle WebLogic Server on the proxy server machine.

    For example: srvrchscal1

  3. Prepare the mslvProxy.war file

    1. Create a WEB-INF directory under the proxy directory.

    2. On the proxy server machine, create a file named web.xml and copy the contents as shown previously, in "Proxy Server Files".

    3. Copy the file into the WEB-INF directory.

      • For Windows, enter the following command:

        notepad web.xml
      • For UNIX/Linux, enter the following command:

        touch web.xml
    4. On the proxy server machine, create a file named weblogic.xml and copy the contents as shown previously, in "Proxy Server Files".

    5. Copy the file into the WEB-INF directory.

      • For Windows, enter the following command:

        notepad weblogic.xml
      • For UNIX/Linux, enter the following command:

        touch weblogic.xml

      Figure A-3 shows the files copied into the newly created WEB-INF directory.

      Figure A-3 Command Prompt Window Showing WEB-INF Directory

      Description of Figure A-3 follows
      Description of "Figure A-3 Command Prompt Window Showing WEB-INF Directory"
    6. In the web.xml file, add all managed server host machine names and ports in the manner shown in the bold text in Figure A-4.

    7. Go to the parent of the WEB-INF directory and type the following command and press ENTER:

      jar cvf mslvProxy.war WEB-INF

      Figure A-5 shows the command typed at the command line.

      Figure A-5 Command Prompt Window

      Description of Figure A-5 follows
      Description of "Figure A-5 Command Prompt Window"
  4. FTP the proxy.war file to the administration server.

  5. Start the administration server if it is not running.

  6. Create a WebLogic machine for the proxy server by completing the following tasks:

    1. Log in to the WebLogic Server Administration Console.

    2. In the Domain Structure tree, expand Environment and then select Machines.

    3. In the Summary of Machines pane, click New.

    4. In the Create a New Machine pane, enter the name of the machine that will host the proxy server in the Name field, select the Machine OS type, and click Ok.

    5. In the Change Center pane, click Activate Changes.

  7. To configure the proxy server, in the left pane, select Environment, select Servers, and then select New in the right pane.

    The Create a New Server pane appears.

  8. In the Create a New Server pane, enter the following information into the appropriate fields for the proxy server: Name, Machine, Listen Address, and Listen Port and click Finish.

    Worksheet references and example values:

    Field Name Worksheet Reference Number Example Value

    Name

    Proxy-0610

    mslvProxyServer

    Machine

    Proxy-0620

    srvplscal1

    Listen Address

    Proxy-0620

    srvplscal1

    Listen Port

    Proxy-0630

    6001

  9. Copy the startManagedWeblogic file to the domain/bin directory. (This script will be used to start the proxy server.)

    Figure A-6 shows the srvplscal1_mss63 window.

    Figure A-6 srvplscal1_mss63 Window

    Description of Figure A-6 follows
    Description of "Figure A-6 srvplscal1_mss63 Window"
  10. Edit the startManagedWebLogic file, including new values for the parameters in the following list.

    Example values from the proxy worksheet are included in the list.

    ADMIN_URL=http://srvrchscal:7001
    SERVER_NAME=mslvProxyServer
    WLS_USER=weblogic
    WLS_PW=web_logic
    JAVA_VM=-server
    MEM_ARGS=-Xms512m -Xmx512m -XX:NewRatio=4
  11. Start the proxy server.

    Figure A-7 shows the command for starting the proxy server.

    Figure A-7 Command for Starting the Proxy Server

    Description of Figure A-7 follows
    Description of "Figure A-7 Command for Starting the Proxy Server"
  12. From the WebLogic Server Administration Console, under the Domain Structure tree, expand Environment and then select Servers to see the updated list of servers and to view the state of the proxy server.

  13. Configure the server and deploy the proxy.war file by completing the following tasks

    1. In the Change Center pane, click Lock and Edit.

    2. Expand the Domain Structure tree and click Deployments.

      The Summary of Deployments pane appears.

    3. On the Control tab, click Install.

      The Install Application Assistant pane appears.

    4. Under Current Location, navigate to the deploy directory and select mslvProxy.war, then click Next.

      The Choose targeting style pane appears.

    5. Select Install this deployment as an application and click Next.

      The Select deployment targets pane appears.

    6. Under Clusters, select the proxy server that was created in step 7.

    7. Under Source accessibility, select I will make the deployment accessible from the following location.

    8. Click Finish.

    9. In the Change Center pane, click Activate Changes.

    10. Expand the Domain Structure tree and click Deployments.

      The Summary of Deployments pane appears.

    11. Select mslvProxy.

    12. From the Start list, select Servicing all requests.

      The Start Application Assistant pane appears.

    13. Click Yes.

      Ensure that the state of the mslvProxy application has changed from Prepared to Active.