Re: org.apache.catalina.valves.RemoteHostValve issue

2005-09-20 Thread Tony Tomcat
 
 -- Forwarded message --
 From: Mark Thomas [EMAIL PROTECTED]
 To: Tomcat Users List tomcat-user@jakarta.apache.org
 Date: Wed, 17 Aug 2005 08:03:45 +0100
 Subject: Re: org.apache.catalina.valves.RemoteHostValve issue
 Tony Tomcat wrote:
  Does the RemoteHostValve work? There are no examples in the Tomcat 5
  docs and the tomcat 4 docs have the following..
 
  Valve className=org.apache.catalina.valves .RemoteHostValve
  allow=*.mycompany.com,www.yourcompany.com http://www.yourcompany.com/
 /
 
 The docs have been updated for 4 and 5 not to use this example.
 
 The problem is that . is a special character in a regular expression
 and needs to be escaped if you want to match a single . character in
 your input.
 
 The regexp docs are the place to read up on this.
 
 The following should work but I haven't tried it.
 
 Valve className=org.apache.catalina.valves.RemoteHostValve
 allow=.*mycompany\.com,www\.yourcompany\.com/
 
 Mark
 


Actually.. according to the documentation the RemoteHostValve and 
RemoteAddrValve both do the same thing..

They both say...
Concrete implementation of RequestFilterValve that filters based on the 
string representation of the remote client's IP address.

The javadoc is exactly the same except the class name. :-P

Is it safe to say that tomcat doesn't support FQDN filtering (or is this 
just a typo/(cut-paste) issue? If it does support it are there performance 
implications since it seems that it would need to do a DNS lookup on all 
incoming connections.


Re: org.apache.catalina.valves.RemoteHostValve issue

2005-09-20 Thread Tony Tomcat
ok. got off my lazy butt and looked at the code. RemoteHostValve uses 
request.getRequest().getRemoteHost() 

so just the javadoc needs updating for RemoteHostValve.java. I'm sure this 
was just a copy of RemoteAddrValve. ;-)

Now i just need to figure out how to configure my tomcat to return values 
for getRemoteHost calls. 


 From: *Tony Tomcat [EMAIL PROTECTED]*
 Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Date: *Sep 20, 2005 4:35 PM*
Subject: *Re: org.apache.catalina.valves.RemoteHostValve issue*
Reply | Reply to all | Forward | Print | Add sender to Contacts list | Trash 
this message | Show original

 -- Forwarded message --
 From: Mark Thomas [EMAIL PROTECTED]
 To: Tomcat Users List tomcat-user@jakarta.apache.org
 Date: Wed, 17 Aug 2005 08:03:45 +0100
 Subject: Re: org.apache.catalina.valves.RemoteHostValve issue
 Tony Tomcat wrote:
  Does the RemoteHostValve work? There are no examples in the Tomcat 5
  docs and the tomcat 4 docs have the following..
 
  Valve className=org.apache.catalina.valves .RemoteHostValve
  allow=*.mycompany.com, www.yourcompany.comhttp://www.yourcompany.com/
 /
 
 The docs have been updated for 4 and 5 not to use this example.
 
 The problem is that . is a special character in a regular expression
 and needs to be escaped if you want to match a single . character in 
 your input.
 
 The regexp docs are the place to read up on this.
 
 The following should work but I haven't tried it.
 
 Valve className=org.apache.catalina.valves. RemoteHostValve
 allow=.*mycompany\.com,www\.yourcompany\.com/
 
 Mark
 


Actually.. according to the documentation the RemoteHostValve and 
RemoteAddrValve both do the same thing..

They both say...
Concrete implementation of RequestFilterValve that filters based on the 
string representation of the remote client's IP address.

The javadoc is exactly the same except the class name. :-P

Is it safe to say that tomcat doesn't support FQDN filtering (or is this 
just a typo/(cut-paste) issue? If it does support it are there performance 
implications since it seems that it would need to do a DNS lookup on all 
incoming connections.


org.apache.catalina.valves.RemoteHostValve issue

2005-08-16 Thread Tony Tomcat
Does the RemoteHostValve work?   There are no examples in the Tomcat 5
docs and the tomcat 4 docs have the following..

 Valve className=org.apache.catalina.valves.RemoteHostValve
 allow=*.mycompany.com,www.yourcompany.com/

Any regex starting with * fails in Tomcat 5 and you can also see this
happen on the Regex test applet.

http://jakarta.apache.org/regexp/applet.html

Does anyone have some working examples?  It doesn't work for me even
if I type in the full hostname.   Perhaps there is something in Tomcat
I need to configure for it to be able to get the hostname of the
requestor?

Tony

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



Performance monitoring

2005-04-05 Thread Tony Tomcat
I started writing a Filter for my tomcat to monitor performance but
then I started wondering..  Is there a solution already out there that
I can use?  Can I pull data from Tomcat's MBeanServer?

What I would like to know is how long my servlets are taking to run. 
I need the Min, Max and  Average times.   I then would build a servlet
to output the data in XML or HTML format.  I also would want the data
over the past hour and past 24 hours.

Thanks in advance for any pointers or suggestions!
Tony

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



Re: Performance monitoring

2005-04-05 Thread Tony Tomcat
yeah.  I was looking at the status servlet but I wanted a little more
control of the output which is when I started digging through the code
and found that it was using MBeanServer.   I didn't know there was an
XML output option so I'll look into that.

Thanks for the Jmeter pointer too.  I have been using jmeter for
stress testing but I have never tried setting up a monitor.



On Apr 5, 2005 2:23 PM, Peter Lin [EMAIL PROTECTED] wrote:
 there's this little thing called the status servlet. It displays
 information in HTML format for each webapp.
 
 it can also show a subset of the full stats in XML.  there's this
 other project in jakarta called JMeter. It has a monitor for
 tomcat5.0.19 and newer that can monitor one or more Tomcat instances.
 
 so if you don't count the status servlet and tomcat, nothing exists :)
 
 peter
 
 
 On Apr 5, 2005 2:20 PM, Tony Tomcat [EMAIL PROTECTED] wrote:
  I started writing a Filter for my tomcat to monitor performance but
  then I started wondering..  Is there a solution already out there that
  I can use?  Can I pull data from Tomcat's MBeanServer?
 
  What I would like to know is how long my servlets are taking to run.
  I need the Min, Max and  Average times.   I then would build a servlet
  to output the data in XML or HTML format.  I also would want the data
  over the past hour and past 24 hours.
 
  Thanks in advance for any pointers or suggestions!
  Tony
 
  -
  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]



crossContext=true ignored after restart

2005-02-18 Thread Tony Tomcat
After my war file is reloaded I can no longer access other webapp context's.

Simple test.jsp follows.  It prints everything is fine 1st time war
file is deployed.  If I rebuild the war file and it is auto reloaded I
get cross context failed.

test,jsp   (does not live in /)
%

ServletContext testContext = getServletContext();

if (testContext == null) {
  out.println(basic context get failed);
} else {
  ServletContext crossContext = testContext.getContext(/);
  if (crossContext == null)
out.println(cross context failed);
  else {
out.println(everything is fine);
  }
}
%

Any ideas here?  
Tony

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



Server.xml parameters unavailable after reload

2005-02-17 Thread Tony Tomcat
I am unable to read init parameters in my server.xml file when my
webapp is reloaded.   This issue was documented in the following bug

http://issues.apache.org/bugzilla/show_bug.cgi?id=19852

It said the bug was fixed but I am using Tomcat 5.0.28 and I have this issue.

Was this bug re-introduced in tomcat 5 or are there new rules about
reading these parameters more than once?

Tony

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



separate log4j configurations

2005-02-01 Thread Tony Tomcat
Is it safe to have 1 log4j.properties setup for all of tomcat and then
override it for a webapp that might need slightly different logging?

For example..

I place log4j.jar and the Jakarta commons-logging.jar into the
$TOMCAT_HOME/common/lib directory and have a log4j properties file in
$TOMCAT_HOME/common/classes/log4j.properties

This properties file writes to ${catalina.home}/logs/all.out

Then I have a test webapp that I want in its own log4j output file so
I install a new log4j.properties file in that webapp.

$TOMCAT_HOME/webapps/test/WEB-INF/classes/log4j.properties

This properties file puts the output in ${catalina.home}/logs/test.out

This appears to work but I'm just wondering if this is the correct way
to go about it.

The reason I want my main logging configuration in common/classes is
because I want my operations team to control the logging instead of
the war file.   In the case of my test application I always want it to
log at the debug level and it is only installed in production briefly
so having the log4j.properties in the war file is fine and allows me
to keep it logging at debug even if the other apps are at WARN.

Any issues here?
Tony

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