One possibility is that your Engine's jvmRoute attribute is not set, or not set properly.
<Engine defaultHost=... jvmRoute=worker1 ... /> Make sure that the jvmRoute value is set to the worker name, and has a legal value (no spaces or . etc.) Tim -----Original Message----- From: Vahid Hedayati [mailto:[EMAIL PROTECTED] Sent: Monday, March 20, 2006 7:05 AM To: Steve Ochani Cc: users@tomcat.apache.org Subject: Re: keeping same session via apache2 mod_jk2 and tomcat5 Ok.. I am now using mo_jk rather than mod_jk2 and sessions still keeps changing It is running on: Apache/2.0.55 (Debian) mod_jk/1.2.14 mod_chroot/0.5 mod_perl/2.0.2 Perl/v5.8.8 _____________________________________________________ more /etc/apache2/mods-enabled/jk.load LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so _____________________________________________________ more /etc/apache2/mods-enabled/jk.conf <IfModule mod_jk.c> JkWorkersFile /etc/apache2/workers.properties JkLogFile /var/log/apache2/mod_jk.log JkLogLevel error </IfModule> _____________________________________________________ more /etc/apache2/sites-enabled/www.???? <IfModule mod_jk.c> JkLogFile /var/log/apache2/mod_jk.log JkLogFile /var/log/httpd/mod_jk.log JkLogLevel error JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " JkRequestLogFormat "%w %V %T" JkMount /servlets/* worker1 JkWorkersFile /etc/apache2/workers.properties </IfModule> _____________________________________________________ more /etc/apache2/workers.properties # Tomcat and Java configuration # workers.tomcat_home=/var/lib/tomcat5 workers.java_home=/usr/bin/java ps=/ worker.list=worker1 [uri:/servlets/*] #worker.foo=ajp13:www.pro.org.uk:8009 worker.worker1.type=ajp13 worker.worker1.host=localhost worker.worker1.port=8009 worker.worker1.lbfactor=50 worker.worker1.cachesize=10 worker.worker1.cache_timeout=600 worker.worker1.socket_keepalive=1 worker.worker1.reclycle_timeout=300 _____________________________________________________ http://www.greenlightproductions.co.uk/servlets/SessionExample This still changes session ID http://www.greenlightproductions.co.uk:8180/servlets/SessionExample This doesnt :( Can anyone tell me why this is happening ? Thanks vahid On 3/17/06, Steve Ochani <[EMAIL PROTECTED]> wrote: > > On 17 Mar 2006 at 14:41, Vahid Hedayati wrote: > > > > > Hi Steve I have now installed mod_jk > > > > in virtualhost config it has.. > > > > <IfModule mod_jk.c> > > JkLogFile /var/log/apache2/mod_jk.log JkMount /servlets/* ajp13 > > </IfModule> > > > > more /etc/apache2/mods-enabled/jk.load LoadModule jk_module > > /usr/lib/apache2/modules/mod_jk.so > > [EMAIL PROTECTED]:/etc/apache2/mods-enabled# > > (there is no conf file) > > > > > > Apache/2.0.55 (Debian) mod_jk/1.2.14 mod_chroot/0.5 mod_perl/2.0.2 > > Perl/v5.8.8 > > > > but my sessions still keep resetting.. > > > > http://www.greenlightproductions.co.uk/servlets/SessionExample :( > > > > Is there anything specific to the way modjk was configured on your > > apache ? > > This is what I have in my httpd.conf (before document root defination) > > --------- > JkWorkersFile /jakarta-tomcat-5.5.9/conf/workers.properties > JkLogFile /var/log/httpd/mod_jk.log > JkLogLevel error > JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " > JkRequestLogFormat "%w %V %T" > JkMount /jsp-examples/* worker1 > JkMount /servlets-examples/* worker1 > > --------- > > > And my workers.properties file is this > > ------- > # Set properties for worker1 (ajp13) > worker.worker1.type=ajp13 > worker.worker1.host=localhost > worker.worker1.port=8009 > worker.worker1.lbfactor=50 > worker.worker1.cachesize=10 > worker.worker1.cache_timeout=600 > worker.worker1.socket_keepalive=1 > worker.worker1.reclycle_timeout=300 > ------- > > > Hope that helps > > > FYI I'm using tomcat 5.5.9 and apache httpd 1.3.26 > > > > > > > thanks > > vahid > > > > > > On 3/17/06, Steve Ochani <[EMAIL PROTECTED]> wrote: > > Hi, > > > > On 17 Mar 2006 at 12:35, Vahid Hedayati wrote: > > > > > Hi All. > > > > > > Have been looking for a few days now for a fix for this one > > issue that > I just cannot get around.. > > Basically > > If I run > > > http://www.greenlightproductions.co.uk/servlets/SessionExample > > > > The session ID keeps changingif you refresh the page > > (same > > goes for all other servlet code I been using you login once > > > logged in session info lost as in new session ID assigned) > > > > I know this isn't the exact answer you are looking for but I'm > > using mod_jk (mod_jk2 is no longer supported) and I do not have > > this problem. > > > > > > http://www.matcmp.ncc.edu/servlets-examples/servlet/SessionExample > > > > -Steve O. > > > > > > > > > > > > > but if I goto port 8180 it works perfect > > > > > http://www.greenlightproductions.co.uk:8180/servlets/SessionExampl > > e > > the session ID remains the same no matter how much i > > refresh. > > > I have been looking all over google for an answer > > for this and most of > it is to do with load balancing tomcat and > > getting same session ID :( > > I am sure others have hit this > > issue before and it must be a tom cat > config issue (well for the > > apache listener) > > here is some of my config. > > > > ################################################################## > > #### > # /etc/apache2/mods-enabled/jk2.load LoadModule jk2_module > > > /usr/lib/apache2/modules/mod_jk2.so > > > > ################################################################## > > #### > # /etc/apache2/mods-enabled/jk2.conf # To enable mod_jk2, > > customize > workers2.properties* from # > > /usr/share/doc/libapache2-mod-jk2/examples > and copy it to # > > /etc/apache2/workers2.properties. Then uncomment the > following > > line: JkSet config.file /etc/apache2/workers2.properties # > Where > > to put jk logs #JkLogFile /var/log/apache2/mod_jk.log > > # Set > > the jk log level [debug/error/info] > #JkLogLevelinfo > > # Select > > the log format > #JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " > > # > > JkOptions indicate to send SSL KEY SIZE, > #JkOptions > > +ForwardKeySize +ForwardURICompat -ForwardDirectories > > # > > JkRequestLogFormat set the request format > #JkRequestLogFormat > > "%w %V %T" > > # Globally deny access to the WEB-INF directory > > > <LocationMatch '.*WEB-INF.*'> >AllowOverride None >deny from all > > > </LocationMatch> > > > > ################################################################## > > #### > # /etc/apache2/workers2.properties # # This is the minimal > > JK2 > connector configuration file. # > > [logger] > info=Native > > logger > level=ERROR > > [config:] > > > file=${serverRoot}/workers2.properties > debug=0 > debugEnv=0 > > > > [uriMap:] > info=Maps the requests. > debug=0 > > [shm:] > > > info=Scoreboard. Required for reconfiguration and status with > > > multiprocess servers file=anonymous debug=0 > > [workerEnv:] > > > info=Global server options > timing=0 > debug=0 > > [lb:lb] > > > info=Default load balancer. > debug=0 > > > > [channel.socket:localhost:8009] > info=Ajp13 forwarding over > > socket > debug=0 > #tomcatId=tomcat1 > tomcatId=localhost:8009 > > > keepalive=1 > > [uri:/admin] > info=Tomcat HTML based > > administration web application. > debug=0 > > [uri:/manager] > > > info=A scriptable management web application for the Tomcat Web > > > Server. debug=0 > > [uri:/jsp-examples] > info=JSP 2.0 Examples. > > > debug=0 > > [uri:/servlets-examples] > tomcatId = jvmRoute > > > info=Servlet 2.4 Examples. > debug=0 > > [uri:/*.jsp] > info=JSP > > Extension mapping. > debug=0 > > [uri:/servlets/*] > > > worker=ajp13:localhost:8009 > > > > ################################################################## > > #### > # snippets of /etc/tomcat5/server.xml <Server port="8005" > > > shutdown="SHUTDOWN" debug="0"> <!--apache listne added--> > > ><Listener className="org.apache.jk.config.ApacheConfig" > > > modJk="/usr/lib/apache2/modules/mod_jk2.so" > > > WorkersConfig="/etc/apache2/workers2.properties" /> > > <Listener > > className="org.apache.jk.config.ApacheConfig" >append="true" > > forwardAll="false" > modJk="/usr/lib/apache2/modules/mod_jk2.so" > > > WorkersConfig="/etc/apache2/workers2.properties" /> > > > > > ............... > <!-- Define a non-SSL Coyote HTTP/1.1 Connector > > on port 8180 --> > <Connector > > className="org.apache.coyote.tomcat5.CoyoteConnector" >port="8180" > > minProcessors="5" maxProcessors="75" >enableLookups="true" > > acceptCount="10" debug="0" >connectionTimeout="20000" > > useURIValidationHack="false" >/> > ... > <Host > > name="www.greenlightproductions.co.uk" debug="0" > > > appBase="/xxxx/servlets/" > unpackWARs="true" autoDeploy="true"> > > ><Context path="/servlets"docBase="greenlight" debug="0" > > > reloadable="true"/> > > <Manager > > > className="org.apache.catalina.session.PersistentManager " > > > debug="0" saveOnRestart="true" maxActiveSessions="30" > > >minIdleSwap="60" maxIdleSwap="60" maxIdleBackup="60"> > <Store > > className="org.apache.catalina.session.FileStore" > > > directory="/xxx/xxxx/log/"/> > <!--<Store > > className="org.apache.catalina.session.JDBCStore" > driverName=" > > org.gjt.mm.mysql.Driver" > > > connectionURL="jdbc:mysql://localhost/tomcat?user=nnnn&passwor > > d=xx > xxx" sessionTable="tomcat$sessions" sessionIdCol="id" > > > sessionDataCol="data" sessionValidCol="valid" > > > sessionMaxInactiveCol="maxinact ive" > > > sessionLastAccessedCol="lastaccess" checkInterval="60" debug="99" > > /> > --> </Manager> ><parameter> ><name>driverClassName</name> > > ><value>org.gjt.mm.mysql.Driver</value> > </parameter> > <Valve > > className="org.apache.catalina.valves.AccessLogValve " > > > directory="logs"prefix="greenlight_log." suffix=".txt" pa > > > ttern="common" resolveHosts="true"/> > </Host> > > > > > > > ################################################################## > > #### > # > > > > > > > > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]