Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Implementation Scheme of session sharing in tomcat8

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Session sharing implementation of tomcat8 downloading tomcat

Version: apache-tomcat-8.0.53.zip

To implement the steps, you only need to add the same server.xml for both tomcat and cluster to configure the web.xml for both tomcat applications.

For example, in:

/ Users/da/Library/Tomcat/apache-tomcat-8.0.53-8081/webapps/ROOT/WEB-INF/web.xml

Add:

Then restart the two tomcat to create a new jsp test

Session.jsp

Test2 SessionID is

SessionIP is

SessionPort is

For example, put it on:

/ Users/da/Library/Tomcat/apache-tomcat-8.0.53-8082/webapps/ROOT/session.jsp

The other one is the same.

Visit:

Http://localhost:8081/session.jsp

Http://localhost:8082/session.jsp

Sessionid consistent:

SessionID is 6E5D26E07FDE6FB5D01A59F457D64333 SessionIP is tomcat.chinaunicom.tech SessionPort is 80 Response from tomcat1SessionID is 6E5D26E07FDE6FB5D01A59F457D64333 SessionIP is tomcat.chinaunicom.tech SessionPort is 80 Response from tomcat2 considerations require the tomcat8 version (the above test passed on 8.0.53). If you need tomcat7, please tell me that it is not this kind of configuration. I need to modify the configuration of distributable and do not miss the configuration of session. This scheme is only suitable for applications with less concurrency. For now, we can use it first. Tomorrow I will try a more complex scheme with large concurrency to see if it works.

Refer to the official website:

Http://localhost:8082/docs/cluster-howto.html

Http://tomcat.apache.org/tomcat-8.0-doc/config/cluster.html

Translation:

Http://wiki.jikexueyuan.com/project/tomcat/clustering.html

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report