wood burning stoves*
The moose likes Tomcat and the fly likes How to see sessions in my tomcat hosts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to see sessions in my tomcat hosts" Watch "How to see sessions in my tomcat hosts" New topic
Author

How to see sessions in my tomcat hosts

Alex Florentino
Ranch Hand

Joined: Dec 12, 2006
Posts: 48
Hi all,

I created an host for me sub-domain sample:

test.mysite.com

but when I logon in tomcat admin it list all applications for localhost host.

there is some way show has many session my host have.

I need it because when update my production environment I not can't stop tomcat before see there is some user.

thanks a lot.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
You should be able to use the Manager application so that it looks at that host only. Try a URL like:

http://test.mysite.com/manager/html/list

It should show the number of sessions for each web application.

Bill
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Tomcat manager applications are 'by Host' so, if you've set up a host other then localhost in your server.xml file, you may need to install another copy of the manager application.

If this is really important to you, you might want to add a component to your application that shows a little more than the Tomcat manager, which only shows how many sessions per app are open.

I have a sample application on my site that shows how to see more information about each session, like, how long it's been idle, who is logged in, and the last page that that user hit.

http://simple.souther.us
Look for SessionMonitor


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
Tomcat manager applications are 'by Host'


Hmm - well, in my Tomcat 5.5.9 installation there is only one "tomcatxx/server/webapps/manager" directory and I have 5 different Hosts defined. I can start a manager session for each Host with no problem.

Bill
Alex Florentino
Ranch Hand

Joined: Dec 12, 2006
Posts: 48
it not works... my host definition:
my tomcat is 4.1



I got error: HTTP Status 404
[ August 30, 2007: Message edited by: Alex Florentino ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by William Brogden:


Hmm - well, in my Tomcat 5.5.9 installation there is only one "tomcatxx/server/webapps/manager" directory and I have 5 different Hosts defined. I can start a manager session for each Host with no problem.

Bill


This has changed between 5.0 and 5.5.
I haven't set up multiple hosts since using 5.0
From: http://tomcat.apache.org/tomcat-5.0-doc/manager-howto.html
If you have Tomcat configured to support multiple virtual hosts (websites) you would need to configure a Manager for each.


Alex:
This is also the case for your version (4.1)
See this link for configuring the manager application for your host:
http://tomcat.apache.org/tomcat-4.1-doc/manager-howto.html
[ August 30, 2007: Message edited by: Ben Souther ]
Alex Florentino
Ranch Hand

Joined: Dec 12, 2006
Posts: 48
thanks, it is works.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to see sessions in my tomcat hosts
 
Similar Threads
The CATALINA_HOME enviornment variable
Signing applet cab file for I.E. problem
unable to view files in webapps
Hosting Tomcat BIG PROBLEM WITH :8080
Hosting problem , the Host provider tomcat does not understand .do