Re: Virtual Hosts: path=/ without using ROOT folder?

2008-02-26 Thread Jeff Hoffmann

Mark Thomas wrote:

ahnf wrote:
My question is, is there any way other than making the application's 
root directory be ROOT or deployed under ROOT/ in order to get it to 
respond to /? I tried the path attribute but it says that it is 
only valid when the Context is defined in server.xml and not in 
META-INFO/context.xml. 

http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

Use context.xml - approach #2 and configure both a docBase and a path. 
Note the docBase *must* be outside of any host's appBase.


On a related note, is it possible to access these virtual hosts through 
connecters (mod_jk/Apache)?  I don't really know anything about the 
content of AJP connections -- do they pass the virtual host name to 
allow Tomcat to direct the requests to the right host or do all the 
requests go to the defaultHost?


--
Jeff Hoffmann
PropertyKey.com

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Does anyone have an approach to checking if Tomcat instance is UP?

2007-08-20 Thread Jeff Hoffmann

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dan,

Dan Armbrust wrote:

A simple cron job that points to a URL using lynx, and greps the
output for what it should see will do the trick...


I would use wget instead of Lynx, but that's just me.

Don't forget that the OP said that his JSPs appear to run correctly even
after the OOME.


If what you're concerned about is an OOME, you can have a JSP that 
queries the runtime memory usage and outputs something easily parsable 
to alert you to a (pending) problem.  IE:


Runtime rt = Runtime.getRuntime();
double used = rt.totalMemory()-rt.freeMemory();
double free = rt.freeMemory();
double available =  rt.maxMemory()-rt.totalMemory();
double usedpercent = (used/rt.maxMemory()) * 100;
double freepercent = (free/rt.maxMemory()) * 100;
double availablepercent = (available/rt.maxMemory()) * 100;

If your normal state is used % is  50%, you could send out a warning 
when it goes to 70% or restart if it goes to 90%.


--
Jeff Hoffmann
Head Plate Spinner
PropertyKey.com

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



forcing encodeURL to work on URLs outside of webapp context

2006-01-06 Thread Jeff Hoffmann
I have a webapp that that's being accessed from Apache through mod_jk. 
When the requests come to Apache, they get sent through mod_rewrite to 
add the appropriate webapp context path in front of the rest of the 
request so it can get sent through mod_jk to be processed.  When I 
create links in the web pages that get returned, usually they don't have 
the context path in them because I'm having mod_rewrite handle that. 
The problem is when I try to do an encodeURL() on these links, it 
doesn't do anything (I'm assuming because it thinks the link is outside 
of the webapp and therefore shouldn't have the session info appended). 
I've already handled the cookie-based session handling by setting up 
cross-context cookies.  What I'm wondering is if there's a way to force 
the URL-rewrite session handling to work in this situation?


--
Jeff Hoffmann
[EMAIL PROTECTED]

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