Re: Regarding Tomcat url redirection

2024-04-22 Thread lavanya tech
Hi Chris,

Could you please explain, what you exactly mean ? So here redirect is not a
solution right ?

"You'd have to use a glob/regex if
you wanted to check for [anything and maybe nothing.]example.com."

Thanks,
ammu




On Fri, Apr 19, 2024 at 3:03 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Ammu,
>
> On 4/19/24 08:32, lavanya tech wrote:
> > Thank you very much. I removed  for example.com as well as adding
> an
> >  in server.xml
> > I copied context.xml file
> > /git/app/apache-tomcat-10.1.11/webapps/towl/META-INF/context.xml
> > Removed < in rewrite.config files.
> >
> > But still I dont redirect the URL.
>
> If you have  in server.xml and also your application in the
> webapps/ directory, then you will be double-deploying your application.
>
> Re-name /git/app/apache-tomcat-10.1.11/webapps/towl/ to be
> /git/app/apache-tomcat-10.1.11/webapps/ROOT (the capitals are important)
> and remove the  element from your server.xml.
>
> Then start your server and read the logs.
>
> > *nslookup alias.example.com 
> > gives-->Non-authoritative answer:Name: www.example.com
> > Address:  192.168.200.10Aliases:
> alias.example.com
> > *
> >
> >
> > Just to give some information here, *www.example.com
> > * has alias* "alias.example.com
> > "*
> > But https://www.example.com:/example --> works fine with out issues
> but
> > the alias doesnot works (https://alias.example.com)
> > So i am not sure if the redirect url helps or if its correct
>
> Your rewrite configuration says that you have to be using host
> "example.com" but your request goes to www.example.com. Your
> configuration should only redirect a request such as:
>
> $ curl -v http://example.com:/something
>
> HTTP/1.1 301 Moved Permanently
> ...
> Location: https://www.example.com:/example
>
> If you make a request like:
>
> $ curl -v http://www.example.com:/something
>
> I wouldn't expect a redirect because of your "host" condition. The
> "%{HTTP_HOST} example.com" looks at the entire Host header and not just
> anything that ends in "example.com". You'd have to use a glob/regex if
> you wanted to check for [anything and maybe nothing.]example.com.
>
> You'd also have to make sure that your application is serving responses
> to requests to / which is why I'm recommending you use the ROOT web
> application name instead of "towl".
>
> -chris
>
> > On Fri, Apr 19, 2024 at 1:21 PM Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> >> Ammu,
> >>
> >> On 4/18/24 09:34, lavanya tech wrote:
> >>> I am attaching server.xml and context.xml and rewrite.config files.
> >>> The paths are
> >>>
> >>> /git/app/apache-tomcat-10.1.11/webapps/towl/context.xml
> >>> 
> >>>className="org.apache.catalina.valves.rewrite.RewriteValve"
> >> />
> >>>   
> >>> 
> >>
> >> This file ^^^ is in the wrong place. It should be in
> >> /git/app/apache-tomcat-10.1.11/webapps/towl/META-INF/context.xml
> >>
> >>> /git/app/apache-tomcat-10.1.11/webapps/towl/WEB-INF/rewrite.config
> >>>
> >>>  >>> https://www.example.com:/example [R=301,L]
> >>
> >> Why do you have < symbols at the beginning of these lines?
> >>
> >>> server.xml
> >>>
> >>   > [...]
> >>>
> >>>  >>> autoDeploy="true">
> >>> 
> >>
> >> It's best not to define any  in server.xml. I would remove this
> >>  entirely and allow Tomcat to auto-reploy from your
> >> webapps/towl directory. If you need this application to be deployed as
> >> the ROOT context (on / and not /towl) then you should re-name
> >> /git/app/apache-tomcat-10.1.11/webapps/towl to
> >> /git/app/apache-tomcat-10.1.11/webapps/ROOT
> >>
> >> You also don't need a  for example.com as well as adding an
> >>  for the same domain (though this is probably to anonymize the
> >> configuration). You can feel free to simply use the "localhost" 
> >> as the default  and deploy everything into it. This makes your
> >> configuration changes relative to a stock Tomcat less significant and
> >> easier to apply to new versions if/when necessary.
> >>
> >> -chris
> >>
> >>> On Thu, Apr 18, 2024 at 2:17 PM Christopher Schultz <
> >>> ch...@christopherschultz.net> wrote:
> >>>
>  Ammu,
> 
>  On 4/18/24 07:45, lavanya tech wrote:
> > I added classname rewrite valeus in contex.xml file .
> >
> >
> > >> className="org.apache.catalina.valves.rewrite.RewriteValve"
>  />
> >
> >
> > created rewrite.config so both of them is located under  conf under
> > apache-tomcat.
> >
> >
> > > > https://www.example.com:/example [R=301,L]
> >
> > So according to the documentaion they say context.xml should be
> placed
> > under webapps and rewrite.config file should be put in WEB-INF folder
> >> of
> > apache-tomcat . I placed a

Re: Regarding Tomcat url redirection

2024-04-22 Thread lavanya tech
Hi Chris,

I have already a Root folder /git/app/apache-tomcat-10.1.11/webapps, I see
the files index.jsp and index.jsp has below configuration.
So should I add server.xml under ROOT folder aswell with localhost and
example.com such that both the urls are accessible. ? Please suggest

<% response.sendRedirect("/towl"); %>

Thanks,
amm

On Mon, Apr 22, 2024 at 11:21 AM lavanya tech 
wrote:

> Hi Chris,
>
> Could you please explain, what you exactly mean ? So here redirect is not
> a solution right ?
>
> "You'd have to use a glob/regex if
> you wanted to check for [anything and maybe nothing.]example.com."
>
> Thanks,
> ammu
>
>
>
>
> On Fri, Apr 19, 2024 at 3:03 PM Christopher Schultz <
> ch...@christopherschultz.net> wrote:
>
>> Ammu,
>>
>> On 4/19/24 08:32, lavanya tech wrote:
>> > Thank you very much. I removed  for example.com as well as
>> adding an
>> >  in server.xml
>> > I copied context.xml file
>> > /git/app/apache-tomcat-10.1.11/webapps/towl/META-INF/context.xml
>> > Removed < in rewrite.config files.
>> >
>> > But still I dont redirect the URL.
>>
>> If you have  in server.xml and also your application in the
>> webapps/ directory, then you will be double-deploying your application.
>>
>> Re-name /git/app/apache-tomcat-10.1.11/webapps/towl/ to be
>> /git/app/apache-tomcat-10.1.11/webapps/ROOT (the capitals are important)
>> and remove the  element from your server.xml.
>>
>> Then start your server and read the logs.
>>
>> > *nslookup alias.example.com 
>> > gives-->Non-authoritative answer:Name: www.example.com
>> > Address:  192.168.200.10Aliases:
>> alias.example.com
>> > *
>> >
>> >
>> > Just to give some information here, *www.example.com
>> > * has alias* "alias.example.com
>> > "*
>> > But https://www.example.com:/example --> works fine with out
>> issues but
>> > the alias doesnot works (https://alias.example.com)
>> > So i am not sure if the redirect url helps or if its correct
>>
>> Your rewrite configuration says that you have to be using host
>> "example.com" but your request goes to www.example.com. Your
>> configuration should only redirect a request such as:
>>
>> $ curl -v http://example.com:/something
>>
>> HTTP/1.1 301 Moved Permanently
>> ...
>> Location: https://www.example.com:/example
>>
>> If you make a request like:
>>
>> $ curl -v http://www.example.com:/something
>>
>> I wouldn't expect a redirect because of your "host" condition. The
>> "%{HTTP_HOST} example.com" looks at the entire Host header and not just
>> anything that ends in "example.com". You'd have to use a glob/regex if
>> you wanted to check for [anything and maybe nothing.]example.com.
>>
>> You'd also have to make sure that your application is serving responses
>> to requests to / which is why I'm recommending you use the ROOT web
>> application name instead of "towl".
>>
>> -chris
>>
>> > On Fri, Apr 19, 2024 at 1:21 PM Christopher Schultz <
>> > ch...@christopherschultz.net> wrote:
>> >
>> >> Ammu,
>> >>
>> >> On 4/18/24 09:34, lavanya tech wrote:
>> >>> I am attaching server.xml and context.xml and rewrite.config files.
>> >>> The paths are
>> >>>
>> >>> /git/app/apache-tomcat-10.1.11/webapps/towl/context.xml
>> >>> 
>> >>>   > className="org.apache.catalina.valves.rewrite.RewriteValve"
>> >> />
>> >>>   
>> >>> 
>> >>
>> >> This file ^^^ is in the wrong place. It should be in
>> >> /git/app/apache-tomcat-10.1.11/webapps/towl/META-INF/context.xml
>> >>
>> >>> /git/app/apache-tomcat-10.1.11/webapps/towl/WEB-INF/rewrite.config
>> >>>
>> >>> > >>> https://www.example.com:/example [R=301,L]
>> >>
>> >> Why do you have < symbols at the beginning of these lines?
>> >>
>> >>> server.xml
>> >>>
>> >>   > [...]
>> >>>
>> >>> > >>> autoDeploy="true">
>> >>> 
>> >>
>> >> It's best not to define any  in server.xml. I would remove
>> this
>> >>  entirely and allow Tomcat to auto-reploy from your
>> >> webapps/towl directory. If you need this application to be deployed as
>> >> the ROOT context (on / and not /towl) then you should re-name
>> >> /git/app/apache-tomcat-10.1.11/webapps/towl to
>> >> /git/app/apache-tomcat-10.1.11/webapps/ROOT
>> >>
>> >> You also don't need a  for example.com as well as adding an
>> >>  for the same domain (though this is probably to anonymize the
>> >> configuration). You can feel free to simply use the "localhost" 
>> >> as the default  and deploy everything into it. This makes your
>> >> configuration changes relative to a stock Tomcat less significant and
>> >> easier to apply to new versions if/when necessary.
>> >>
>> >> -chris
>> >>
>> >>> On Thu, Apr 18, 2024 at 2:17 PM Christopher Schultz <
>> >>> ch...@christopherschultz.net> wrote:
>> >>>
>>  Ammu,
>> 
>>  On 4/18/24 07:45, lavanya tech wrote:
>> > I added classname rewrite valeus in contex.xml file .
>> >
>> >
>> > 

Tomcat 10 skipping state transfer. No members active in cluster group

2024-04-22 Thread Rick Noel
Hello,

Could someone please explain why I am getting the error

skipping state transfer. No members active in cluster group

On one sever the reciever  is bound  to  127.0.0.1:4002
And on the other server the receiver is bound to   127.0.0.1:4001

But both servers report -> no active members in cluster group


22-Apr-2024 10:19:06.726 INFO [main] 
org.apache.catalina.core.StandardService.startInternal Starting service 
[Station]
22-Apr-2024 10:19:06.727 INFO [main] 
org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: 
[Apache Tomcat/10.1.20]
22-Apr-2024 10:19:06.736 INFO [main] 
org.apache.catalina.ha.tcp.SimpleTcpCluster.startInternal Cluster is about to 
start
22-Apr-2024 10:19:06.750 INFO [main] 
org.apache.catalina.tribes.transport.ReceiverBase.bind Receiver Server Socket 
bound to:[/127.0.0.1:4002]
22-Apr-2024 10:19:06.762 INFO [main] 
org.apache.catalina.tribes.membership.McastServiceImpl.setupSocket Setting 
cluster mcast soTimeout to [500]
22-Apr-2024 10:19:06.771 INFO [main] 
org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers Sleeping 
for [1000] milliseconds to establish cluster membership, start level:[4]
22-Apr-2024 10:19:07.771 INFO [main] 
org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers Done 
sleeping, membership established, start level:[4]
22-Apr-2024 10:19:07.773 INFO [main] 
org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers Sleeping 
for [1000] milliseconds to establish cluster membership, start level:[8]
22-Apr-2024 10:19:08.774 INFO [main] 
org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers Done 
sleeping, membership established, start level:[8]
22-Apr-2024 10:19:08.790 INFO [main] 
org.apache.catalina.ha.session.JvmRouteBinderValve.startInternal 
JvmRouteBinderValve started
22-Apr-2024 10:19:08.803 INFO [main] 
org.apache.catalina.startup.HostConfig.deployWAR Deploying web application 
archive [/home/web/servers/apache-tomcat-10.1.20/station/ROOT##0001.war]
Apr 22, 2024 10:20:01 AM org.apache.catalina.util.SessionIdGeneratorBase 
createSecureRandom
WARNING: Creation of SecureRandom instance for session ID generation using 
[SHA1PRNG] took [51,791] milliseconds.
Apr 22, 2024 10:20:01 AM org.apache.catalina.ha.session.DeltaManager 
startInternal
INFO: Register manager [##0001] to cluster element [Host] with name [station]
Apr 22, 2024 10:20:01 AM org.apache.catalina.ha.session.DeltaManager 
startInternal
INFO: Starting clustering manager at [##0001]
Apr 22, 2024 10:20:01 AM org.apache.catalina.ha.session.DeltaManager 
getAllClusterSessions
INFO: Manager [##0001]: skipping state transfer. No members active in cluster 
group.


Here is how I have clustering set up on server one



   

  

 

 

  

  

  
  
  

  


On the other server I just changed  the member ship  to a different port   
port="45564"
And reciver port to   a different port also 
   port="4002"


In my application level web.xml on both servers I have included the needed tag


What am I missing here?


Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com



Re: Tomcat 10 skipping state transfer. No members active in cluster group

2024-04-22 Thread Steve Carlsen
Would you please take me off of this list

On Mon, Apr 22, 2024 at 9:01 AM Rick Noel 
wrote:

> Hello,
>
> Could someone please explain why I am getting the error
>
> skipping state transfer. No members active in cluster group
>
> On one sever the reciever  is bound  to
> 127.0.0.1:4002
> And on the other server the receiver is bound to   127.0.0.1:4001
>
> But both servers report -> no active members in cluster group
>
>
> 22-Apr-2024 10:19:06.726 INFO [main]
> org.apache.catalina.core.StandardService.startInternal Starting service
> [Station]
> 22-Apr-2024 10:19:06.727 INFO [main]
> org.apache.catalina.core.StandardEngine.startInternal Starting Servlet
> engine: [Apache Tomcat/10.1.20]
> 22-Apr-2024 10:19:06.736 INFO [main]
> org.apache.catalina.ha.tcp.SimpleTcpCluster.startInternal Cluster is about
> to start
> 22-Apr-2024 10:19:06.750 INFO [main]
> org.apache.catalina.tribes.transport.ReceiverBase.bind Receiver Server
> Socket bound to:[/127.0.0.1:4002]
> 22-Apr-2024 10:19:06.762 INFO [main]
> org.apache.catalina.tribes.membership.McastServiceImpl.setupSocket Setting
> cluster mcast soTimeout to [500]
> 22-Apr-2024 10:19:06.771 INFO [main]
> org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers
> Sleeping for [1000] milliseconds to establish cluster membership, start
> level:[4]
> 22-Apr-2024 10:19:07.771 INFO [main]
> org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers Done
> sleeping, membership established, start level:[4]
> 22-Apr-2024 10:19:07.773 INFO [main]
> org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers
> Sleeping for [1000] milliseconds to establish cluster membership, start
> level:[8]
> 22-Apr-2024 10:19:08.774 INFO [main]
> org.apache.catalina.tribes.membership.McastServiceImpl.waitForMembers Done
> sleeping, membership established, start level:[8]
> 22-Apr-2024 10:19:08.790 INFO [main]
> org.apache.catalina.ha.session.JvmRouteBinderValve.startInternal
> JvmRouteBinderValve started
> 22-Apr-2024 10:19:08.803 INFO [main]
> org.apache.catalina.startup.HostConfig.deployWAR Deploying web application
> archive [/home/web/servers/apache-tomcat-10.1.20/station/ROOT##0001.war]
> Apr 22, 2024 10:20:01 AM org.apache.catalina.util.SessionIdGeneratorBase
> createSecureRandom
> WARNING: Creation of SecureRandom instance for session ID generation using
> [SHA1PRNG] took [51,791] milliseconds.
> Apr 22, 2024 10:20:01 AM org.apache.catalina.ha.session.DeltaManager
> startInternal
> INFO: Register manager [##0001] to cluster element [Host] with name
> [station]
> Apr 22, 2024 10:20:01 AM org.apache.catalina.ha.session.DeltaManager
> startInternal
> INFO: Starting clustering manager at [##0001]
> Apr 22, 2024 10:20:01 AM org.apache.catalina.ha.session.DeltaManager
> getAllClusterSessions
> INFO: Manager [##0001]: skipping state transfer. No members active in
> cluster group.
>
>
> Here is how I have clustering set up on server one
>
>  channelSendOptions="8">
>
> className="org.apache.catalina.ha.session.DeltaManager"
>
> expireSessionsOnShutdown="false"
>
> notifyListenersOnReplication="true"
>
> sessionAttributeNameFilter="uploader_redirect|phone_tree|soundhound.campaigndata|format|employee_id|customer|customer_id|nonidentifier_call_letters|call_letters|caller_id_enabled|ivr_system|ivr_system_id|zip_code|time_zone|is_trial_customer|delete_confirmation|download_settings|clustered_admin|wall_token|employee_first_name|logged_in_user|logged_in"
>  />
>
>className="org.apache.catalina.tribes.group.GroupChannel">
>
>   className="org.apache.catalina.tribes.membership.McastService"
> address="228.0.0.4"
> port="45565"
> frequency="500"
> dropTime="3000"/>
>
>   className="org.apache.catalina.tribes.transport.nio.NioReceiver"
>   address="auto"
>   port="4002"
>  autoBind="100"
>  selectorTimeout="5000"
>  maxThreads="6"/>
>
>className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
>  className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
>   
>
>className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
>className="org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor"/>
> 

Re: Tomcat 10 skipping state transfer. No members active in cluster group

2024-04-22 Thread Chuck Caldarale


> On Apr 22, 2024, at 09:54, Rick Noel  wrote:
> 
> Could someone please explain why I am getting the error
> 
> skipping state transfer. No members active in cluster group


Need a bit more information.


> On one sever the reciever  is bound  to  
> 127.0.0.1:4002
> And on the other server the receiver is bound to   127.0.0.1:4001


Are both Tomcat instances running on the same system (VM or real)?


> But both servers report -> no active members in cluster group


Indicates they can’t see each other, so they could be on different systems or 
in separate VMs (containers).


> Apr 22, 2024 10:20:01 AM org.apache.catalina.util.SessionIdGeneratorBase 
> createSecureRandom
> WARNING: Creation of SecureRandom instance for session ID generation using 
> [SHA1PRNG] took [51,791] milliseconds.


This long random ID generation is typical for a low-entropy VM or container 
rather than a real system. If the two Tomcats are in separate containers, 
you’ll have to configure clustering to use each container’s published IP 
address rather than assuming they can share the same loopback network.

  - Chuck


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



RE: [EXT]Re: Tomcat 10 skipping state transfer. No members active in cluster group

2024-04-22 Thread Rick Noel


Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Chuck Caldarale  
Sent: Monday, April 22, 2024 4:41 PM
To: Tomcat Users List 
Subject: [EXT]Re: Tomcat 10 skipping state transfer. No members active in 
cluster group


> On Apr 22, 2024, at 09:54, Rick Noel  wrote:
>
> Could someone please explain why I am getting the error
>
> skipping state transfer. No members active in cluster group


Need a bit more information.


> On one sever the reciever  is bound  to  
> 127.0.0.1:4002
> And on the other server the receiver is bound to   127.0.0.1:4001


Are both Tomcat instances running on the same system (VM or real)?

Tomcats are two different VMs


> But both servers report -> no active members in cluster group


Indicates they can’t see each other, so they could be on different systems or 
in separate VMs (containers).


> Apr 22, 2024 10:20:01 AM org.apache.catalina.util.SessionIdGeneratorBase 
> createSecureRandom
> WARNING: Creation of SecureRandom instance for session ID generation using 
> [SHA1PRNG] took [51,791] milliseconds.


This long random ID generation is typical for a low-entropy VM or container 
rather than a real system. If the two Tomcats are in separate containers, 
you’ll have to configure clustering to use each container’s published IP 
address rather than assuming they can share the same loopback network.

What do you mean each containers published IP

  - Chuck


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

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you know the sender and you are sure the 
content is safe. Please report the message using the Report Message feature in 
your email client if you believe the email is suspicious.


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



Re: [EXT]Re: Tomcat 10 skipping state transfer. No members active in cluster group

2024-04-22 Thread Chuck Caldarale

> On Apr 22, 2024, at 16:33, Rick Noel  wrote:
> 
> Tomcats are two different VMs


Which explains why they can’t talk to each other over 127.0.0.1.


> What do you mean each containers published IP


Each VM or container will have an assigned, individual IP address so it can 
communicate with networks outside of the VM (eg, the host machine or real 
world). You must use each VM’s assigned IP address - not 127.0.0.1 - in the 
clustering configuration to allow the two VMs to communicate with each other.

  - Chuck



RE: [EXT]Re: [EXT]Re: Tomcat 10 skipping state transfer. No members active in cluster group

2024-04-22 Thread Rick Noel
Chuck,

So you mean we use the VM's  IP as the address value below
Instead or using the value of   auto  ?






Rick Noel
Systems Programmer | Westwood One
rn...@westwoodone.com

-Original Message-
From: Chuck Caldarale  
Sent: Monday, April 22, 2024 6:20 PM
To: Tomcat Users List 
Subject: [EXT]Re: [EXT]Re: Tomcat 10 skipping state transfer. No members active 
in cluster group


> On Apr 22, 2024, at 16:33, Rick Noel  wrote:
>
> Tomcats are two different VMs


Which explains why they can’t talk to each other over 127.0.0.1.


> What do you mean each containers published IP


Each VM or container will have an assigned, individual IP address so it can 
communicate with networks outside of the VM (eg, the host machine or real 
world). You must use each VM’s assigned IP address - not 127.0.0.1 - in the 
clustering configuration to allow the two VMs to communicate with each other.

  - Chuck

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you know the sender and you are sure the 
content is safe. Please report the message using the Report Message feature in 
your email client if you believe the email is suspicious.


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



Re: Tomcat log warnings for connection parameter limits?

2024-04-22 Thread Baron Fujimoto
Thanks, Mark. Submitted <
https://bz.apache.org/bugzilla/show_bug.cgi?id=68934>

On Tue, Apr 16, 2024 at 4:44 AM Mark Thomas  wrote:

> It would be worth creating an enhancement request for this in Bugzilla
> to ensure the request doesn't get forgotten about.
>
> Mark
>
>
> On 16/04/2024 01:06, Baron Fujimoto wrote:
> >  From our perspective, it needn't be super timely. It would be more for
> > forensic confirmation that there's something we should consider. I think
> a
> > hysteresis behavior would be compatible with this.
> >
> > On Mon, Apr 15, 2024 at 12:00 AM Mark Thomas  wrote:
> >
> >> On 11/04/2024 21:28, Baron Fujimoto wrote> I was thinking it would be
> >> something that would be left on in a live> system. We can set these
> >> parameters, so it would be useful to know if we
> >>> were hitting the set limits.
> >>
> >> For the connection limit:
> >>
> >> How timely do you need the information to be? It is much easier to add a
> >> check when the connection is closed since a) it returns the current
> >> count and b) we are already checking the return value for mis-counting.
> >>
> >> For the thread limit:
> >>
> >> We have a couple of options here. (We use a custom queue which
> >> effectively changes the way threads in the pool re used.) The simplest
> >> is probably to add log in TaskQueue.offer() if all threads are currently
> >> being used.
> >>
> >>> I'm not sure I fully grasp how this additional logging presents a
> >>> significant incremental DOS risk. I mean, if an attacker is flooding
> you
> >>> with enough traffic or connections where this becomes an issue, aren't
> >> you
> >>> already logging various aspects of the attempts anyway (e.g., access
> >> logs,
> >>> etc)? At that point aren't your logs already being filled anyway?
> >>
> >> It is an area we need to be careful with. Log messages that include
> >> exceptions are of greatest concern since they are relatively expensive
> >> to generate. If an invalid HTTP message triggers a log message with an
> >> exception (it does, but only when configured for debug logging) then
> >> there is a degree of DoS risk there.
> >>
> >> Access logs are a special case and one that we have taken care to try
> >> and optimise. Still, if you want to make a performance test look good
> >> turning off access logging is one of the first things to do (and of
> >> course results in totally meaningless results that don't reflect real
> >> world usage).
> >>
> >> I think the concern Chris was trying to express (although I'm sure he'll
> >> correct me if I am wrong) is that when these limits are reached there is
> >> a risk of a lot of log messages being generated and that can cause
> >> issues both from a performance issue and from just filling the logs with
> >> the same message over and over again.
> >>
> >> I think what we would need is some form of hysteresis. Log a message
> >> when the limit is reached, log another message when usage falls below
> >> 80%? of the limit. That way, administrators see the peaks in usage but
> >> aren't inundated with log messages.
> >>
> >> My only concern is that at least some this code is going to run for
> >> every single request. It needs to be efficient. We should measure the
> >> impact of adding this code before we decide on whether to include it.
> >>
> >> Mark
> >>
> >>
> >>>
> >>> On Thu, Apr 11, 2024 at 1:44 AM Christopher Schultz <
> >>> ch...@christopherschultz.net> wrote:
> >>>
>  Baron,
> 
>  On 4/9/24 16:33, Baron Fujimoto wrote:
> > I'm investigating occasional 503 errors for our CAS service running
> in
> >> a
> > Tomcat 10.1.x container. The 503s appear to correlate with some
> traffic
> > spikes at the same time.
> >
> > The connector is configured as follows:
> >
> > protocol="org.apache.coyote.http11.Http11NioProtocol"
> >   port="8443"
> >   maxThreads="2500"
> >   maxConnections="5"
> >   maxPostSize="10"
> >   maxParameterCount="1000"
> >   scheme="https" secure="true"
> >   SSLEnabled="true"
> >   >
> >
> > Can Tomcat log info such as when the maxThreads or maxConnections
> >> limits
> > are reached? I'm basically trying to see if there is a good way to
> > more definitively determine what may have caused the 503s and what
> may
> >> be
> > feasible to mitigate them.
> 
>  Are you thinking of a debugging feature or something to be left-on
> for a
>  live production system?
> 
>  Such logging might be considered a DOS vector for a live system: you
> can
>  fill the logs by asking lots of trivial requests.
> 
>  -chris
> 
>  -
>  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>  For additional commands, e-mail: users-h...@tomcat.apache.org

Re: [EXT]Re: [EXT]Re: Tomcat 10 skipping state transfer. No members active in cluster group

2024-04-22 Thread Chuck Caldarale

> On Apr 22, 2024, at 18:48, Rick Noel  wrote:
> 
> So you mean we use the VM's  IP as the address value below
> Instead or using the value of   auto  ?
> 
> address="auto"
>port="4001"
>   autoBind="100"
>   selectorTimeout="5000"
>   maxThreads="6"/>


Correct. To quote from the Tomcat doc:

The IP broadcasted is java.net.InetAddress.getLocalHost().getHostAddress() 
(make sure you don't broadcast 127.0.0.1, this is a common error)

Unless the two JVMs are deployed on the same VM, you cannot use 127.0.0.1 and 
expect them to be able to communicate with each other.

Here’s an old e-mail describing the issue and one way of addressing it:

https://marc.info/?l=tomcat-user&m=118764351104059&w=2

The gist of it is this:

1. check what name the command `hostname` spits out
2. make sure that /etc/hosts contains that hostname and IP address

This must be done on each VM, of course. 

Returning localhost is typical for systems that use DHCP to obtain their IP 
addresses, such as my MacBook:

jshell> java.net.InetAddress.getLocalHost().getHostAddress();
$1 ==> "127.0.0.1"

  - Chuck



Installation on Win 10 failure.

2024-04-22 Thread DdC

I have installed tomcat originally with version 4.04 on winxp andlater on win7, 
ubuntu, and another linux box - many times by now.Trouble now with win10 and 
version 9.0.88.Yes, there is a jdk, CLASSPATH is set, j2ee.jar is in 
lib.Running in a cmd window with bin startup triggers another cmd windowto 
popup, shows errors flashing by and the 2nd window disappers. Running 
subsequently shutdown gives: Tomcat may not be running.Thanks a lot ...
Each next window version made installation more difficult - or i gotolder :-)
Is win10 creating trouble? Or ?
Thanks for help ...

--
Home page:      rs6.risingnet.net/~ddccMarketing site:  www . OntoOO.comKindle 
books:   Side Effects: Impacts on the 21st 
Century::https://www.amazon.com/-/es/Dennis-Champeaux-ebook/dp/B09MHJ5W48   
Even if not 
true::https://www.amazon.com/-/es/Dennis-Champeaux-ebook/dp/B09Y4WR9J7   9/11:: 
They had the Sun in their 
Eyeshttps://www.amazon.com/11-They-had-their-Eyes-ebook/dp/B0CMQ2WSK9https://www.amazon.nl/dp/B0CMQ2WSK9




Re: Installation on Win 10 failure.

2024-04-22 Thread Stephanie Panah
Perhaps I am misunderstanding, but if not, I had something similar.
be sure that tomcat is not running under Services.
then fire it off under tomcat.
and, of course, I may have just said nonsense.


On Mon, Apr 22, 2024 at 7:33 PM DdC  wrote:

>
> I have installed tomcat originally with version 4.04 on winxp andlater on
> win7, ubuntu, and another linux box - many times by now.Trouble now with
> win10 and version 9.0.88.Yes, there is a jdk, CLASSPATH is set, j2ee.jar is
> in lib.Running in a cmd window with bin startup triggers another cmd
> windowto popup, shows errors flashing by and the 2nd window
> disappers. Running subsequently shutdown gives: Tomcat may not be
> running.Thanks a lot ...
> Each next window version made installation more difficult - or i gotolder
> :-)
> Is win10 creating trouble? Or ?
> Thanks for help ...
>
> --
> Home page:  rs6.risingnet.net/~ddccMarketing site:  www .
> OntoOO.comKindle books:   Side Effects: Impacts on the 21st Century::
> https://www.amazon.com/-/es/Dennis-Champeaux-ebook/dp/B09MHJ5W48   Even
> if not true::
> https://www.amazon.com/-/es/Dennis-Champeaux-ebook/dp/B09Y4WR9J7   9/11::
> They had the Sun in their Eyeshttps://
> www.amazon.com/11-They-had-their-Eyes-ebook/dp/B0CMQ2WSK9https://www.amazon.nl/dp/B0CMQ2WSK9
>
>
>


Re: Installation on Win 10 failure.

2024-04-22 Thread Stephanie Panah
ack. I meant fire off under Eclipse, not tomcat.
if that helps


On Mon, Apr 22, 2024 at 9:03 PM Stephanie Panah 
wrote:

>
> Perhaps I am misunderstanding, but if not, I had something similar.
> be sure that tomcat is not running under Services.
> then fire it off under tomcat.
> and, of course, I may have just said nonsense.
>
>
> On Mon, Apr 22, 2024 at 7:33 PM DdC 
> wrote:
>
>>
>> I have installed tomcat originally with version 4.04 on winxp andlater on
>> win7, ubuntu, and another linux box - many times by now.Trouble now with
>> win10 and version 9.0.88.Yes, there is a jdk, CLASSPATH is set, j2ee.jar is
>> in lib.Running in a cmd window with bin startup triggers another cmd
>> windowto popup, shows errors flashing by and the 2nd window
>> disappers. Running subsequently shutdown gives: Tomcat may not be
>> running.Thanks a lot ...
>> Each next window version made installation more difficult - or i gotolder
>> :-)
>> Is win10 creating trouble? Or ?
>> Thanks for help ...
>>
>> --
>> Home page:  rs6.risingnet.net/~ddccMarketing site:  www .
>> OntoOO.comKindle books:   Side Effects: Impacts on the 21st Century::
>> https://www.amazon.com/-/es/Dennis-Champeaux-ebook/dp/B09MHJ5W48   Even
>> if not true::
>> https://www.amazon.com/-/es/Dennis-Champeaux-ebook/dp/B09Y4WR9J7
>>  9/11:: They had the Sun in their Eyeshttps://
>> www.amazon.com/11-They-had-their-Eyes-ebook/dp/B0CMQ2WSK9https://www.amazon.nl/dp/B0CMQ2WSK9
>>
>>
>>