Re: Counting Page Hits

2004-11-09 Thread Steven J. Owens
On Tue, Nov 09, 2004 at 05:55:07PM -0800, Justin Jaynes wrote:
 What is the easiest way to monitor hits to resources (files or
 pages) on my tomcat 5 server?

 Do I write my own ticker into each page I want to monitor and store
 the incremented value to a database?

 Or is there a much simpler solution already implimented in some
 tomcat management software

 AFAIK there isn't any sort of built-in monitoring.  The general
answer I've seen in the past is that you should use log analysis tools
on the logs, which are in a fairly standard format.  This probably
makes a ton of sense, considering that adding special monitoring would
involve adding overhead to every page request, while log analysis
could be done to the logs on a separate machine.

 An alternative would be to code a servlet filter to log the
requested URLs.  In some ways a servlet filter is much like a servlet;
you request a URL, based on an entry in web.xml the servlet engine
hands the request to the appropriate servlet filter instance (or if
the servlet filter hasn't be instantiated yet, instantiates it and
then hands the request to the instance).  

 The way it's *not* like a servlet is that the servlet filter's
doFilter() method gets request, response AND chain.  Besides messing
with the request and response object all it likes (subject to the
standard limitations, like you can't write headers once you've started
flushing body content back to the client), the filter can call
chain.doFilter(request, response), which forwards the request to 
the original servlet it was intended for.

 So in this case, you'd set up a servlet filter, define the URL
mappings to filter all the servlets and JSPs you care about
monitoring, and have it print a log message to a special log file (or
to a special logging channel).

http://www.javaworld.com/javaworld/jw-06-2001/jw-0622-filters.html
http://www.onjava.com/pub/a/onjava/2003/11/19/filters.html
http://www.onjava.com/pub/a/onjava/2004/03/03/filters.html


-- 
Steven J. Owens
[EMAIL PROTECTED]

I'm going to make broad, sweeping generalizations and strong,
 declarative statements, because otherwise I'll be here all night and
 this document will be four times longer and much less fun to read.
 Take it all with a grain of salt. - http://darksleep.com/notablog


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Multi-Site Clustering? (hot failover)

2004-11-09 Thread Steven J. Owens
Hi,

 I've heard tomcat supports clustering, but I'm thinking about a
similar, but different situation: having a duplicate server at a
distant hosting center, set up to take over if the first server or the
first hosting center encounter problems.

 This isn't about load, so much as reliability.  I don't *think*
there are any special things I need to do at the tomcat level, but I
figure it can't hurt to ask if I'm missing something.

 My basic configuration is apache/tomcat/mysql.  I think I just
need to keep the tomcat webapps on the same version of my application,
and that's about it for apache and tomcat.  I especially have to make
sure the application code is using the same database schema, so I
don't get inconsistent data being written to the database.

 The main trick isn't gonig to be tomcat but all, but rather
making sure the mysql database on the second server is set up to
mirror the first database, with frequent updates to minimize the
window of lost data.  The main worry is going to be if the second
machine has to take over, and some new data is created in the first
machine after that point (i.e. the data gets out of sync).  I'm
guessing the short answer is to either count that data as lost
(i.e. Doctor, my arm hurts when I do this. Don't do that.), or
selectively copy the new data over to the second machine, then drop
the first database and copy the second database over to the first
server.

-- 
Steven J. Owens
[EMAIL PROTECTED]

I'm going to make broad, sweeping generalizations and strong,
 declarative statements, because otherwise I'll be here all night and
 this document will be four times longer and much less fun to read.
 Take it all with a grain of salt. - http://darksleep.com/notablog


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Multi-Site Clustering? (hot failover)

2004-11-09 Thread Craig Collings
Hi Steve,

I presume you are thing something like this:
http://dev.mysql.com/doc/mysql/en/Replication.html

: -Original Message-
: From: Steven J.Owens [mailto:[EMAIL PROTECTED] 
: Sent: Wednesday, 10 November 2004 2:55 p.m.
: To: [EMAIL PROTECTED]
: Subject: Multi-Site Clustering? (hot failover)
: 
: 
: Hi,
: 
:  I've heard tomcat supports clustering, but I'm thinking 
: about a similar, but different situation: having a duplicate 
: server at a distant hosting center, set up to take over if 
: the first server or the first hosting center encounter problems.
: 
:  This isn't about load, so much as reliability.  I don't 
: *think* there are any special things I need to do at the 
: tomcat level, but I figure it can't hurt to ask if I'm 
: missing something.
: 
:  My basic configuration is apache/tomcat/mysql.  I think 
: I just need to keep the tomcat webapps on the same version of 
: my application, and that's about it for apache and tomcat.  I 
: especially have to make sure the application code is using 
: the same database schema, so I don't get inconsistent data 
: being written to the database.
: 
:  The main trick isn't gonig to be tomcat but all, but 
: rather making sure the mysql database on the second server is 
: set up to mirror the first database, with frequent updates to 
: minimize the window of lost data.  The main worry is going to 
: be if the second machine has to take over, and some new data 
: is created in the first machine after that point (i.e. the 
: data gets out of sync).  I'm guessing the short answer is to 
: either count that data as lost (i.e. Doctor, my arm hurts 
: when I do this. Don't do that.), or selectively copy the 
: new data over to the second machine, then drop the first 
: database and copy the second database over to the first server.
: 
: -- 
: Steven J. Owens
: [EMAIL PROTECTED]
: 
: I'm going to make broad, sweeping generalizations and 
: strong,  declarative statements, because otherwise I'll be 
: here all night and  this document will be four times longer 
: and much less fun to read.  Take it all with a grain of 
: salt. - http://darksleep.com/notablog
: 
: 
: -
: To unsubscribe, e-mail: [EMAIL PROTECTED]
: For additional commands, e-mail: [EMAIL PROTECTED]
: 
: 

#
Notice of Confidential information 
The information contained in this electronic mail is CONFIDENTIAL INFORMATION 
and may
be LEGALLY PRIVILEGED, intended only for the individual or entity named above. 
If you
are not the intended recipient, you are hereby notified that the use, 
dissemination,
distribution, or copying of this document is strictly prohibited. If you have 
received
this electronic message in error, please immediately notify us by return or 
telephone
call collect to 07 577 6049) and destroy the original message. Thank you, ABN 
AMRO Craigs Limited.

This e-mail message has been scanned and cleared by MailMarshal   
www.marshalsoftware.com 

#

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Multi-Site Clustering? (hot failover)

2004-11-09 Thread Craig Collings
Though of you are talking about replicating over the public internet.
very cool idea.
how about - using JMS to shift the bin-logs?
you'd get network-fault-tolerance, guaranteed sequential delivery, auth 
auth, ease of subsequent configuration (ie pub-sub) all built in?
You'd just have to build the clients...

: -Original Message-
: From: Craig Collings [mailto:[EMAIL PROTECTED] 
: Sent: Wednesday, 10 November 2004 3:00 p.m.
: To: 'Tomcat Users List'
: Subject: RE: Multi-Site Clustering? (hot failover)
: 
: 
: Hi Steve,
: 
: I presume you are thing something like this: 
: http://dev.mysql.com/doc/mysql/en/Replication.html
: 
: : -Original Message-
: : From: Steven J.Owens [mailto:[EMAIL PROTECTED] 
: : Sent: Wednesday, 10 November 2004 2:55 p.m.
: : To: [EMAIL PROTECTED]
: : Subject: Multi-Site Clustering? (hot failover)
: : 
: : 
: : Hi,
: : 
: :  I've heard tomcat supports clustering, but I'm thinking 
: : about a similar, but different situation: having a duplicate 
: : server at a distant hosting center, set up to take over if 
: : the first server or the first hosting center encounter problems.
: : 
: :  This isn't about load, so much as reliability.  I don't 
: : *think* there are any special things I need to do at the 
: : tomcat level, but I figure it can't hurt to ask if I'm 
: : missing something.
: : 
: :  My basic configuration is apache/tomcat/mysql.  I think 
: : I just need to keep the tomcat webapps on the same version of 
: : my application, and that's about it for apache and tomcat.  I 
: : especially have to make sure the application code is using 
: : the same database schema, so I don't get inconsistent data 
: : being written to the database.
: : 
: :  The main trick isn't gonig to be tomcat but all, but 
: : rather making sure the mysql database on the second server is 
: : set up to mirror the first database, with frequent updates to 
: : minimize the window of lost data.  The main worry is going to 
: : be if the second machine has to take over, and some new data 
: : is created in the first machine after that point (i.e. the 
: : data gets out of sync).  I'm guessing the short answer is to 
: : either count that data as lost (i.e. Doctor, my arm hurts 
: : when I do this. Don't do that.), or selectively copy the 
: : new data over to the second machine, then drop the first 
: : database and copy the second database over to the first server.
: : 
: : -- 
: : Steven J. Owens
: : [EMAIL PROTECTED]
: : 
: : I'm going to make broad, sweeping generalizations and 
: : strong,  declarative statements, because otherwise I'll be 
: : here all night and  this document will be four times longer 
: : and much less fun to read.  Take it all with a grain of 
: : salt. - http://darksleep.com/notablog
: : 
: : 
: : 
: -
: : To unsubscribe, e-mail: [EMAIL PROTECTED]
: : For additional commands, e-mail: [EMAIL PROTECTED]
: : 
: : 
: 
: ##
: ###
: Notice of Confidential information 
: The information contained in this electronic mail is 
: CONFIDENTIAL INFORMATION and may be LEGALLY PRIVILEGED, 
: intended only for the individual or entity named above. If 
: you are not the intended recipient, you are hereby notified 
: that the use, dissemination, distribution, or copying of this 
: document is strictly prohibited. If you have received this 
: electronic message in error, please immediately notify us by 
: return or telephone call collect to 07 577 6049) and destroy 
: the original message. Thank you, ABN AMRO Craigs Limited.
: 
: This e-mail message has been scanned and cleared by 
: MailMarshal   www.marshalsoftware.com 
: 
: ##
: ###
: 
: -
: To unsubscribe, e-mail: [EMAIL PROTECTED]
: For additional commands, e-mail: [EMAIL PROTECTED]
: 
: 

#
Notice of Confidential information 
The information contained in this electronic mail is CONFIDENTIAL INFORMATION 
and may
be LEGALLY PRIVILEGED, intended only for the individual or entity named above. 
If you
are not the intended recipient, you are hereby notified that the use, 
dissemination,
distribution, or copying of this document is strictly prohibited. If you have 
received
this electronic message in error, please immediately notify us by return or 
telephone
call collect to 07 577 6049) and destroy the original message. Thank you, ABN 
AMRO Craigs Limited.

This e-mail message has been scanned and cleared by MailMarshal   
www.marshalsoftware.com 

#

-
To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: Counting Page Hits

2004-11-09 Thread Parsons Technical Services
The html manager has some page count reporting built into it. May not be as 
detailed as you need, but it is there. These counts are reset on restart of 
the context (I think) but definitely on restart of Tomcat.

- Original Message - 
From: Steven J. Owens [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, November 09, 2004 9:40 PM
Subject: Re: Counting Page Hits


On Tue, Nov 09, 2004 at 05:55:07PM -0800, Justin Jaynes wrote:
What is the easiest way to monitor hits to resources (files or
pages) on my tomcat 5 server?
Do I write my own ticker into each page I want to monitor and store
the incremented value to a database?
Or is there a much simpler solution already implimented in some
tomcat management software
AFAIK there isn't any sort of built-in monitoring.  The general
answer I've seen in the past is that you should use log analysis tools
on the logs, which are in a fairly standard format.  This probably
makes a ton of sense, considering that adding special monitoring would
involve adding overhead to every page request, while log analysis
could be done to the logs on a separate machine.
An alternative would be to code a servlet filter to log the
requested URLs.  In some ways a servlet filter is much like a servlet;
you request a URL, based on an entry in web.xml the servlet engine
hands the request to the appropriate servlet filter instance (or if
the servlet filter hasn't be instantiated yet, instantiates it and
then hands the request to the instance).
The way it's *not* like a servlet is that the servlet filter's
doFilter() method gets request, response AND chain.  Besides messing
with the request and response object all it likes (subject to the
standard limitations, like you can't write headers once you've started
flushing body content back to the client), the filter can call
chain.doFilter(request, response), which forwards the request to
the original servlet it was intended for.
So in this case, you'd set up a servlet filter, define the URL
mappings to filter all the servlets and JSPs you care about
monitoring, and have it print a log message to a special log file (or
to a special logging channel).
http://www.javaworld.com/javaworld/jw-06-2001/jw-0622-filters.html
http://www.onjava.com/pub/a/onjava/2003/11/19/filters.html
http://www.onjava.com/pub/a/onjava/2004/03/03/filters.html
--
Steven J. Owens
[EMAIL PROTECTED]
I'm going to make broad, sweeping generalizations and strong,
declarative statements, because otherwise I'll be here all night and
this document will be four times longer and much less fun to read.
Take it all with a grain of salt. - http://darksleep.com/notablog
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Anyone knows how to deal with mail session -security error for TC5.5.4

2004-11-09 Thread Shankar Unni
David Lee wrote:
2. catalina.policy:
 
grant codeBase
file:${catalina.home}/webapps/javaxml2/WEB-INF/classes/UpdateItemServle
t.class {
Shouldn't you be giving those permissions (except the Oracle one :-) to 
mail.jar, rather than your servlet class? That's what is actually making 
the reference, isn't it?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Clustering and Load balancing

2004-11-09 Thread Vinayagam
Hi All!

Can any one help me abt clustering and Loadbalancing using Tomcat 5.0/later.

We have an application, Which is run on Tomcat 4.0.

Now we are going to run this application in Tomcat 5.0.

Also we are going to implements the clustering technology to our appl.

So that i need som help, How to do this.

Thanx  Regards
Vinayagam

Configuring JK connector to execute JSP pages.

2004-11-09 Thread Amit Gupta
Hi ,

I have configured tomcat 5.5.3 with jk connector . My jk.config is

LoadModule jk_module 
modules/jakarta-tomcat-connectors-jk-1.2.6-linux-fc2-i386-apache-2.0.50.so 

JkWorkersFile /etc/httpd/conf/workers2.properties


JkAutoAlias /usr/local/tomcat/webapps 

JkMount /java-server/* testWorker

JkMount /*/servlet/ testWorker


Alias /java-server/ /usr/local/tomcat/webapps/

Directory /usr/local/tomcat/webapps/

Options Indexes MultiViews

AllowOverride None

Order allow,deny

Allow from all

/Directory

It is not executing JSP pages. How should I configure it.

Amit Gupta

Installation from source on Linux

2004-11-09 Thread Sandeep N
Hi All,

Has anybody tried to install Apache-Tomcat-4.1.31 from the source on
Linux? I am not able to get the servletapi V 4 (as mentioned in the
building.txt file in the tomcat source) required for this anywhere.
Can anybody tell where it is available?

Regards,
Sandeep

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



<    1   2