You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Juliano Viana <ju...@estrelar.com> on 2000/07/05 16:03:42 UTC
Tomcat/Apache integration question
Hi,
I have been playing with tomcat and apache and found a very strange
behaviour with ApJServMount. I didn't find this in FAQ, and didn't
find a mail list archive either so excuse me if this is a known issue.
Let me state the problem. Supose I have three contexts in tomcat,
let's say "A" and "B" and "ROOT"."A" is mapped in server.xml to /A , B
is mapped to /B and ROOT is mapped to /.
In apache, i have two virtual domains , "X" and "Y". I want the
virtual domain X to access the context A and the domain Y to access
context B. So i put the following lines in my httpd.conf:
<VirtualHost xxx.yyy.zzz>
ServerName X
ApJservMount / ajpv12://localhost:8007/A
</VirtualHodt>
<VirtualHost xxx.yyy.zzz>
ServerName Y
ApJservMount / ajpv12://localhost:8007/B
</VirtualHodt>
When i access http://X i see the ROOT's index page. The same happens
if i access http://Y. If i access http://X/A i see A's index page, if
i access http://X/B i see B's index page. Same with http://Y.
Now, if i understand the idea right, the expected behaviour would be:
http://X -> A index page
http://Y -> B index page.
It seems that the jserv module is passing the request "as is" to the
Tomcat engine, wihtout performing any translation...
Is this a known bug? Or am i doing something wrong? Can someone repeat
this results?Any help is appreciated...
Regards,
Juliano.
RE: Tomcat/Apache integration question
Posted by "Jay Freeman (saurik)" <sa...@saurik.com>.
Chris:
I had thought the JVM problem you were talking of was being caused by having
to have totally different installations of Tomcat running on different
ports, as to have the same functionality before the edition of the <Host>
element with a single installation of Tomcat would have required multiple
<Context> elements with bogus path's and mod_rewrite rules for each
VirtualHost to change the directory it appears to be in so as to trick
Tomcat into running them.
I was about to say I stand corrected, as after reading this message I went
and looked more carefully, and noticed Tomcat was loading multiple instances
of java for every context that it had defined. However, I thought about it
a little more even after that, and believe that I still feel like the
multiple contexts/<Host>'s in a single instance of Tomcat does solve the JVM
problem. Here is my argument:
Linux doesn't have support for "thread"'s (defined as being separate from
processes) like Windows does. Instead you have to build these as entirely
new processes and share a bunch of memory between them (possibly using
clone() instead of fork()). I would argue that the multiple instances of
the Java interpreter that are being loaded for every context defined in
Tomcat is actually a thread being spawned due to Tomcat's usage of the Java
native_threads library, and that, in fact, only one "instance" of the JVM is
actually loaded, and that all these java processes are sharing a large
portion of their memory segment. When I load Tomcat 3.2 with a large number
of contexts or without a large number of contexts my memory usage doesn't
change much, but that isn't all that accurate a test. I do not understand
what the various memory terms, such as RSS and DRS, mean so I do not know
how to interpret a "ps axv".
I would be greatly interested to see if, on NT, multiple processes are being
spawned or not. I will probably check it out in the next couple days
myself, now, because I am curious :) .
Sincerely,
Jay Freeman (saurik)
saurik@saurik.com
-----Original Message-----
From: Chris Todd [mailto:cltodd@bellatlantic.net]
Sent: Wednesday, July 05, 2000 8:00 PM
To: tomcat-user@jakarta.apache.org
Subject: RE: Tomcat/Apache integration question
So am I to understand from this thread that the way in which Tomcat supports
VirtualHosts is fundamentally different from the way JServ does? We
currently use JServ on our servers, many of which have as many as several
hundred virtual hosts, and JServ's concept of servlet zones works very well.
It secures each zone so that the servlets of zone A cannot access the
resources of zone B. But from this thread, it would appear that there is no
equivalent separation of "contexts" (which I assume - and correct me if I'm
wrong - are Tomcat's equivalent to servlet zones).
I did, however, read in the User's guide that Tomcat can support
VirtualHosts using a separate instance of Tomcat (running inside of it's own
JVM) for each VirtualHost, but our servers simply do not have the resources
to handle a couple hundred JVMs. Jay Freeman (saurik) was kind enough to
reply to my previous host in which I posed the same questions as I do here,
but it is not clear to me that Jay's configuration supports multiple Virtual
Hosts all running in the same JVM, and yet provides the kind of application
security that JServ's servlet zones do. Jay, can you clear that up for us?
Sincerest regards,
Chris Todd
Software Engineer
Alabanza Corporation
ctodd@alabanza.com
> -----Original Message-----
> From: Rob S. [mailto:rslifka@home.com]
> Sent: Wednesday, July 05, 2000 12:55 PM
> To: tomcat-user@jakarta.apache.org
> Subject: RE: Tomcat/Apache integration question
>
>
> Hi Juliano,
>
> I never got a response from the list as to whether or not
> that's a bug, and
> I couldn't find anything in any of the documentation or FAQs.
> What you
> describe is what I believe should be the intuitive contextual
> behaviour.
>
> Upgrading to Tomcat 3.2, which is supposed to be released any day now,
> solved my problem(s).
>
> Hope it helps!
>
> - r
>
> > -----Original Message-----
> > From: Juliano Viana [mailto:juliano@estrelar.com]
> > Sent: July 5, 2000 7:04 AM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Tomcat/Apache integration question
> >
> >
> > Hi,
> >
> > I have been playing with tomcat and apache and found a very strange
> > behaviour with ApJServMount. I didn't find this in FAQ, and didn't
> > find a mail list archive either so excuse me if this is a
> known issue.
> >
> > Let me state the problem. Supose I have three contexts in tomcat,
> > let's say "A" and "B" and "ROOT"."A" is mapped in
> server.xml to /A , B
> > is mapped to /B and ROOT is mapped to /.
> > In apache, i have two virtual domains , "X" and "Y". I want the
> > virtual domain X to access the context A and the domain Y to access
> > context B. So i put the following lines in my httpd.conf:
> >
> > <VirtualHost xxx.yyy.zzz>
> > ServerName X
> > ApJservMount / ajpv12://localhost:8007/A
> > </VirtualHodt>
> > <VirtualHost xxx.yyy.zzz>
> > ServerName Y
> > ApJservMount / ajpv12://localhost:8007/B
> > </VirtualHodt>
> >
> >
> > When i access http://X i see the ROOT's index page. The same happens
> > if i access http://Y. If i access http://X/A i see A's
> index page, if
> > i access http://X/B i see B's index page. Same with http://Y.
> >
> > Now, if i understand the idea right, the expected behaviour
> would be:
> > http://X -> A index page
> > http://Y -> B index page.
> >
> > It seems that the jserv module is passing the request "as is" to the
> > Tomcat engine, wihtout performing any translation...
> >
> > Is this a known bug? Or am i doing something wrong? Can
> someone repeat
> > this results?Any help is appreciated...
> >
> > Regards,
> > Juliano.
> >
> >
> >
> >
> >
> >
> --------------------------------------------------------------
> ------------
> > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commmands, email: tomcat-user-help@jakarta.apache.org
> >
>
>
> --------------------------------------------------------------
> ------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
>
--------------------------------------------------------------------------
To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
For additional commmands, email: tomcat-user-help@jakarta.apache.org
RE: Tomcat/Apache integration question
Posted by Chris Todd <cl...@bellatlantic.net>.
So am I to understand from this thread that the way in which Tomcat supports
VirtualHosts is fundamentally different from the way JServ does? We
currently use JServ on our servers, many of which have as many as several
hundred virtual hosts, and JServ's concept of servlet zones works very well.
It secures each zone so that the servlets of zone A cannot access the
resources of zone B. But from this thread, it would appear that there is no
equivalent separation of "contexts" (which I assume - and correct me if I'm
wrong - are Tomcat's equivalent to servlet zones).
I did, however, read in the User's guide that Tomcat can support
VirtualHosts using a separate instance of Tomcat (running inside of it's own
JVM) for each VirtualHost, but our servers simply do not have the resources
to handle a couple hundred JVMs. Jay Freeman (saurik) was kind enough to
reply to my previous host in which I posed the same questions as I do here,
but it is not clear to me that Jay's configuration supports multiple Virtual
Hosts all running in the same JVM, and yet provides the kind of application
security that JServ's servlet zones do. Jay, can you clear that up for us?
Sincerest regards,
Chris Todd
Software Engineer
Alabanza Corporation
ctodd@alabanza.com
> -----Original Message-----
> From: Rob S. [mailto:rslifka@home.com]
> Sent: Wednesday, July 05, 2000 12:55 PM
> To: tomcat-user@jakarta.apache.org
> Subject: RE: Tomcat/Apache integration question
>
>
> Hi Juliano,
>
> I never got a response from the list as to whether or not
> that's a bug, and
> I couldn't find anything in any of the documentation or FAQs.
> What you
> describe is what I believe should be the intuitive contextual
> behaviour.
>
> Upgrading to Tomcat 3.2, which is supposed to be released any day now,
> solved my problem(s).
>
> Hope it helps!
>
> - r
>
> > -----Original Message-----
> > From: Juliano Viana [mailto:juliano@estrelar.com]
> > Sent: July 5, 2000 7:04 AM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Tomcat/Apache integration question
> >
> >
> > Hi,
> >
> > I have been playing with tomcat and apache and found a very strange
> > behaviour with ApJServMount. I didn't find this in FAQ, and didn't
> > find a mail list archive either so excuse me if this is a
> known issue.
> >
> > Let me state the problem. Supose I have three contexts in tomcat,
> > let's say "A" and "B" and "ROOT"."A" is mapped in
> server.xml to /A , B
> > is mapped to /B and ROOT is mapped to /.
> > In apache, i have two virtual domains , "X" and "Y". I want the
> > virtual domain X to access the context A and the domain Y to access
> > context B. So i put the following lines in my httpd.conf:
> >
> > <VirtualHost xxx.yyy.zzz>
> > ServerName X
> > ApJservMount / ajpv12://localhost:8007/A
> > </VirtualHodt>
> > <VirtualHost xxx.yyy.zzz>
> > ServerName Y
> > ApJservMount / ajpv12://localhost:8007/B
> > </VirtualHodt>
> >
> >
> > When i access http://X i see the ROOT's index page. The same happens
> > if i access http://Y. If i access http://X/A i see A's
> index page, if
> > i access http://X/B i see B's index page. Same with http://Y.
> >
> > Now, if i understand the idea right, the expected behaviour
> would be:
> > http://X -> A index page
> > http://Y -> B index page.
> >
> > It seems that the jserv module is passing the request "as is" to the
> > Tomcat engine, wihtout performing any translation...
> >
> > Is this a known bug? Or am i doing something wrong? Can
> someone repeat
> > this results?Any help is appreciated...
> >
> > Regards,
> > Juliano.
> >
> >
> >
> >
> >
> >
> --------------------------------------------------------------
> ------------
> > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commmands, email: tomcat-user-help@jakarta.apache.org
> >
>
>
> --------------------------------------------------------------
> ------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
>
RE: Tomcat/Apache integration question
Posted by "Rob S." <rs...@home.com>.
Hi Juliano,
I never got a response from the list as to whether or not that's a bug, and
I couldn't find anything in any of the documentation or FAQs. What you
describe is what I believe should be the intuitive contextual behaviour.
Upgrading to Tomcat 3.2, which is supposed to be released any day now,
solved my problem(s).
Hope it helps!
- r
> -----Original Message-----
> From: Juliano Viana [mailto:juliano@estrelar.com]
> Sent: July 5, 2000 7:04 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Tomcat/Apache integration question
>
>
> Hi,
>
> I have been playing with tomcat and apache and found a very strange
> behaviour with ApJServMount. I didn't find this in FAQ, and didn't
> find a mail list archive either so excuse me if this is a known issue.
>
> Let me state the problem. Supose I have three contexts in tomcat,
> let's say "A" and "B" and "ROOT"."A" is mapped in server.xml to /A , B
> is mapped to /B and ROOT is mapped to /.
> In apache, i have two virtual domains , "X" and "Y". I want the
> virtual domain X to access the context A and the domain Y to access
> context B. So i put the following lines in my httpd.conf:
>
> <VirtualHost xxx.yyy.zzz>
> ServerName X
> ApJservMount / ajpv12://localhost:8007/A
> </VirtualHodt>
> <VirtualHost xxx.yyy.zzz>
> ServerName Y
> ApJservMount / ajpv12://localhost:8007/B
> </VirtualHodt>
>
>
> When i access http://X i see the ROOT's index page. The same happens
> if i access http://Y. If i access http://X/A i see A's index page, if
> i access http://X/B i see B's index page. Same with http://Y.
>
> Now, if i understand the idea right, the expected behaviour would be:
> http://X -> A index page
> http://Y -> B index page.
>
> It seems that the jserv module is passing the request "as is" to the
> Tomcat engine, wihtout performing any translation...
>
> Is this a known bug? Or am i doing something wrong? Can someone repeat
> this results?Any help is appreciated...
>
> Regards,
> Juliano.
>
>
>
>
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
>