* Barley <[EMAIL PROTECTED]> [0256 21:56]:
> OK, so then do I have this right?
> 
> I put virtual host declarations in <Host> containers in
> the server.xml file.
> 
> I put <Context>'s in my <Host> to point Tomcat at the
> various url patterns it should handle.

Yeah, pretty much - you can also  create a file called
foo.xml in hostroot/
and tomcat will create a context based on that (easier to admin than editing 
server.xml all
the time).

> I configure authorization restraints in the
> /hostroot/WEB-INF/web.xml file. 

hostroot/contextname/WEB-INF/web.xml

Well, the way I do it (I doubt it's the only way) is this:

I have a host called pussy.tenten (as in tomcat, kitty,pussy - nothing kinky), and so 
I create
a vhost called pussy.tenten by creating a <Host> element in server.xml. It has an 
appBase of
'pussy', so that translates to $CATALINA_HOME/pussy on my box.

Requests to http://pussy.tenten will be answered by this vhost.

Now if I create a directory pussy/test, tomcat automatically reads that as a new 
Context
called 'test'.

pussy/test/index.jsp will be viewable as:

http://pussy.tenten/test/index.jsp

WEB-INF is then inside test/ , and if I copied foo.war to $CATALINA_HOME/pussy, tomcat
auto-deploys it by extracting it to pussy/foo/ and I'd be able to view its contents at

http://pussy.tenten/foo/

> Can I configure
> authorization based on url patterns? Like all access to
> /securestuff/ requires admin access, or does this
> require a separate webapp?

That'll work, but paths inside the web.xml are usually relative to that webapp
(i.e they'd have a test/ prefix in the example above).

Very good explanation of web.xml at http://www.moreservlets.com (downloadable pdf)

Very good explanation of server.xml at the tomcat homepage.

> http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/context.html

Yeah, that's it! 

> > Tim Moore / Blackboard Inc. / Software Engineer


-- 
One cannot make an omelette without breaking eggs -- but it is amazing
how many eggs one can break without making a decent omelette.
                -- Professor Charles P. Issawi
Rasputin :: Jack of All Trades - Master of Nuns

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

Reply via email to