Re: HTTP 400 from tcp half-open health checks

2023-05-25 Thread Van Hoa Phan
Correct me if I am wrong, but isn't such logging necessary to detect syn
flood attacks(expected behavior)?

On Thu, May 25, 2023 at 7:29 PM Mark Thomas  wrote:

> On 25/05/2023 09:14, Paul Baines wrote:
> > Hello! We upgraded a Windows Tomcat instance from 8.5.41 to 8.5.84. This
> Tomcat instance is behind a load balancer. Since the upgrade the Tomcat
> access log (AccessLogValve) has an "empty" entry with response 400 for
> every TCP half-open health check from the load balancer. Because the health
> check is every 5 seconds from redundant load-balancers we are getting quite
> alot of junk in the access log. The TCP half-open check is:LB --> SYN
>  --> Tomcat 443LB <-- SYN/ACK <-- Tomcat 443LB --> FIN --> Tomcat 443LB
> <-- FIN/ACK <-- Tomcat 443Access log excerpt:[03/May/2023:00:13:58 +0200]
> 10.20.10.2 - "-" - "-" "-" 400 0 - -[03/May/2023:00:13:59 +0200] 10.20.10.3
> - "-" - "-" "-" 400 0 - -[03/May/2023:00:14:03 +0200] 10.20.10.2 - "-" -
> "-" "-" 400 0 - -[03/May/2023:00:14:04 +0200] 10.20.10.3 - "-" - "-" "-"
> 400 0 - -[03/May/2023:00:14:08 +0200] 10.20.10.2 - "-" - "-" "-" 400 0 -
> -[03/May/2023:00:14:09 +0200] 10.20.10.3 - "-" - "-" "-" 400 0 -
> -[03/May/2023:00:14:13 +0200] 10.20.10.2 - "-" - "-" "-" 400 0 - -
> > We can reproduce this effect from Windows Powershell
> with:Test-NetConnection -ComputerName tomcat.server.name -RemotePort 443
> > My question is, is this expected behaviour?
>
> Yes.
>
> > Is TCP half-open health check supported by Tomcat?
>
> Yes. But you are going to see 400 responses in the logs for each empty
> request.
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>


Re: OT: Java Textbook?

2018-11-30 Thread Hoa Phan
I'd say Core Java.I read other books mentioned as well, they are good in their 
own ways. However Core Java was one with best structure and paints the best 
picture. 

Sent from Yahoo Mail on Android 
 
  On Sat, Dec 1, 2018 at 3:34, Jerry Malcolm wrote:   
Completely off-topic.  But I figure this is the perfect group to ask 
this question to.  I will be teaching a university level intro to Java 
programming (for non-programming majors) in the spring semester.  I am 
looking for a good textbook to use.   I've been out of academia for 
years.  So I'm not up to date on available java textbooks.   If you are 
aware of a good textbook, please let me know.  You can reply here.  Or 
just PM me at the address above (please put 'textbook' in the subject 
line if you PM me).

Thanks.

Jerry (ProfJerry.com)


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

  


Re: Extra logging by unknown source logger

2017-06-11 Thread Hoa Phan
Hi Violeta,

actually I did so in the actual file:

handlers = java.util.logging.ConsoleHandler


# Handler specific properties.
# Describes specific configuration info for Handlers.


java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter


# Facility specific properties.
# Provides extra control for each logger.


org.apache.catalina.level = INFO
org.apache.catalina.startup.HostConfig.level = INFO
org.apache.catalina.session.ManagerBase.level = INFO
org.apache.catalina.startup.VersionLoggerListener.level = SEVERE
org.apache.tomcat.util.scan.StandardJarScanner.level = SEVERE
tomcat.util.scan.StandardJarScanner.level=SEVERE


On Mon, Jun 12, 2017 at 6:14 AM, Violeta Georgieva <violet...@apache.org>
wrote:

> Hi,
>
> 2017-06-11 18:07 GMT+03:00 Hoa Phan <s50600...@gmail.com>:
> >
> > Hi I noticed when I set:
> >
> > org.apache.tomcat.util.scan.StandardJarScanner = SEVERE
>
> it should be org.apache.tomcat.util.scan.StandardJarScanner.level = SEVERE
> Note the '.level' at the end of the fully qualified class name
>
> Regards,
> Violeta
>
> >
> > I still get similar msg from a strange logger(no "org.apache" in the
> logger
> > name):
> >
> > build 11-Jun-2017 13:37:24 localhost-startStop-1 WARN
> >  [tomcat.util.scan.StandardJarScanner] Failed to scan
> > [file:/.../common/lib/p6psy.jar (No such file or directory)
> >
> > Anyone know where this comes from? How can I configure it?
> >
> > Thanks.
> >
> > Hoa Phan.
>


Extra logging by unknown source logger

2017-06-11 Thread Hoa Phan
Hi I noticed when I set:

org.apache.tomcat.util.scan.StandardJarScanner = SEVERE

I still get similar msg from a strange logger(no "org.apache" in the logger
name):

build 11-Jun-2017 13:37:24 localhost-startStop-1 WARN
 [tomcat.util.scan.StandardJarScanner] Failed to scan
[file:/.../common/lib/p6psy.jar (No such file or directory)

Anyone know where this comes from? How can I configure it?

Thanks.

Hoa Phan.


how do I know the exact commit for a particular version of tomcat?

2017-03-16 Thread Hoa Phan
I have been using the
https://tomcat.apache.org/tomcat-8.0-doc/changelog.html
and try to check out the revision with same message as latest change log of
a particular version. Though it wasn't really get me the matching binary.

Or can I find the commit hash in any file in the zip ?

Thanks

Regards,

Hoa


Re: How do I set the logger org.apache.tomcat.util.scan.StandardJarScanner's level to WARN

2017-03-09 Thread Hoa Phan
Oops just noticed I set the subject wrong. I meant to set it to SEVERE to
get rid of the FileNotFoundException all over the places.
I tried to overwrite logging.properties in tomcat itself and in the webapp
with the content:

handlers = java.util.logging.ConsoleHandler


# Handler specific properties.
# Describes specific configuration info for Handlers.


java.util.logging.ConsoleHandler.level = SEVERE
java.util.logging.ConsoleHandler.formatter =
java.util.logging.SimpleFormatter


# Facility specific properties.
# Provides extra control for each logger.


org.apache.catalina.level = SEVERE
org.apache.catalina.startup.HostConfig.level = SEVERE
org.apache.catalina.session.ManagerBase.level = SEVERE
org.apache.tomcat.util.scan.StandardJarScanner.level = SEVERE

Still I couldn't get rid of the WARN for FNFException

On Fri, Mar 10, 2017 at 11:31 AM, Hoa Phan <s50600...@gmail.com> wrote:

> Unfortunately it's still the same.
> When I tried to debug it the logger tomcat is using is DirectJDKLog
>
> Is org.apache.tomcat.util.scan.StandardJarScanner.level=SEVERE the right
> way to turn off WARNING logging ​?
>
> On Fri, Mar 10, 2017 at 10:34 AM, Hoa Phan <s50600...@gmail.com> wrote:
>
>> Ouch!! My bad... sorry Chris.
>>
>> On Fri, Mar 10, 2017 at 10:31 AM, calder <calder@gmail.com> wrote:
>>
>>> On Thu, Mar 9, 2017 at 9:48 PM, Hoa Phan <s50600...@gmail.com> wrote:
>>> > Hi Chris,
>>> >
>>> > I tried:
>>> >
>>> > org.apache.tomcat.util.scan.StandardJarScanner.level=SERVERE //in the
>>> > logging.properties
>>> >
>>> > -Dorg.apache.tomcat.util.scan.StandardJarScanner.level=SERVERE //on
>>> startup
>>> >
>>> > org.apache.tomcat.util.scan.StandardJarScanner.level= SERVERE //as
>>> sysprops
>>> >
>>> > But they didn't help either :(, StandardJarScanner still prints WARN
>>> msgs...
>>> >
>>> > Any idea?
>>>
>>> > Thanks.
>>> > Hoa.
>>>
>>> Is "SEVERE" spelled "SERVERE" (as written above) in the properties file?
>>>
>>> If yes, then that's the issue
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>
>>>
>>
>


Re: How do I set the logger org.apache.tomcat.util.scan.StandardJarScanner's level to WARN

2017-03-09 Thread Hoa Phan
Unfortunately it's still the same.
When I tried to debug it the logger tomcat is using is DirectJDKLog

Is org.apache.tomcat.util.scan.StandardJarScanner.level=SEVERE the right
way to turn off WARNING logging ​?

On Fri, Mar 10, 2017 at 10:34 AM, Hoa Phan <s50600...@gmail.com> wrote:

> Ouch!! My bad... sorry Chris.
>
> On Fri, Mar 10, 2017 at 10:31 AM, calder <calder@gmail.com> wrote:
>
>> On Thu, Mar 9, 2017 at 9:48 PM, Hoa Phan <s50600...@gmail.com> wrote:
>> > Hi Chris,
>> >
>> > I tried:
>> >
>> > org.apache.tomcat.util.scan.StandardJarScanner.level=SERVERE //in the
>> > logging.properties
>> >
>> > -Dorg.apache.tomcat.util.scan.StandardJarScanner.level=SERVERE //on
>> startup
>> >
>> > org.apache.tomcat.util.scan.StandardJarScanner.level= SERVERE //as
>> sysprops
>> >
>> > But they didn't help either :(, StandardJarScanner still prints WARN
>> msgs...
>> >
>> > Any idea?
>>
>> > Thanks.
>> > Hoa.
>>
>> Is "SEVERE" spelled "SERVERE" (as written above) in the properties file?
>>
>> If yes, then that's the issue
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>


Re: What is the correct way to use scanManifest

2017-03-09 Thread Hoa Phan
looks like I can't overwrite the webapp context.xml with tomcat
context.xml. I have no control over the WAR file until tomcat deployed it :(

If I try to use tomcat server.xml and add


  



inside  it somehow breaks the webapp.

Is there any other way for me to set this scanmanifest to false.

Says if I took all the jars that I saw reported as
WARNING: Failed to scan...
java.io.FileNotFoundException: .../common/lib/jonas_timer.jar (No such file
or directory)

And append them to:
tomcat.util.scan.StandardJarScanFilter.jarsToSkip

in catalina.properties, would that help ?

On Fri, Mar 10, 2017 at 10:33 AM, Mark Thomas <ma...@apache.org> wrote:

> On 09/03/17 21:38, Hoa Phan wrote:
> > I'll try that and see how it goes, thanks Mark. Btw, when I was
> debugging I
> > couldn't find where this method get called at all:
> > public void setScanManifest(boolean scanManifest) {
> > this.scanManifest = scanManifest;
> > }
> >
> > This props default to true:
> > private boolean scanManifest = true;
> >
> > And the StandardJarScanner always been constructed like:
> > jarScanner = new StandardJarScanner();
> >
> > How would scanManifest ever be set to false...
>
> Via the digester when processing server.xml or context.xml. Take a look
> at org.apache.catalina.startup.ContextRuleSet
>
> Mark
>
>
> >
> > Regards,
> >
> > Hoa Phan.
> >
> >
> >
> >
> > On Fri, Mar 10, 2017 at 6:44 AM, Mark Thomas <ma...@apache.org> wrote:
> >
> >> On 09/03/17 13:15, Hoa Phan wrote:
> >>> Hi,
> >>>
> >>> I see that since 8.0.38 we added a scanManifest props to JarScanner.
> >>> But when I added the props
> >>> into: container/tomcat8x/apache-tomcat-8.0.38/conf/context.xml
> >>> 
> >>> 
> >>> WEB-INF/web.xml
> >>> ${catalina.base}/conf/web.xml
> >>>
> >>> 
> >>> 
> >>>
> >>> 
> >>> 
> >>> 
> >>>
> >>> It doesn't work and the prop is still true on startup:
> >>
> >> Hmm. That should work. Are you sure that file is being read at startup?
> >> One way to check is to deliberately break it and see what happens.
> >>
> >> Mark
> >>
> >>
> >>>
> >>> ​
> >>> Must I put this in the context.xml of the webapp itself. I deploy the
> >>> webapp via a war file and have no control over the war content until
> >>> tomcat deploys it which is too late...
> >>>
> >>> Is there any other way for me to turn this off using global config of
> >>> tomcat.
> >>>
> >>> Thanks much.
> >>>
> >>> Regards,
> >>>
> >>> Hoa Phan
> >>>
> >>>
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>
> >>
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: How do I set the logger org.apache.tomcat.util.scan.StandardJarScanner's level to WARN

2017-03-09 Thread Hoa Phan
Ouch!! My bad... sorry Chris.

On Fri, Mar 10, 2017 at 10:31 AM, calder <calder@gmail.com> wrote:

> On Thu, Mar 9, 2017 at 9:48 PM, Hoa Phan <s50600...@gmail.com> wrote:
> > Hi Chris,
> >
> > I tried:
> >
> > org.apache.tomcat.util.scan.StandardJarScanner.level=SERVERE //in the
> > logging.properties
> >
> > -Dorg.apache.tomcat.util.scan.StandardJarScanner.level=SERVERE //on
> startup
> >
> > org.apache.tomcat.util.scan.StandardJarScanner.level= SERVERE //as
> sysprops
> >
> > But they didn't help either :(, StandardJarScanner still prints WARN
> msgs...
> >
> > Any idea?
>
> > Thanks.
> > Hoa.
>
> Is "SEVERE" spelled "SERVERE" (as written above) in the properties file?
>
> If yes, then that's the issue
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: How do I set the logger org.apache.tomcat.util.scan.StandardJarScanner's level to WARN

2017-03-09 Thread Hoa Phan
Hi Chris,

I tried:

org.apache.tomcat.util.scan.StandardJarScanner.level=SERVERE //in the
logging.properties

-Dorg.apache.tomcat.util.scan.StandardJarScanner.level=SERVERE //on startup

org.apache.tomcat.util.scan.StandardJarScanner.level= SERVERE //as sysprops

But they didn't help either :(, StandardJarScanner still prints WARN msgs...


Any idea?


Thanks.

Hoa.

On Fri, Mar 10, 2017 at 4:26 AM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Hoa,
>
> On 3/9/17 11:58 AM, Hoa Phan wrote:
> > I have tried:
> >
> > org.apache.tomcat.util.scan.StandardJarScanner.level = SERVERE //in
> > the logging.properties
> >
> > -Dorg.apache.tomcat.util.scan.StandardJarScanner=SERVERE //on
> > startup
> >
> > org.apache.tomcat.util.scan.StandardJarScanner=SERVER //as
> > sysprops
> >
> >
> > None of them works... That logger is still WARN enabled
>
> Try this:
>
> org.apache.tomcat.util.scan.StandardJarScanner.level=SEVERE
>
> You were missing the ".level" at the end of the setting.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJYwZArAAoJEBzwKT+lPKRYoFsP/j+a8iikLatZQnkrd4laj1RA
> uXiTpylD2MC1v23avrziBzsaewJmRJYRAx5kqFpfgVciRIEjTJY5kaVKlnndqzzq
> eww9G4WRPir1OKSvY1XifXIjcSMCA7U5oV+tzYvWiohNB89FPg4FruOThOb3lmth
> Rm30/GhSqFNt3Fr0lm8YUaeB7A1Kmzf6YuLjsTbYUYBjCC1Z8/+J6Mn2BjkpEtQ1
> dX/ZL5oz+58A11Vfq1X6KTkxU7zYyYokZlgN1++ncqLmiLyIj0yq4kKbIESTf+8b
> +isMG5oIydnWbucQx0RxOzS802q6AKyO7vVVTjXXOxZm6stzJD586TCmP9AOUiD1
> Y40iS4Ft0vCt6XoCekpLon6pUsUMKQC65WWpEFtnwn9BBn6dQ6cmVpToUxXUwYjY
> by56Mtb48Aho2vu4MLFu+CEhlVapI64dbQaGVlD7ZXeMJJUX4/WeAxX16zt2Jj/q
> NdCcfScB2ytep3SSZg/WwVth+mSIYxZ6gNaPfTLuJ+HsjPUAdsKUPul0BKOUC7+O
> r6hwN8s1Ue9/b1X1bpCZxB41QbwgfAYoHNU0xjeBnJa3aa1brNFoc4Ii0RiLLrMi
> XQ570RyG9hry3NHG7AxmXReD3rkqpGSFlZnYC5nfy+iX+jjNP8tkWLgupRNzSaUc
> NVSFCpvceCZLhMNgV/fk
> =BvRN
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: What is the correct way to use scanManifest

2017-03-09 Thread Hoa Phan
I'll try that and see how it goes, thanks Mark. Btw, when I was debugging I
couldn't find where this method get called at all:
public void setScanManifest(boolean scanManifest) {
this.scanManifest = scanManifest;
}

This props default to true:
private boolean scanManifest = true;

And the StandardJarScanner always been constructed like:
jarScanner = new StandardJarScanner();

How would scanManifest ever be set to false...

Regards,

Hoa Phan.




On Fri, Mar 10, 2017 at 6:44 AM, Mark Thomas <ma...@apache.org> wrote:

> On 09/03/17 13:15, Hoa Phan wrote:
> > Hi,
> >
> > I see that since 8.0.38 we added a scanManifest props to JarScanner.
> > But when I added the props
> > into: container/tomcat8x/apache-tomcat-8.0.38/conf/context.xml
> > 
> > 
> > WEB-INF/web.xml
> > ${catalina.base}/conf/web.xml
> >
> > 
> > 
> >
> > 
> > 
> > 
> >
> > It doesn't work and the prop is still true on startup:
>
> Hmm. That should work. Are you sure that file is being read at startup?
> One way to check is to deliberately break it and see what happens.
>
> Mark
>
>
> >
> > ​
> > Must I put this in the context.xml of the webapp itself. I deploy the
> > webapp via a war file and have no control over the war content until
> > tomcat deploys it which is too late...
> >
> > Is there any other way for me to turn this off using global config of
> > tomcat.
> >
> > Thanks much.
> >
> > Regards,
> >
> > Hoa Phan
> >
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


How do I set the logger org.apache.tomcat.util.scan.StandardJarScanner's level to WARN

2017-03-09 Thread Hoa Phan
I have tried:

org.apache.tomcat.util.scan.StandardJarScanner.level = SERVERE //in the
logging.properties

-Dorg.apache.tomcat.util.scan.StandardJarScanner=SERVERE //on startup

org.apache.tomcat.util.scan.StandardJarScanner=SERVER //as sysprops


None of them works... That logger is still WARN enabled


What is the correct way to use scanManifest

2017-03-09 Thread Hoa Phan
Hi,

I see that since 8.0.38 we added a scanManifest props to JarScanner.
But when I added the props
into: container/tomcat8x/apache-tomcat-8.0.38/conf/context.xml


WEB-INF/web.xml
${catalina.base}/conf/web.xml








It doesn't work and the prop is still true on startup:

​
Must I put this in the context.xml of the webapp itself. I deploy the
webapp via a war file and have no control over the war content until tomcat
deploys it which is too late...

Is there any other way for me to turn this off using global config of
tomcat.

Thanks much.

Regards,

Hoa Phan