Sunday, August 10, 2014

Configuring Tomcat for memcached session persistence on Ubuntu

Get the files


wget http://repo1.maven.org/maven2/de/javakaffee/msm/memcached-session-manager/1.8.2/memcached-session-manager-1.8.2.jar
wget http://repo1.maven.org/maven2/de/javakaffee/msm/memcached-session-manager-tc7/1.8.2/memcached-session-manager-tc7-1.8.2.jar
wget http://repo1.maven.org/maven2/net/spy/spymemcached/2.11.1/spymemcached-2.11.1.jar

Copy them to Tomcat lib folder

sudo cp memcached-session-manager-* /usr/share/tomcat7/lib
sudo cp spymemcached-* /usr/share/tomcat7/lib

Configure Tomcat context.xml in /etc/tomcat7





   
    WEB-INF/web.xml

                 memcachedNodes="tomcat-sessions.ark24w.cfg.euw1.cache.amazonaws.com:11211"
             requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$" />