1, install Redis and configure and start, Tomcat also do a phase download, other places, can be viewed elsewhere.
2, get the Tomcat dependency package:
Tomcat uses a Redis client that downloads Jedis from Https://github.com/xetorthio/jedis/downloads as Java.
Download the Redis Session Manager plugin for Tomcat from Https://github.com/jcoleman/tomcat-redis-session-manager/downloads
Download Apache common Pool2 package from http://commons.apache.org/proper/commons-pool/download_pool.cgi, 2.2. Copy these jar packages to the tomcat7 Lib directory
Packages are: redis2.8, Jedis.jar, Common-pool2.2.jar, Tomcat-redis-session-manager-1.2-tomcat-7.jar
3 Configuring Tomcat
In Https://github.com/jcoleman/tomcat-redis-session-manager This article sees the configuration as:
<valve classname= "Com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve"/>
<manager classname= "Com.orangefunction.tomcat.redissessions.RedisSessionManager"
host= "localhost" <!--optional:defaults to "localhost"--
Port= "6379" <!--optional:defaults to "6379"-
database= "0" <!--optional:defaults to "0"--
Maxinactiveinterval= <!--optional:defaults to "$" (in seconds)--
sessionpersistpolicies= "Persist_policy_1,persist_policy_2,.." <!--optional-
Sentinelmaster= "Sentinelmastername" <!--optional--
sentinels= "Sentinel-host-1:port,sentinel-host-2:port,.." <!--optional-/>
While the downloaded package Tomcat-redis-session-manager-1.2-tomcat-7-java-7.jar or Tomcat-redis-session-manager-1.2-tomcat-7.jar
There is no class: Com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve
So download the source code directly from Https://github.com/jcoleman/tomcat-redis-session-manager:
found that there are corresponding classes in the source code, while the source (Tomcat-redis-session-manager) relies on the other Tomcat package: Tomcat-juli.jar
And Tomcat does not have these packages by default, from http://mirrors.cnnic.cn/apache/tomcat/tomcat-7/v7.0.57/bin/extras/ Download Tomcat-juli-adapters.jar and Tomcat-juli.jar Two packages, placed in the Apache-tomcat-7.0.57\lib directory.
At the same time will compile Tomcat-redis-session-manager source code, through the corresponding dependency package Common-pool2.2,jedis and Tomcat-juli.jar compile, and play into their own jar package, I have uploaded in:
http://download.csdn.net/detail/qinxcb/8279761
Then put this dependency package in the Apache-tomcat-7.0.57\lib directory and delete the Tomcat-redis-session-manager-1.2-tomcat-7.jar downloaded online.
Tomcat7 and Redis's sessoin sharing problem handling