HttpClusterServlet Configuration (Weblogic Server Acting as a Proxy)

To make a weblogic server act as a webserver, HttpClusterServlet is used. Below are the steps to create it:

–    Create 3 managed servers and add 2 managed servers to a cluster, let the third managed server be a standalone server

– Create 3 managed servers and add 2 managed servers to a cluster, let the third managed server be a standalone server
– Develop an application which will enable the managed server to act as a web server.
– Make a directory as D:\Apps\HttpClusterServlet in your disk which will be the directory of your application. Make a directory WEB-INF in HttpClusterServlet folder.

–    Now create web.xml inside WEB-INF and write the below in the xml file:

<?xml version=”1.0″ encoding=”UTF-8″?>

<web-app xmlns=”http://java.sun.com/xml/ns/j2ee”>

<servlet>
<servlet-name>HttpClusterServlet</servlet-name>
<servlet-class>weblogic.servlet.proxy.HttpClusterServlet</servlet-class>
<init-param>
<param-name>WebLogicCluster</param-name>
<param-value>localhost:7003|localhost:7005</param-value>
</init-param>
<init-param>
<param-name>verbose</param-name>
<param-value>true</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>

–    Now create weblogic.xml in WEB-INF and write the below in the file.

<?xml version=”1.0″ encoding=”UTF-8″?>
<weblogic-web-app xmlns=”http://www.bea.com/ns/weblogic/90″>
<context-root>/</context-root>
</weblogic-web-app>

–    Now deploy the application HttpClusterServlet on the standalone server as below:

–    Now deploy your web application on the cluster as:

–    Now hit the application with the port of the ProxyMS which is 7007. Url would be something like http://127.0.0.1:7007/Jsp/one.jsp. The jsp page should appear.

If you have any questions, please let us know and we will be glad to help you.

Best Regards.

Now deploy your application on the cluster as:

Latest Comments

  1. kumar July 12, 2011
    • divya July 24, 2011
  2. Naveen September 23, 2011
  3. Preety April 2, 2013
    • Administrator January 16, 2014

Leave a Reply