This library contains implementations of Apache Tomcats org.apache.catalina.Manager using Redis, Hazelcast and MongoDB.
By default, Tomcats uses it’s own logging component named JULI, writing logfiles to CATALINA_HOME/logs
.
However, if you want to see some logging in the appNG.log
of your appNG installation, move the following files from APPNG_HOME/WEB-INF/lib
into the CATALINA_HOME/lib
directory:
-
log4j-1.2.17.jar
-
slf4j-api-1.7.25.jar
-
slf4j-log4j12-1.7.25.jar
Next, set the category for org.appng.tomcat.session
in APPNG_HOME/WEB-INF/conf/log4j.properties
to the required level:
log4j.category.org.appng.tomcat.session = trace
The implementation is based on the great work of James Coleman’s tomcat-redis-session-manager.
A few changes were made to support Tomcat 8 and the latest version of Redis.
Add the following into your Tomcat context.xml
(or the context block of the server.xml
if applicable.)
<Valve className="org.appng.tomcat.session.redis.RedisSessionHandlerValve" />
<Manager className="org.appng.tomcat.session.redis.RedisSessionManager"
host="localhost"
port="6379"
database="0"
maxInactiveInterval="60"
sessionPersistPolicies="ALWAYS_SAVE_AFTER_REQUEST" />
Copy the following files into the TOMCAT_BASE/lib
directory:
-
appng-tomcat-session-0.2.0-SNAPSHOT.jar
Reboot the server, and sessions should now be stored in Redis.
The implementation is based on the great work of Kevin Davis' mongo-session-manager.
A few changes were made to support Tomcat 8 and the latest version of MongoDB.
Add the following into your Tomcat context.xml
(or the context block of the server.xml
if applicable.)
<Valve className="org.appng.tomcat.session.mongo.MongoSessionTrackerValve" />
<Manager className="org.appng.tomcat.session.mongo.MongoPersistentManager" maxIdleBackup="30">
<Store className="org.appng.tomcat.session.mongo.MongoStore"
hosts="localhost:27017"
dbName="tomcat_sessions"
maxPoolSize="25"
/>
</Manager>
Copy the following files into the TOMCAT_BASE/lib
directory:
-
appng-tomcat-session-0.2.0-SNAPSHOT.jar
Reboot the server, and sessions should now be stored in MongoDB.
The implementation is based on Hazelcast, using a ReplicatedMap
Add the following into your Tomcat context.xml
(or the context block of the server.xml
if applicable.)
<Valve className="org.appng.tomcat.session.hazelcast.HazelcastSessionTrackerValve" />
<Manager className="org.appng.tomcat.session.hazelcast.HazelcastPersistentManager">
<!-- standard configuration, using multicast -->
<Store className="org.appng.tomcat.session.hazelcast.HazelcastStore" mode="multicast" port="5701" instanceName="appNG" group="dev"
multicastGroup="224.2.2.3" multicastPort="54327" multicastTimeoutSeconds="2" multicastTimeToLive="32"/>
<!-- uses tcp, allowing to use a comma separated list of addresses -->
<!--Store className="org.appng.tomcat.session.hazelcast.HazelcastStore" mode="tcp" port="5701" instanceName="appNG" group="dev" --/>
<!-- client mode, allowing to use a comma separated list of addresses -->
<!-- Store className="org.appng.tomcat.session.hazelcast.HazelcastStore" mode="client" instanceName="appNG" group="dev"
addresses="localhost:5701" /-->
</Manager>
Copy the following files into the TOMCAT_BASE/lib
directory:
-
appng-tomcat-session-0.2.0-SNAPSHOT.jar
Reboot the server, and sessions are now stored in Hazelcast.
appNG is licensed under the Apache License 2.0.