Apache 2.0.4 + Tomcat 5.5 Load Balancing and SESSION Binding

xiaoxiao2021-03-06  72

1. Select two servers, one of the Server1 installed Apache and Tomcat, another Server2 Tomcat

2, download the connect_jk2.so file to% apache_home% / modules / directory.

3, modify the% apache_home% / conf / httpd.conf file, add the following code in the appropriate position: LoadModule JK2_Module Modules / Mod_jk2.so

4. Create a workers2.properties file in% apache_home% / conf / con, as follows:

[Logger.Apache2]

Level = Debug

# The first Tomcat configuration

[channel.socket: Tomcat1]

Port = 8009

Host = Server1 # Server 1 IP

# Define Worker

[AJP13: Tomcat1]

Channel = CHANNEL. Socket: Tomcat1

# 第二 第二 t 配置

[channel.socket: Tomcat2]

Port = 8009

Host = Server2 # Server 2 IP

# Define Worker

[AJP13: Tomcat2]

Channel = CHANNEL. Socket: Tomcat2

# Define Balancer (Load Balancer)

[lb: lb]

Worker = ajp13: Tomcat1

Worker = ajp13: Tomcat2

#Uri mapping

[URI: / *]

Group = lb: lb

5, modify Tomcat configuration file% tomcat_home% / conf / server.xml, join in Engine tag: jvmroute = "Tomcat1" Server1 with tomcat1, server2 with Tomcat2

6. This configuration is debugged under Windows XP and Redhat Linux.

转载请注明原文地址:https://www.9cbs.com/read-109509.html

New Post(0)