tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zacharias J. Beckman" <zbeck...@creativesun.com>
Subject Re: List Archive + Questions
Date Sat, 08 Jan 2000 23:22:52 GMT
>  - In the conf directives in the tomcat.conf file, there's are lines that
> look like this and specify which web applications get served by which
> URLs:
>
> ApJServMount default /root
> ApJServMount /examples /root
>
>  - The default server.xml has a section reading:

If you find answers to these questions, please post them! I've been working
with Tomcat for about two weeks, trying to get virtual hosts, contexts,
servlet processing, etc., working smoothly. So far, not much luck. I wish I
had better news; as far as I can tell, Tomcat doesn't work well with virtual
hosts. At least in 3.0 you simply have to create a separate context for every
host and tailor your web site URLs appropriately.

This is unfortunately very unattractive and means that building cross-site
code isn't very feasible, unless you run different Apache servers on different
ports, so each server has its own Tomcat configuration. That is, we can't use
//www.foo.com/file.jsp, we have to introduce a new context, such as
//www.foo.com/foo_jsps/foo.jsp... otherwise, the root-level contexts between
virtual hosts seems to become "confused."

I've experimented with putting ApJServMount directives inside of VirtualHost
configurations. This leads to largely broken, somewhat limited success. I
don't think the scope is actually being limited to the enclosing VirtualHost.
For instance, I tried this:

1. Create a /foo context,
2. Create a /bar context,
3,4: Mount them at "/" into respective foo and bar web sites,
5. Put a test.jsp into each web site document root.

The problem is, even though test.jsp generates different output for each web
site, it appears the //www.foo.com/test.jsp calls the same JSP as
//www.bar.com/test.jsp. In other words, all JSPs are being shared among all
web sites, and it seems to be a first come, first serve approach.

It causes another problem as well. Since it results in all JSP/servlet calls
being redirected to the Tomcat server, root-level URL references don't work.
For instance, I have a JSP site where URLs such as "/common/funcs.jsp" is used
throughout. Once Tomcat was installed, you end up seeing plenty of "File not
found: /common/funcs.jsp" errors, because the root-level reference is broken.
We need to insert a context at the head of the URL.

Another alternative, of course, is to name each JSP &/or servlet differently
for each web site. I.e.: foo_test.jsp and bar_test.jsp. Unattractive for
obvious reasons.

That's about as far as I've gotten...

I'm (trying to) using Apache 1.3.9 and Tomcat 3.0 on RH Linux 6.1.
--
Zacharias J. Beckman - zbeckman@creativesun.com - (U.S.) 305-281-8701
Creative Sun Inc., Publishing for the Internet - http://www.creativesun.com

Far better it is to dare mighty things, to win glorious triumphs, even
though checkered by failure, than to take rank with those poor spirits who
neither enjoy nor suffer much, because they live in the gray twilight that
knows neither victory nor defeat. -- Theodore Roosevelt


Mime
View raw message