Apache2.2.11 + Tomcat6.0.20 cluster configuration

Source: Internet
Author: User
You have been viewing Apache and Tomcat cluster configurations over the past few days. It took a long time to complete the configuration! Apache2.x and Tomcat can be configured in the form of reverse proxy (modproxy) or JK module, and JK module is used in the end. The efficiency of JK module is higher than that of reverse proxy, this is what I said on the official Apache website. I have never tested it. Although JK configurations are complex,

Apache andMcAtClusterConfiguration. It took a long time to complete the configuration!

Apache2.x and Tom CatThe configuration can adopt a reverse proxy (mod proxy) or JK module, and the JK module is used eventually. The efficiency of the JK module is higher than that of the reverse proxy, this is what I said on the official Apache website. I have never tested it. Although JK configurations are complex, JK configurations are more flexible.
First, download Apache2.2.11, Tomcat6.0.20 ExtractEdition, and mod_jk-1.2.28- Httpd-2.2.3.so
Install the Apache server, rename the mod_jk-1.2.28-httpd-2.2.3.so to mod_jk.so, and copy it to the mo in the Apache installation directory DuLes folder.
In the conf folder of the Apache2.2 installation directory, create the following three files:
Mod_jk.conf, workers. properties, uriworke RmAp. properties

Add the following at the end of httpd. conf:

  1. # JK moduleSetBytes
  2. INcLude conf/mod_jk.conf

Contains the mod_jk.conf configuration file. The following is the content of the mod_jk.conf file:

  1. # Load JK Module
  2. LoadModule jk_module modules/mod_jk.so
  3. # Configure mod_jk
  4. JkWorkersFile conf/workers. properties
  5. JkMountFile conf/uriworkermap. properties
  6. JkShmFile logs/mod_jk.shm
  7. JkLogFile logs/mod_jk.log
  8. JkOptions + ForwardKeySize + ForwardURICompat-ForwardDirectories
  9. JkLogLevel warn
  10. JkLogStampFormat"[% A % B % d % H: % M: % S % Y]"
  11. HostnameLookups Off
  12. JkMount jkStatUs
  13. Order deny, allow
  14. Deny from all
  15. Allow from127.0.0.1

Next, configure the workers. properties file:

  1. # Environment slashForWindows (backslash represents a Windows system)
  2. Ps = \
  3. Worker. reTrIes =3
  4. #Server Load balancerServer and status monitor
  5. Worker. list = loadbalancer, jkstatus
  6. Worker. tomcatA. type = ajp13
  7. Worker. tomcatA. host = localhost
  8. Worker. tomcatA. port =9001
  9. Worker. tomcatA. lbfactor =1
  10. Worker. tomcatA. connection_pool _TimeOut =600
  11. Worker. tomcatA. socket_keepalive =True
  12. Worker. tomcatA. socket_timeout =60
  13. Worker. tomcatB. type = ajp13
  14. Worker. tomcatB. host = localhost
  15. Worker. tomcatB. port =9002
  16. Worker. tomcatB. lbfactor =1
  17. Worker. tomcatB. connection_pool_timeout =600
  18. Worker. tomcatB. socket_keepalive =True
  19. Worker. tomcatB. socket_timeout =60
  20. Worker. worker ATC. type = ajp13
  21. Worker. worker ATC. host = localhost
  22. Worker. worker ATC. port =9003
  23. Worker. worker ATC. lbfactor =1
  24. Worker. worker ATC. connection_pool_timeout =600
  25. Worker. Route ATC. socket_keepalive =True
  26. Worker. worker ATC. socket_timeout =60
  27. Worker. jkstatus. type = status
  28. Worker. loadbalancer. type = lb
  29. Worker. loadbalancer. sticky_session =True
  30. Worker. loadbalancer. sticky_session_force =FaLsE
  31. Worker. loadbalancer. balance_workers = tomcatA, tomcatB, tomcatC

In the preceding configuration file, sticky_session = true and sticky_session_force = false. Many articles suggest that, when the former is set to true, the latter is also set to true.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.