,,,,open-sourcefreecluster。!
:DownloadApache 》http://httpd.apache.org/download.cgi#apache22as shown in the figure below:
version2.4.9,HoweverBecause,version!
:Downloadmod_jk(Apachemodule,JVAV platformWEB server)
DownloadAddress:
http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.31/
mod_jk-1.2.31-httpd-2.2.3.so,IfhttpserverApache2.0.Xversion,mod_jk-1.2.31-httpd-2.0.52.so,apacheversion,jk!OK?
:InstallationDownloadfile:
InstallationApache,InstallationConfiguration、ManagementEmail,,Then,configuration file。,80port(iis)。Installationpath,。default。Installationsuccess,system,Startapache,If,DescriptionserviceStart(IfserviceStart,DescriptionInstallationConfigurationerror,)。Ifdefault,port80,,:http://localhost/ , " It works “。。as shown in the figure below:
as shown in the figure below:
:Configuration
InstallationApachehttpd.conffile,:
Add:
conffilemod_jk.conffile
Configuration:
modulesfile,Downloadmod_jk-1.2.31-httpd-2.2.3.sofile;xxx.so;as shown in the figure below:
conffileworkers.propertiesfile,Configuration:
:Tomcat,Tomcatproblem,portport,,,HoweverhostConfigurationIPAddress,!
ConfigurationTomcatserver.xmlfile,port,Server,Connector,Connector AJP,port,Downloadserver.xmlfile。
Configuration:
:Configurationload balancing,Configurationsessionreplication,serversession
Configuration:,,webTesting:
web,web.xmlfileAdd,distributableservlet/JSP,distributedWeb!
ok,jspTesting,Testing,Testing:
- <%@ page contentType="text/html; charset=GBK" %>
- <%@ page import="java.util.*" %>
- <html><head><title>Cluster App Test</title></head>
- <body>
- Server Info:
- <%
- out.println(request.getLocalAddr() + " : " + request.getLocalPort()+"<br>");%>
- <%
- out.println("<br> ID " + session.getId()+"<br>");
- // If Session Settings
- String dataName = request.getParameter("dataName");
- if (dataName != null && dataName.length() > 0) {
- String dataValue = request.getParameter("dataValue");
- session.setAttribute(dataName, dataValue);
- }
- out.println("<b>Session </b><br>");
- System.out.println("============================");
- Enumeration e = session.getAttributeNames();
- while (e.hasMoreElements()) {
- String name = (String)e.nextElement();
- String value = session.getAttribute(name).toString();
- out.println( name + " = " + value+"<br>");
- System.out.println( name + " = " + value);
- }
- %>
- <form action="test2.jsp" method="POST">
- :<input type=text size=20 name="dataName">
- <br>
- :<input type=text size=20 name="dataValue">
- <br>
- <input type=submit>
- </form>
- </body>
- </html>
webTomcat1,Tomcat2,classfile,ThenStarttomcat1,Tomcat2,Start,FinallyStartApache
:http://127.0.0.1/test/test2.jsp:,,Tomcat1,Tomcat2
sessionID,Tomcat,
dataTomcat:
,clustersessionreplicationsuccess,tomcatsession,clusterConfiguration,,,。
Additionally:Server Info : null IPAddress?,problem,,!
,,,!….
fileDownloadAddress:
,configuration file,Apache,jk,Download!
BlogAddress:http://1936625305.blog.51cto.com/6410597/1406268















