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.

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-1 shows the procedure for setting up the proxy server.

Figure A-1 Setting Up a Proxy Server

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

To set up a proxy server:

  1. Create the directory structure.

    For example: /opt/g80/mslvcluster/mslvdomain.

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

  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 Linux, enter the following command:

        touch weblogic.xml
    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-2.

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

      jar cvf mslvProxy.war WEB-INF
  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 Remote Console.

    2. In the Edit 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 Shopping Cart, click Commit Changes.

  7. To configure the proxy server, in the Remote Console, 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 Create.

    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.)

  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://host_admin:7001
    SERVER_NAME=mslvProxyServer
    WLS_USER=weblogic
    WLS_PW=
    JAVA_VM=-server
    MEM_ARGS=-Xms512m -Xmx512m -XX:NewRatio=4
  11. Start the proxy server by running the following command:
    startManagedWeblogic.sh
  12. From the WebLogic Remote Console, in the Edit 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 Edit Tree, then click Deployments and then click App Deployments.

    2. Click New.

      The Create a new Application Deployment page opens.

    3. Enter a name for the application.

    4. In Targets, select the servers and clusters to which you want to deploy the application.

      In the Available section, select the cluster. For example, select mslvcluster. Select All servers in the cluster.

    5. Enable the Upload option.

      Then, beside Source, click Choose File to browse to the deploy directory and select mslvProxy.war. For example, MSLV_Home/deploy.

    6. Select Start Application for On Deployment.

    7. Click Create.

    8. In Shopping Cart, select Commit Changes.

    9. Ensure that the state of the mslvProxy application is Active.