tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject RE: Spec question: RE BUG 12052
Date Wed, 28 Aug 2002 17:54:51 GMT


On Wed, 28 Aug 2002 costinm@covalent.net wrote:

> Date: Wed, 28 Aug 2002 10:03:34 -0700 (PDT)
> From: costinm@covalent.net
> Reply-To: Tomcat Developers List <tomcat-dev@jakarta.apache.org>
> To: Tomcat Developers List <tomcat-dev@jakarta.apache.org>
> Subject: RE: Spec question: RE BUG 12052
>
> On Wed, 28 Aug 2002, John Trollinger wrote:
>
> > > Consider Apache running on port 80, forwarding to Tomcat on
> > > 8009 (the default setup).  I think it's reasonable for the
> > > application developer to assume that getServerPort() is going
> > > to return 80 and not 8009, because they should conceptually
> > > view the entire "Apache+Tomcat" thing as a single server.
> >
> > I have to disagree with you there.  If a request comes to the servlet
> > engine
> > on port 8009 then getServerPort() should return that.  It is bad to have
> > Tomcat try and guess where its requests are coming from.
>
> And what if Apache+jk is used with unix domain sockets or JNI ?
>
> The 8009 is just an implementation detail of something internal.
> In Apache+jk, the 'container' is Tomcat( java side ) plus at least
> a small piece of jk.
>
> It is an open question if Apache can be considered a part of the
> 'servlet container' in this case and should abide the rules set
> by the servlet spec. My answer is no - mostly because the spec
> sets some mapping rules that just can't match any of the main
> 3 web servers, and at least IIS is not going to change to follow
> the servlet spec. So the only practical aproach is to consider
> the web server is not part of the serlvet container.
>
> But mod_jk is IMO a part of the servlet container.
>

If you run Tomcat behind Apache using JK, the entire combination is the
"container" from the perspective of the servlet specification.  The entire
combination has to meet all the spec rules or it's not compliant.

The fact that the servlet spec defines things differently than web servers
did things is totally irrelevant to spec compliance.

>
> Costin

Craig


>
>
>
> >
> > >
> > > As for implementing this, a couple of possibilities:
> > >
> > > * Include the port number along with the host name (haven't checked
> > >   if this is already happening)
> > >
> > > * Add a protocol variable in the JK protocol so that the web server
> > >   can forward which port number the request was received on.
> > >
> > > * Add a Connector property saying the port number that should be
> > >   used for getServerPort() for all requests processed by this
> > > connector
> > >   (the deprecated HttpConnector code had proxyPort for this purpose).
> > >
> > > If a load balancer or proxy *ahead* of Apache is doing the
> > > port shifting, there's not a lot we can do.  But we should
> > > cover the case for requests that come in to the web server
> > > and get forwarded by us.
> > >
> > > > Bojan
> > >
> > > Craig
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:tomcat-dev-> unsubscribe@jakarta.apache.org>
> > > For
> > > additional commands,
> > > e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message