tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allistair Crossley" <>
Subject RE: Migrating from Apache2/JK2 to Tomcat standalone
Date Fri, 03 Dec 2004 11:23:09 GMT

> 1) Since Tomcat now will be serving all the static content as 
> well, will it require more threads than when only serving dynamic content?

That doesn't *have* to be the case. You could still have Apache serve up your static resources
by pointing the document root at your webapp's root directory. 

Static resources are served by a defaut servlet in Tomcat, so I am guessing that needs a 
request thread and so perhaps your maxThreads should be slightly higher than when a web server
is taking care of that stuff. * Note: I could be wrong, and if I am, someone will correct
me later I am sure ;) *

> 2) In Apache I'm using mod_rewrite to rewrite requests to 
> to I've implemented this behaviour by using 
> response.sendRedirect in a scriptlet in the index.jsp of my ROOT app. Is > this the
preferred way of doing this?

Not really. You should configure Apache/Tomcat connectivity using jk (or soon/now mod_proxy).
In JK which is how most people do it currently, you create a workers file that uses URL matching
to decide whether the request should be passed to Tomcat. Check out the JK connector docs

> 3) In Apache I'm using some aliases to serve images stored outside my 
> appbase from insisde my webapp (Alias /myapp/alias "/path/outside/appbase"). I've 
> implemented this by creating context xml files for all my aliases with 
> appBase="/path/outside/appbase" path="/myapp/alias". Again, is this the preferred way
of > doing this?

This breaks the general rule that web applications shoud be self-contained, so I don't recommend
it but you have probably found that it "works".

> 4) I've compiled jsvc and adapted the to start the 
> server. If I do " stop ; start" to do a restart of > the server
my machine hangs. If I allow a pause between stop and start then the 
> server starts with no problem. Is this a known issue?

On Linux/Unix I have found you need to give Tomcat a little moment to shut down all the threads
it creates. You can see this yourself by starting tomcat and constantly monitoring ps -e ..
you'll see the various processes for Tomcat building up. Same for shutdown, they disappear.
I am not sure about the exact answer, but I suspect if you are calling start and stop too
fast, there will be a binding problem on tomcat's port or something. I once wrote a script
for restart that slept for a few seconds after the shutdown.


QAS Ltd.
Developers of QuickAddress Software
<a href=""></a>
Registered in England: No 2582055
Registered in Australia: No 082 851 474

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message