RE: session-timeout and maxInactiveInterval

2016-06-20 Thread MWick


> -Original Message-
> From: Mark Thomas [mailto:ma...@apache.org]
> Sent: Monday, June 20, 2016 11:32 AM
> To: Tomcat Users List 
> Subject: Re: session-timeout and maxInactiveInterval
> 
> On 20/06/2016 16:00, mw...@loftware.com wrote:
> > We are running 7.0.69 and Java 1.8.0_91.
> >
> > We ran into an incident at a customer where the customer had set
> > session-timeout to 0 – which according to the servlet 3.0 spec, the
> > session should never time out.  However, the customer was basically
> > seeing the session timeout immediately.  When we changed
> > session-timeout to a larger number (30) and restarted, the problem
> immediately went away.
> 
> Set how?
> 
> I've looked through the code and everything looks OK.
> 
> What is the simplest possible test case that demonstrates this with a clean
> Tomcat install? (I'm thinking of something along the lines of changing the
> timeout in the web.xml for the examples app and adding a JSP that
> demonstrates the problem.)
> 
> Mark
> 

+1
Touche, barking up the wrong tree here.  Turns out to be an issue with Granite, 
for some reason using the Tomcat parameters, but using them wrong (fortunately 
we were able to work around the bug).

Sorry to waste your time.


> >
> >
> >
> > It looks like setMaxInactiveInterval _/may/_ be using the value of
> > session-timeout if it is not explicitly set, and if so, is not
> > handling the session-timeout = 0 case specially.  It also looks like
> > maxInactiveInterval is really controlling the lifetime of the session.
> >  But I have also not been through the Tomcat code often, so I am not
> > 100% sure I’m looking in the right spot.
> >
> >
> >
> > Has anyone seen this issue before?  Am I misinterpreting something?
> >
> >
> >
> > Thanks,
> >
> >
> >
> > Mark
> >
> >
> >
> >
> >
> > The Top 5 Trends in Enterprise Labeling for 2016
> >  > tml>
> > --
> > --
> > 
> >
> > 249 Corporate Drive, Portsmouth, NH 03801
> > Website: loftware.com  Connect with us:
> > Twitter  | LinkedIn
> >  | Google+
> > 
> > What is Enterprise Labeling?
> >  Why it's
> > essential for global businesses.
> > Visit the Enterprise Labeling Blog for all of your industry news
> >
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Need help with URL redirecting

2016-06-20 Thread tomcat

On 20.06.2016 23:57, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Sean,

On 6/20/16 2:26 PM, Sean Son wrote:

On Mon, Jun 20, 2016 at 12:53 PM, Mekkelsen Madden, Steve <
steve.mekkelsenmad...@pega.com> wrote:


One thing you could do is have an entry in your webapps\ROOT
folder called like: MyAppRedirect.html  (name can be anything)
Inside the file you need something like: 

In your conf\web.xml at the bottom of it, you'll see 3 lines
shown below: 
index.html
index.htm
index.jsp 

Change this to point to your MyAppRedirect.html page.

MyAppRedirect.html


That's a simple way to redirect your application.  Your DNS /
reverse proxy could take care of the port # and users only need
to call your application by name
(https://callMyApplication.domain.com) when the DNS/reverse proxy
redirects it to the server's port say 8088, the html file appends
the remaining portion of the url to what the users typed.


-Original Message- From: Sean Son
[mailto:linuxmailinglistsem...@gmail.com] Sent: Monday, June 20,
2016 12:42 PM To: Tomcat Users List ;
a...@ice-sa.com Subject: Re: Need help with URL redirecting

On Fri, Jun 17, 2016 at 3:39 PM, André Warnier (tomcat)
 wrote:


Hi. Another tip : on his list,mit is preferred if you respond
in or below the previous text. That's why I moved your previous
answer. It makes it easier to follow the conversation without
having to scroll back and forth all the time.







On Fri, Jun 17, 2016 at 12:03 PM, André Warnier (tomcat)
 wrote:

On 17.06.2016 17:03, Sean Son wrote:


Hello all


I am new to the list. This is what i am trying to do but
need help on:


I have a webapp running on tomcat 8:
https://myapp.example.com:8443/myapp

I am going to set up a DNS record myapp.example.com which
will point to the IP address of the tomcat server that
hosts the webapp.. I want this new DNS record
myapp.example.com to redirect to
https://myapp.example.com:8443/myapp. In other words, I
want the URL to redirect port 80 to the URL for the
webapp automatically so the users will not have to enter
in the port number whenever they want to browse to the
webapp. I tried doing research on google and I was not
able to find a straight forward way of doing this. Any
help is greatly appreciated!



The first thing you would have to check, is whether port
80 is still

free on that server, or if there is already another
webserver (e.g. Apache httpd) using it.

The second thing to clarify is whether, apart from "myapp",
there are other web applications (not called "myapp") which
you are running or would want to run under Tomcat on that
server. If not, then you might want to run your application
as the *default* application, so that users would get to it
with the URL " https://myapp.example.com:8443/;, instead of
" https://myapp.example.com:8443/myapp;. To do this first,
have a look at : http://wiki.apache.org/tomcat/HowTo and
look at #17 : How do I make my web application be the
tomcat default application

It will just be easier if you clear up the above points
first, because there are multiple possibilities, and it
narrows down the scope of the tips we can provide.



On 17.06.2016 18:43, Sean Son wrote:


Hello Andre

thank you for your response.

There are no other webservers running on this machine. There
are other web apps as well, but the only way to access them
is through myapp. So should I deploy myapp as the default app
?



Yes, I think that it will make the rest easier. So do that, as
per the instructions above, and then we will continue.







- -




To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org

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



Thank you for the tidbit about how to reply :) So I used number
17 from the website and i deployed the war file as the ROOT.war
file.  What should the next steps be?


I thank you again for all of your help!




Thank you Steve for the suggestion. Will this work with out using a
reverse proxy? My management told me not to use a reverse proxy


Yes, you can do this without a reverse proxy, but removing the port
number can be a bit of an issue, which is why a reverse proxy is
sometimes recommended: it's just easier that way -- especially if
another web server is already available for that purpose.

For more help, you'll have to give us more information about your
environment: OS, other services already available on the network, etc.
For example, if an appropriate reverse proxy is already available,
then you can point your DNS record to that proxy, and use a virtual
host for that domain name. Then, proxy everything to your Tomcat instanc
e.



Actually, I was thinking of using Tomcat only, and configuring 2  :
- one to listen on port 80, with a single and simple default app which sends back a 
"permanent redirect" to the other Host

- one to listen on the HTTPS 

Re: Need help with URL redirecting

2016-06-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Sean,

On 6/20/16 2:26 PM, Sean Son wrote:
> On Mon, Jun 20, 2016 at 12:53 PM, Mekkelsen Madden, Steve < 
> steve.mekkelsenmad...@pega.com> wrote:
> 
>> One thing you could do is have an entry in your webapps\ROOT
>> folder called like: MyAppRedirect.html  (name can be anything) 
>> Inside the file you need something like: > HTTP-EQUIV="Refresh" CONTENT="0; URL=../myApp/connection ">
>> 
>> In your conf\web.xml at the bottom of it, you'll see 3 lines
>> shown below:  
>> index.html 
>> index.htm 
>> index.jsp 
>> 
>> Change this to point to your MyAppRedirect.html page. 
>>  
>> MyAppRedirect.html 
>> 
>> 
>> That's a simple way to redirect your application.  Your DNS /
>> reverse proxy could take care of the port # and users only need
>> to call your application by name
>> (https://callMyApplication.domain.com) when the DNS/reverse proxy
>> redirects it to the server's port say 8088, the html file appends
>> the remaining portion of the url to what the users typed.
>> 
>> 
>> -Original Message- From: Sean Son
>> [mailto:linuxmailinglistsem...@gmail.com] Sent: Monday, June 20,
>> 2016 12:42 PM To: Tomcat Users List ;
>> a...@ice-sa.com Subject: Re: Need help with URL redirecting
>> 
>> On Fri, Jun 17, 2016 at 3:39 PM, André Warnier (tomcat)
>>  wrote:
>> 
>>> Hi. Another tip : on his list,mit is preferred if you respond
>>> in or below the previous text. That's why I moved your previous
>>> answer. It makes it easier to follow the conversation without
>>> having to scroll back and forth all the time.
>>> 
 
>>> 
 
 On Fri, Jun 17, 2016 at 12:03 PM, André Warnier (tomcat) 
  wrote:
 
 On 17.06.2016 17:03, Sean Son wrote:
> 
> Hello all
>> 
>> I am new to the list. This is what i am trying to do but
>> need help on:
>> 
>> 
>> I have a webapp running on tomcat 8: 
>> https://myapp.example.com:8443/myapp
>> 
>> I am going to set up a DNS record myapp.example.com which
>> will point to the IP address of the tomcat server that
>> hosts the webapp.. I want this new DNS record
>> myapp.example.com to redirect to
>> https://myapp.example.com:8443/myapp. In other words, I
>> want the URL to redirect port 80 to the URL for the
>> webapp automatically so the users will not have to enter
>> in the port number whenever they want to browse to the
>> webapp. I tried doing research on google and I was not
>> able to find a straight forward way of doing this. Any 
>> help is greatly appreciated!
>> 
>> 
>> 
>> The first thing you would have to check, is whether port
>> 80 is still
> free on that server, or if there is already another
> webserver (e.g. Apache httpd) using it.
> 
> The second thing to clarify is whether, apart from "myapp",
> there are other web applications (not called "myapp") which
> you are running or would want to run under Tomcat on that
> server. If not, then you might want to run your application
> as the *default* application, so that users would get to it
> with the URL " https://myapp.example.com:8443/;, instead of
> " https://myapp.example.com:8443/myapp;. To do this first,
> have a look at : http://wiki.apache.org/tomcat/HowTo and
> look at #17 : How do I make my web application be the
> tomcat default application
> 
> It will just be easier if you clear up the above points
> first, because there are multiple possibilities, and it
> narrows down the scope of the tips we can provide.
> 
> 
>>> On 17.06.2016 18:43, Sean Son wrote:
>>> 
 Hello Andre
 
 thank you for your response.
 
 There are no other webservers running on this machine. There
 are other web apps as well, but the only way to access them
 is through myapp. So should I deploy myapp as the default app
 ?
 
 
>>> Yes, I think that it will make the rest easier. So do that, as
>>> per the instructions above, and then we will continue.
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
- -
>>>
>>> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>> 
>>> 
>> Thank you for the tidbit about how to reply :) So I used number
>> 17 from the website and i deployed the war file as the ROOT.war
>> file.  What should the next steps be?
>> 
>> 
>> I thank you again for all of your help!
>> 
> 
> 
> Thank you Steve for the suggestion. Will this work with out using a
> reverse proxy? My management told me not to use a reverse proxy

Yes, you can do this without a reverse proxy, but removing the port
number can be a bit of an issue, which is why a reverse proxy is
sometimes recommended: it's just easier that way -- especially if
another web server is already available for that 

Re: Tomcat endpoints are becoming extremely unresponsive

2016-06-20 Thread Mark Thomas
On 20/06/2016 20:58, Craig Lynch wrote:
> We run embedded tomcat on version 8, and for some reason are consistently
> seeing extreme slowness across all Tomcat endpoints at very consistent
> intervals of three hours. Once a site gets into the slow state, it is never
> able to recover, and stays unresponsive (requests take tens of minutes to
> hours) until the service is manually restarted.
> 
> There are no resource issues that I've been able to detect (heap seems
> fine, no apparent memory leaks, cpu is fine, network/db connections aren't
> exhausted, etc). Tomcat does seem to receive the requests, but for some
> reason does not seem to be processing them.
> 
> There is an exception that occurs right around the time the service goes
> into a bad state, which is the reason I believe this to be a Tomcat issue.
> The stack trace is as follows:
> 
> Exception in thread "mc-26" java.lang.IllegalMonitorStateException
> at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(Unknown
> Source)
> at
> java.util.concurrent.locks.AbstractQueuedSynchronizer.release(Unknown
> Source)
> at java.util.concurrent.locks.ReentrantLock.unlock(Unknown Source)
> at java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
> at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)
> at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)
> at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
> at java.lang.Thread.run(Unknown Source)

And when you Googled "IllegalMonitorStateException LinkedBlockingQueue"
what did you find?

Mark


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



Tomcat endpoints are becoming extremely unresponsive

2016-06-20 Thread Craig Lynch
We run embedded tomcat on version 8, and for some reason are consistently
seeing extreme slowness across all Tomcat endpoints at very consistent
intervals of three hours. Once a site gets into the slow state, it is never
able to recover, and stays unresponsive (requests take tens of minutes to
hours) until the service is manually restarted.



There are no resource issues that I've been able to detect (heap seems
fine, no apparent memory leaks, cpu is fine, network/db connections aren't
exhausted, etc). Tomcat does seem to receive the requests, but for some
reason does not seem to be processing them.



There is an exception that occurs right around the time the service goes
into a bad state, which is the reason I believe this to be a Tomcat issue.
The stack trace is as follows:



Exception in thread "mc-26" java.lang.IllegalMonitorStateException



at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(Unknown
Source)



at
java.util.concurrent.locks.AbstractQueuedSynchronizer.release(Unknown
Source)



at java.util.concurrent.locks.ReentrantLock.unlock(Unknown Source)



at java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)



at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:103)



at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:31)



at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)



at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)



at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)



at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)



at java.lang.Thread.run(Unknown Source)



Having done some additional testing, I can elaborate on the state of things
when this exception occurs:

* The ReentrantLock that is throwing the exception is meant to throw the
IllegalMonitorStateException when a thread other than the thread that
created the lock tries to release it. Interestingly, when tryRelease() is
called, the owning thread is actually null, which means that the lock isn't
currently taken or owned by anyone.



* The lock's state is 0, which is consistent with the lock's owning thread
being null.



* The tryRelease funtion takes an int argument "releases", which is 1
(you'd find that in the stacktrace anyway, since it's passed in as a
constant further up, but mentioning it might save some time).



I realize that the LinkedBlockingQueue and ReentrantLock are java core
concurrency libraries, but it seems like Tomcat is getting into a bad state
once the error occurs, and is unable to exit the bad state. The executing
thread that gets this exception dies, and almost all other threads end up
staying almost all the time in an unsafe parked state. The
IllegalMonitorStateException also generally occurs in several threads after
it's shown up for the first time.



I'm not sure how to describe how to reproduce this issue, other than saying
that everyone at my company with our service installed experiences it very
reliably every three hours. We've been thus far unable to determine what
causes it, however. My personal theory is that somehow the TaskQueue is
getting into a state where it can only rarely give tasks to the executor
threads, but I don't know what causes things to enter that state. From what
we can tell, it does seem to be related to our Jersey endpoints.



If you need any additional information, just let me know and I'll be happy
to provide anything that might be useful. I've been getting most of my
information from thread/heap dumps as well as modifying local versions of
Tomcat to provide additional logging.



Most of our services are running Tomcat 8.0.32, but seem to still exhibit
the problem on versions at least as early as 8.0.15 and as late as 8.0.34.



I submitted this as a bug (59737), which Mark Thomas immediately closed
saying that there’s nothing to indicate that this is a Tomcat bug. I’m
happy to provide any additional information that might be useful, most of
I’ve looked at so far seems to point to Tomcat, though I would be ecstatic
if someone could point me to where I’m messing up J


Re: mod JK ho to rout all content to tomcat except for a few static folders

2016-06-20 Thread tomcat

On 20.06.2016 18:32, Campbell, Lance wrote:

Neither of these options will work for me:


I don't see why not.


1) no-jk is only supported for: "Starting with mod_jk 1.2.6 for Apache 2.x and 
1.2.19 for Apache 1.3"


So, you have Apache httpd 2.2.15 (which matches 2.x) and mod_jk 1.2.41, which is later 
than mod_jk 1.2.6.  So where is the problem ?



2) The urls that get sent to Tomcat are unkown.  This is a dynamic content 
driven site.


Yes, but the ones which are /not/ to be sent to Tomcat are known, as per your 
explanation.
(some "specific" static directories, like "/home/othercontent1" (although that does not 
match your example DocumentRoot))


Lines like
JkUnMount /URI/* worker
or
SetEnvIf Request_URI "/URI/*" no-jk
indicate which "URI"'s are /not/ sent to Tomcat.
They say nothing about what /is/ sent to Tomcat.
(which according to your
JkMount /* mytomcatapplication
would be everything else).

Or am I missing something ?

(Note that the "/URI/" above are a better match for Apache  sections, rather 
than  sections).





Any other options.

Thanks,

Lance

-Original Message-
From: Anthony Biacco [mailto:abia...@handll.com]
Sent: Monday, June 20, 2016 10:29 AM
To: Tomcat Users List 
Subject: Re: mod JK ho to rout all content to tomcat except for a few static 
folders

On Mon, Jun 20, 2016 at 9:14 AM, Campbell, Lance  wrote:


These are the versions of software I have to use.  I cannot install
other
software:



Apache 2.2.15

mod_jk  1.2.41

Tomcat 8.0.36



Issue:

We are looking at having a domain where all content will get routed to
Tomcat 8 except for three directories that contain static content.
These three directories will be served up by Apache.  Based on the
above versions how can I tell Apache to handle just these three
directories and then send all other content requests to Tomcat?






should be able to use either of:

JkUnMount /URI/* worker

SetEnvIf Request_URI "/URI/*" no-jk


-Tony

-
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: Need help with URL redirecting

2016-06-20 Thread Sean Son
On Mon, Jun 20, 2016 at 12:53 PM, Mekkelsen Madden, Steve <
steve.mekkelsenmad...@pega.com> wrote:

> One thing you could do is have an entry in your webapps\ROOT folder called
> like: MyAppRedirect.html  (name can be anything)
> Inside the file you need something like:
> 
>
> In your conf\web.xml at the bottom of it, you'll see 3 lines shown below:
> 
> index.html
> index.htm
> index.jsp
> 
>
> Change this to point to your MyAppRedirect.html page.
> 
> MyAppRedirect.html
> 
>
> That's a simple way to redirect your application.  Your DNS / reverse
> proxy could take care of the port # and users only need to call your
> application by name (https://callMyApplication.domain.com) when the
> DNS/reverse proxy redirects it to the server's port say 8088, the html file
> appends the remaining portion of the url to what the users typed.
>
>
> -Original Message-
> From: Sean Son [mailto:linuxmailinglistsem...@gmail.com]
> Sent: Monday, June 20, 2016 12:42 PM
> To: Tomcat Users List ; a...@ice-sa.com
> Subject: Re: Need help with URL redirecting
>
> On Fri, Jun 17, 2016 at 3:39 PM, André Warnier (tomcat) 
> wrote:
>
> > Hi.
> > Another tip : on his list,mit is preferred if you respond in or below
> > the previous text.
> > That's why I moved your previous answer.
> > It makes it easier to follow the conversation without having to scroll
> > back and forth all the time.
> >
> > >
> >
> >>
> >> On Fri, Jun 17, 2016 at 12:03 PM, André Warnier (tomcat)
> >> 
> >> wrote:
> >>
> >> On 17.06.2016 17:03, Sean Son wrote:
> >>>
> >>> Hello all
> 
>  I am new to the list. This is what i am trying to do but need help on:
> 
> 
>  I have a webapp running on tomcat 8:
>  https://myapp.example.com:8443/myapp
> 
>  I am going to set up a DNS record myapp.example.com which will
>  point to the IP address of the tomcat server that hosts the
>  webapp.. I want this new DNS record myapp.example.com to redirect
>  to https://myapp.example.com:8443/myapp.
>  In other words, I want the URL to redirect port 80 to the URL for
>  the webapp automatically so the users will not have to enter in the
>  port number whenever they want to browse to the webapp. I tried
>  doing research on google and I was not able to find a straight
>  forward way of doing this.
>  Any
>  help is greatly appreciated!
> 
> 
> 
>  The first thing you would have to check, is whether port 80 is
>  still
> >>> free
> >>> on that server, or if there is already another webserver (e.g.
> >>> Apache
> >>> httpd) using it.
> >>>
> >>> The second thing to clarify is whether, apart from "myapp", there
> >>> are other web applications (not called "myapp") which you are
> >>> running or would want to run under Tomcat on that server.
> >>> If not, then you might want to run your application as the *default*
> >>> application, so that users would get to it with the URL "
> >>> https://myapp.example.com:8443/;, instead of "
> >>> https://myapp.example.com:8443/myapp;.
> >>> To do this first, have a look at :
> >>>   http://wiki.apache.org/tomcat/HowTo
> >>> and look at #17 : How do I make my web application be the tomcat
> >>> default application
> >>>
> >>> It will just be easier if you clear up the above points first,
> >>> because there are multiple possibilities, and it narrows down the
> >>> scope of the tips we can provide.
> >>>
> >>>
> > On 17.06.2016 18:43, Sean Son wrote:
> >
> >> Hello Andre
> >>
> >> thank you for your response.
> >>
> >> There are no other webservers running on this machine. There are
> >> other web apps as well, but the only way to access them is through
> >> myapp. So should I deploy myapp as the default app ?
> >>
> >>
> > Yes, I think that it will make the rest easier.
> > So do that, as per the instructions above, and then we will continue.
> >
> >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> >
> Thank you for the tidbit about how to reply :) So I used number 17 from
> the website and i deployed the war file as the ROOT.war file.  What should
> the next steps be?
>
>
> I thank you again for all of your help!
>


Thank you Steve for the suggestion. Will this work with out using a reverse
proxy? My management told me not to use a reverse proxy

Thanks


Re: mod JK ho to rout all content to tomcat except for a few static folders

2016-06-20 Thread Rainer Jung

Am 20.06.2016 um 18:32 schrieb Campbell, Lance:

Neither of these options will work for me:
1) no-jk is only supported for: "Starting with mod_jk 1.2.6 for Apache 2.x and 
1.2.19 for Apache 1.3"


So? You wrote your versions are

Apache 2.2.15
mod_jk  1.2.41

and isn't 1.2.41 >= 1.2.6? So the no-jk feature is supported. Why do you 
think it is not?



2) The urls that get sent to Tomcat are unkown.  This is a dynamic content 
driven site.


1) and 2) both work once you know which URIs you want to exclude form 
forwarding. You wrote "except for three directories that contain static 
content" so I guess you are able to describe those URIs to exclude e.g. 
by one to three URI prefixes?


The examples Anthony gave are correct, so if your URIs to exclude start 
e.g. with /img/, /css/ and /static/, you could either


JkUnMount /img/* *
JkUnMount /css/* *
JkUnMount /static/* *

or

SetEnvIf Request_URI "/img/*" no-jk
SetEnvIf Request_URI "/css/*" no-jk
SetEnvIf Request_URI "/static/*" no-jk

I slightly prefer the JkUnMount way, because it is a bit easier to 
read/understand if you put it close to your JkMount in the config file. 
The second way is convenient if the exclusion rules get more complex, 
because you can do tricky stuff with environment variables (no-jk).


Regards,

Rainer


-Original Message-
From: Anthony Biacco [mailto:abia...@handll.com]
Sent: Monday, June 20, 2016 10:29 AM
To: Tomcat Users List 
Subject: Re: mod JK ho to rout all content to tomcat except for a few static 
folders

On Mon, Jun 20, 2016 at 9:14 AM, Campbell, Lance  wrote:


These are the versions of software I have to use.  I cannot install
other
software:



Apache 2.2.15

mod_jk  1.2.41

Tomcat 8.0.36



Issue:

We are looking at having a domain where all content will get routed to
Tomcat 8 except for three directories that contain static content.
These three directories will be served up by Apache.  Based on the
above versions how can I tell Apache to handle just these three
directories and then send all other content requests to Tomcat?






should be able to use either of:

JkUnMount /URI/* worker

SetEnvIf Request_URI "/URI/*" no-jk


-Tony


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



RE: Need help with URL redirecting

2016-06-20 Thread Mekkelsen Madden, Steve
One thing you could do is have an entry in your webapps\ROOT folder called 
like: MyAppRedirect.html  (name can be anything)
Inside the file you need something like:


In your conf\web.xml at the bottom of it, you'll see 3 lines shown below:

index.html
index.htm
index.jsp


Change this to point to your MyAppRedirect.html page.

MyAppRedirect.html


That's a simple way to redirect your application.  Your DNS / reverse proxy 
could take care of the port # and users only need to call your application by 
name (https://callMyApplication.domain.com) when the DNS/reverse proxy 
redirects it to the server's port say 8088, the html file appends the remaining 
portion of the url to what the users typed.


-Original Message-
From: Sean Son [mailto:linuxmailinglistsem...@gmail.com] 
Sent: Monday, June 20, 2016 12:42 PM
To: Tomcat Users List ; a...@ice-sa.com
Subject: Re: Need help with URL redirecting

On Fri, Jun 17, 2016 at 3:39 PM, André Warnier (tomcat) 
wrote:

> Hi.
> Another tip : on his list,mit is preferred if you respond in or below 
> the previous text.
> That's why I moved your previous answer.
> It makes it easier to follow the conversation without having to scroll 
> back and forth all the time.
>
> >
>
>>
>> On Fri, Jun 17, 2016 at 12:03 PM, André Warnier (tomcat) 
>> 
>> wrote:
>>
>> On 17.06.2016 17:03, Sean Son wrote:
>>>
>>> Hello all

 I am new to the list. This is what i am trying to do but need help on:


 I have a webapp running on tomcat 8:
 https://myapp.example.com:8443/myapp

 I am going to set up a DNS record myapp.example.com which will 
 point to the IP address of the tomcat server that hosts the 
 webapp.. I want this new DNS record myapp.example.com to redirect 
 to https://myapp.example.com:8443/myapp.
 In other words, I want the URL to redirect port 80 to the URL for 
 the webapp automatically so the users will not have to enter in the 
 port number whenever they want to browse to the webapp. I tried 
 doing research on google and I was not able to find a straight 
 forward way of doing this.
 Any
 help is greatly appreciated!



 The first thing you would have to check, is whether port 80 is 
 still
>>> free
>>> on that server, or if there is already another webserver (e.g. 
>>> Apache
>>> httpd) using it.
>>>
>>> The second thing to clarify is whether, apart from "myapp", there 
>>> are other web applications (not called "myapp") which you are 
>>> running or would want to run under Tomcat on that server.
>>> If not, then you might want to run your application as the *default* 
>>> application, so that users would get to it with the URL "
>>> https://myapp.example.com:8443/;, instead of "
>>> https://myapp.example.com:8443/myapp;.
>>> To do this first, have a look at :
>>>   http://wiki.apache.org/tomcat/HowTo
>>> and look at #17 : How do I make my web application be the tomcat 
>>> default application
>>>
>>> It will just be easier if you clear up the above points first, 
>>> because there are multiple possibilities, and it narrows down the 
>>> scope of the tips we can provide.
>>>
>>>
> On 17.06.2016 18:43, Sean Son wrote:
>
>> Hello Andre
>>
>> thank you for your response.
>>
>> There are no other webservers running on this machine. There are 
>> other web apps as well, but the only way to access them is through 
>> myapp. So should I deploy myapp as the default app ?
>>
>>
> Yes, I think that it will make the rest easier.
> So do that, as per the instructions above, and then we will continue.
>
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>
Thank you for the tidbit about how to reply :) So I used number 17 from the 
website and i deployed the war file as the ROOT.war file.  What should the next 
steps be?


I thank you again for all of your help!


Re: Need help with URL redirecting

2016-06-20 Thread Sean Son
On Fri, Jun 17, 2016 at 3:39 PM, André Warnier (tomcat) 
wrote:

> Hi.
> Another tip : on his list,mit is preferred if you respond in or below the
> previous text.
> That's why I moved your previous answer.
> It makes it easier to follow the conversation without having to scroll
> back and forth all the time.
>
> >
>
>>
>> On Fri, Jun 17, 2016 at 12:03 PM, André Warnier (tomcat) 
>> wrote:
>>
>> On 17.06.2016 17:03, Sean Son wrote:
>>>
>>> Hello all

 I am new to the list. This is what i am trying to do but need help on:


 I have a webapp running on tomcat 8:
 https://myapp.example.com:8443/myapp

 I am going to set up a DNS record myapp.example.com which will point to
 the
 IP address of the tomcat server that hosts the webapp.. I want this new
 DNS
 record myapp.example.com to redirect to
 https://myapp.example.com:8443/myapp.
 In other words, I want the URL to redirect port 80 to the URL for the
 webapp automatically so the users will not have to enter in the port
 number
 whenever they want to browse to the webapp. I tried doing research on
 google and I was not able to find a straight forward way of doing this.
 Any
 help is greatly appreciated!



 The first thing you would have to check, is whether port 80 is still
>>> free
>>> on that server, or if there is already another webserver (e.g. Apache
>>> httpd) using it.
>>>
>>> The second thing to clarify is whether, apart from "myapp", there are
>>> other web applications (not called "myapp") which you are running or
>>> would
>>> want to run under Tomcat on that server.
>>> If not, then you might want to run your application as the *default*
>>> application, so that users would get to it with the URL "
>>> https://myapp.example.com:8443/;, instead of "
>>> https://myapp.example.com:8443/myapp;.
>>> To do this first, have a look at :
>>>   http://wiki.apache.org/tomcat/HowTo
>>> and look at #17 : How do I make my web application be the tomcat default
>>> application
>>>
>>> It will just be easier if you clear up the above points first, because
>>> there are multiple possibilities, and it narrows down the scope of the
>>> tips
>>> we can provide.
>>>
>>>
> On 17.06.2016 18:43, Sean Son wrote:
>
>> Hello Andre
>>
>> thank you for your response.
>>
>> There are no other webservers running on this machine. There are other web
>> apps as well, but the only way to access them is through myapp. So should
>> I
>> deploy myapp as the default app ?
>>
>>
> Yes, I think that it will make the rest easier.
> So do that, as per the instructions above, and then we will continue.
>
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>
Thank you for the tidbit about how to reply :) So I used number 17 from the
website and i deployed the war file as the ROOT.war file.  What should the
next steps be?


I thank you again for all of your help!


RE: mod JK ho to rout all content to tomcat except for a few static folders

2016-06-20 Thread Campbell, Lance
Neither of these options will work for me:
1) no-jk is only supported for: "Starting with mod_jk 1.2.6 for Apache 2.x and 
1.2.19 for Apache 1.3"
2) The urls that get sent to Tomcat are unkown.  This is a dynamic content 
driven site.  

Any other options.

Thanks,

Lance

-Original Message-
From: Anthony Biacco [mailto:abia...@handll.com] 
Sent: Monday, June 20, 2016 10:29 AM
To: Tomcat Users List 
Subject: Re: mod JK ho to rout all content to tomcat except for a few static 
folders

On Mon, Jun 20, 2016 at 9:14 AM, Campbell, Lance  wrote:

> These are the versions of software I have to use.  I cannot install 
> other
> software:
>
>
>
> Apache 2.2.15
>
> mod_jk  1.2.41
>
> Tomcat 8.0.36
>
>
>
> Issue:
>
> We are looking at having a domain where all content will get routed to 
> Tomcat 8 except for three directories that contain static content.  
> These three directories will be served up by Apache.  Based on the 
> above versions how can I tell Apache to handle just these three 
> directories and then send all other content requests to Tomcat?
>
>
>
>
>
should be able to use either of:

JkUnMount /URI/* worker

SetEnvIf Request_URI "/URI/*" no-jk


-Tony

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



Re: session-timeout and maxInactiveInterval

2016-06-20 Thread Mark Thomas
On 20/06/2016 16:00, mw...@loftware.com wrote:
> We are running 7.0.69 and Java 1.8.0_91.
> 
> We ran into an incident at a customer where the customer had set
> session-timeout to 0 – which according to the servlet 3.0 spec, the
> session should never time out.  However, the customer was basically
> seeing the session timeout immediately.  When we changed session-timeout
> to a larger number (30) and restarted, the problem immediately went away.

Set how?

I've looked through the code and everything looks OK.

What is the simplest possible test case that demonstrates this with a
clean Tomcat install? (I'm thinking of something along the lines of
changing the timeout in the web.xml for the examples app and adding a
JSP that demonstrates the problem.)

Mark

> 
>  
> 
> It looks like setMaxInactiveInterval _/may/_ be using the value of
> session-timeout if it is not explicitly set, and if so, is not handling
> the session-timeout = 0 case specially.  It also looks like
> maxInactiveInterval is really controlling the lifetime of the session.
>  But I have also not been through the Tomcat code often, so I am not
> 100% sure I’m looking in the right spot.
> 
>  
> 
> Has anyone seen this issue before?  Am I misinterpreting something? 
> 
>  
> 
> Thanks,
> 
>  
> 
> Mark
> 
>  
> 
>  
> 
> The Top 5 Trends in Enterprise Labeling for 2016
> 
> 
> 
> 
>   249 Corporate Drive, Portsmouth, NH 03801
> Website: loftware.com 
> Connect with us: Twitter  | LinkedIn
>  | Google+
> 
> What is Enterprise Labeling?
>  Why it's
> essential for global businesses.
> Visit the Enterprise Labeling Blog for all of your industry news
> 


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



Re: mod JK ho to rout all content to tomcat except for a few static folders

2016-06-20 Thread Anthony Biacco
On Mon, Jun 20, 2016 at 9:14 AM, Campbell, Lance  wrote:

> These are the versions of software I have to use.  I cannot install other
> software:
>
>
>
> Apache 2.2.15
>
> mod_jk  1.2.41
>
> Tomcat 8.0.36
>
>
>
> Issue:
>
> We are looking at having a domain where all content will get routed to
> Tomcat 8 except for three directories that contain static content.  These
> three directories will be served up by Apache.  Based on the above versions
> how can I tell Apache to handle just these three directories and then send
> all other content requests to Tomcat?
>
>
>
>
>
should be able to use either of:

JkUnMount /URI/* worker

SetEnvIf Request_URI "/URI/*" no-jk


-Tony


mod JK ho to rout all content to tomcat except for a few static folders

2016-06-20 Thread Campbell, Lance
These are the versions of software I have to use.  I cannot install other 
software:



Apache 2.2.15

mod_jk  1.2.41

Tomcat 8.0.36



Issue:

We are looking at having a domain where all content will get routed to Tomcat 8 
except for three directories that contain static content.  These three 
directories will be served up by Apache.  Based on the above versions how can I 
tell Apache to handle just these three directories and then send all other 
content requests to Tomcat?



Example Apache configuration.  This is obviously made up.  It is just for the 
sake of providing a visual starting point:





  ServerName someserver.com

  DocumentRoot /www/testxxx/htdocs



  

  Options Indexes MultiViews

  AllowOverride None

  Order allow,deny

  Allow from all

  



  

  Options Indexes MultiViews

  AllowOverride None

  Order allow,deny

  Allow from all

  



  

  Options Indexes MultiViews

  AllowOverride None

  Order allow,deny

  Allow from all

  



  JkMount /* mytomcatapplication



  













session-timeout and maxInactiveInterval

2016-06-20 Thread MWick
We are running 7.0.69 and Java 1.8.0_91.

We ran into an incident at a customer where the customer had set 
session-timeout to 0 - which according to the servlet 3.0 spec, the session 
should never time out.  However, the customer was basically seeing the session 
timeout immediately.  When we changed session-timeout to a larger number (30) 
and restarted, the problem immediately went away.

It looks like setMaxInactiveInterval _may_ be using the value of 
session-timeout if it is not explicitly set, and if so, is not handling the 
session-timeout = 0 case specially.  It also looks like maxInactiveInterval is 
really controlling the lifetime of the session.  But I have also not been 
through the Tomcat code often, so I am not 100% sure I'm looking in the right 
spot.

Has anyone seen this issue before?  Am I misinterpreting something?

Thanks,

Mark


  
  




Re: Tomcat 8.5 slowdown with Resources element

2016-06-20 Thread Mark Thomas
On 20/06/2016 13:47, Mark Thomas wrote:
> On 20/06/2016 13:27, Mike Noordermeer wrote:
>> Further profiling leads me to believe that Tomcat starts using
>> JarWarResources if a  block is placed
>> in the server.xml file (even if unpackWars and unpackWar are true).
>> Still looking into why it is doing this though...
> 
> It is caused by the StandardRoot being started earlier (in
> StandardContext.initInternal()) before the docBase has been adjusted to
> the expanded WAR.
> 
> It may be possible to remove the WebResource initialisation from
> StandardContext.initInternal() entirely but that would need some
> research to figure out why it was there in the first place.

I dug into the history. It looks to be an unnecessary hangover from the
previous resources implementation. This has been fixed in 9.0.x [1] and
I'll back-port it to 8.5.x and 8.0.x.

Mark

[1] http://svn.apache.org/viewvc?view=revision=1749328

> 
> Mark
> 
>>
>> --Mike
>>
>> On 20 June 2016 at 12:06, Mike Noordermeer  wrote:
>>> Hi,
>>>
>>> I'm experiencing a very weird issue, and do not really have an idea
>>> where to start looking for the solution, hopefully someone here has an
>>> idea.
>>> As the Tomcat 8.5 Cache.getResource() call added some logging about
>>> the cache being too small, I'm trying to increase the size. The weird
>>> thing, is that simply defining a  element slows down my
>>> webapp startup greatly.
>>>
>>> ==
>>>
>>> Setup 1:
>>>
>>> server.xml
>>> ---
>>> >> unpackWARs="true" autoDeploy="false" deployOnStartup="false">
>>> 
>>> 
>>> 
>>> 
>>> ---
>>>
>>> Deploy time app: 180 seconds
>>>
>>> ==
>>>
>>> Setup 2:
>>>
>>> server.xml
>>> ---
>>> >> unpackWARs="true" autoDeploy="false" deployOnStartup="true">
>>> 
>>> ---
>>>
>>> Catalina/localhost/ROOT.xml
>>> ---
>>> 
>>> 
>>> 
>>> ---
>>>
>>> Deploy time app: 20 seconds
>>>
>>> ==
>>>
>>> If I remove the Resources element, everything is fine in all
>>> scenario's (but then I cannot increase the cache size).
>>>
>>> Going through the code, I can't see what would be different about
>>> defining an empty Resources element or no Resources element, or what
>>> would be different in defining the webapp in server.xml or in a
>>> separate context file. Any insights and ideas are appreciated.
>>>
>>> Many thanks,
>>>
>>> Mike
>>
>> -
>> 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
> 


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



Re: Tomcat 8.5 slowdown with Resources element

2016-06-20 Thread Mark Thomas
On 20/06/2016 13:27, Mike Noordermeer wrote:
> Further profiling leads me to believe that Tomcat starts using
> JarWarResources if a  block is placed
> in the server.xml file (even if unpackWars and unpackWar are true).
> Still looking into why it is doing this though...

It is caused by the StandardRoot being started earlier (in
StandardContext.initInternal()) before the docBase has been adjusted to
the expanded WAR.

It may be possible to remove the WebResource initialisation from
StandardContext.initInternal() entirely but that would need some
research to figure out why it was there in the first place.

Mark

> 
> --Mike
> 
> On 20 June 2016 at 12:06, Mike Noordermeer  wrote:
>> Hi,
>>
>> I'm experiencing a very weird issue, and do not really have an idea
>> where to start looking for the solution, hopefully someone here has an
>> idea.
>> As the Tomcat 8.5 Cache.getResource() call added some logging about
>> the cache being too small, I'm trying to increase the size. The weird
>> thing, is that simply defining a  element slows down my
>> webapp startup greatly.
>>
>> ==
>>
>> Setup 1:
>>
>> server.xml
>> ---
>> > unpackWARs="true" autoDeploy="false" deployOnStartup="false">
>> 
>> 
>> 
>> 
>> ---
>>
>> Deploy time app: 180 seconds
>>
>> ==
>>
>> Setup 2:
>>
>> server.xml
>> ---
>> > unpackWARs="true" autoDeploy="false" deployOnStartup="true">
>> 
>> ---
>>
>> Catalina/localhost/ROOT.xml
>> ---
>> 
>> 
>> 
>> ---
>>
>> Deploy time app: 20 seconds
>>
>> ==
>>
>> If I remove the Resources element, everything is fine in all
>> scenario's (but then I cannot increase the cache size).
>>
>> Going through the code, I can't see what would be different about
>> defining an empty Resources element or no Resources element, or what
>> would be different in defining the webapp in server.xml or in a
>> separate context file. Any insights and ideas are appreciated.
>>
>> Many thanks,
>>
>> Mike
> 
> -
> 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: Tomcat 8.5 slowdown with Resources element

2016-06-20 Thread Mike Noordermeer
Further profiling leads me to believe that Tomcat starts using
JarWarResources if a  block is placed
in the server.xml file (even if unpackWars and unpackWar are true).
Still looking into why it is doing this though...

--Mike

On 20 June 2016 at 12:06, Mike Noordermeer  wrote:
> Hi,
>
> I'm experiencing a very weird issue, and do not really have an idea
> where to start looking for the solution, hopefully someone here has an
> idea.
> As the Tomcat 8.5 Cache.getResource() call added some logging about
> the cache being too small, I'm trying to increase the size. The weird
> thing, is that simply defining a  element slows down my
> webapp startup greatly.
>
> ==
>
> Setup 1:
>
> server.xml
> ---
>  unpackWARs="true" autoDeploy="false" deployOnStartup="false">
> 
> 
> 
> 
> ---
>
> Deploy time app: 180 seconds
>
> ==
>
> Setup 2:
>
> server.xml
> ---
>  unpackWARs="true" autoDeploy="false" deployOnStartup="true">
> 
> ---
>
> Catalina/localhost/ROOT.xml
> ---
> 
> 
> 
> ---
>
> Deploy time app: 20 seconds
>
> ==
>
> If I remove the Resources element, everything is fine in all
> scenario's (but then I cannot increase the cache size).
>
> Going through the code, I can't see what would be different about
> defining an empty Resources element or no Resources element, or what
> would be different in defining the webapp in server.xml or in a
> separate context file. Any insights and ideas are appreciated.
>
> Many thanks,
>
> Mike

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



Re: Tomcat 8.5 slowdown with Resources element

2016-06-20 Thread Mike Noordermeer
> As an answer to your last question above, look here :
> http://tomcat.apache.org/tomcat-8.0-doc/config/context.html
> --> Defining a context

I'm not sure what you are referring to?
I know that a server.xml can contain multiple contexts, and cannot be
changed at runtime, but that does not really explain the issues I'm
seeing.

Regards,

Mike

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



Re: Tomcat 8.5 slowdown with Resources element

2016-06-20 Thread tomcat

On 20.06.2016 12:06, Mike Noordermeer wrote:

Hi,

I'm experiencing a very weird issue, and do not really have an idea
where to start looking for the solution, hopefully someone here has an
idea.
As the Tomcat 8.5 Cache.getResource() call added some logging about
the cache being too small, I'm trying to increase the size. The weird
thing, is that simply defining a  element slows down my
webapp startup greatly.

==

Setup 1:

server.xml
---

 
 
 

---

Deploy time app: 180 seconds

==

Setup 2:

server.xml
---


---

Catalina/localhost/ROOT.xml
---

 

---

Deploy time app: 20 seconds

==

If I remove the Resources element, everything is fine in all
scenario's (but then I cannot increase the cache size).

Going through the code, I can't see what would be different about
defining an empty Resources element or no Resources element, or what
would be different in defining the webapp in server.xml or in a
separate context file. Any insights and ideas are appreciated.


As an answer to your last question above, look here :
http://tomcat.apache.org/tomcat-8.0-doc/config/context.html
--> Defining a context



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



Tomcat 8.5 slowdown with Resources element

2016-06-20 Thread Mike Noordermeer
Hi,

I'm experiencing a very weird issue, and do not really have an idea
where to start looking for the solution, hopefully someone here has an
idea.
As the Tomcat 8.5 Cache.getResource() call added some logging about
the cache being too small, I'm trying to increase the size. The weird
thing, is that simply defining a  element slows down my
webapp startup greatly.

==

Setup 1:

server.xml
---





---

Deploy time app: 180 seconds

==

Setup 2:

server.xml
---


---

Catalina/localhost/ROOT.xml
---



---

Deploy time app: 20 seconds

==

If I remove the Resources element, everything is fine in all
scenario's (but then I cannot increase the cache size).

Going through the code, I can't see what would be different about
defining an empty Resources element or no Resources element, or what
would be different in defining the webapp in server.xml or in a
separate context file. Any insights and ideas are appreciated.

Many thanks,

Mike

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