| From | Sent On | Attachments |
|---|---|---|
| Bojan Smojver | Aug 28, 2002 6:26 am | |
| Craig R. McClanahan | Aug 28, 2002 9:14 am | |
| John Trollinger | Aug 28, 2002 9:18 am | |
| Craig R. McClanahan | Aug 28, 2002 9:41 am | |
| cost...@covalent.net | Aug 28, 2002 10:03 am | |
| John Trollinger | Aug 28, 2002 10:21 am | |
| Costin Manolache | Aug 28, 2002 10:35 am | |
| Craig R. McClanahan | Aug 28, 2002 10:54 am | |
| Craig R. McClanahan | Aug 28, 2002 10:59 am | |
| Ignacio J. Ortega | Aug 28, 2002 11:24 am | |
| Ryan Lubke | Aug 28, 2002 11:28 am | |
| Bill Barker | Aug 28, 2002 11:28 am | |
| cost...@covalent.net | Aug 28, 2002 12:52 pm | |
| Costin Manolache | Aug 28, 2002 1:52 pm | |
| Costin Manolache | Aug 28, 2002 1:54 pm | |
| Ignacio J. Ortega | Aug 28, 2002 2:05 pm | |
| Ryan Lubke | Aug 28, 2002 3:52 pm | |
| cost...@covalent.net | Aug 28, 2002 4:11 pm | |
| Bojan Smojver | Aug 28, 2002 4:22 pm | |
| Bojan Smojver | Aug 28, 2002 4:45 pm | |
| cost...@covalent.net | Aug 28, 2002 5:01 pm | |
| Bill Barker | Aug 28, 2002 5:43 pm | |
| cost...@covalent.net | Aug 28, 2002 7:11 pm | |
| Bojan Smojver | Aug 28, 2002 8:22 pm | |
| Bojan Smojver | Aug 28, 2002 11:45 pm | |
| Bill Barker | Aug 29, 2002 12:24 am | |
| Ignacio J. Ortega | Aug 29, 2002 6:48 am | |
| cost...@covalent.net | Aug 29, 2002 7:29 am | |
| Craig R. McClanahan | Aug 29, 2002 8:12 am | |
| Ryan Lubke | Aug 29, 2002 9:01 am | |
| Costin Manolache | Aug 29, 2002 9:56 am | |
| Bojan Smojver | Aug 29, 2002 4:10 pm | |
| Ignacio J. Ortega | Aug 30, 2002 6:50 am | |
| cost...@covalent.net | Aug 30, 2002 7:53 am | |
| Ignacio J. Ortega | Aug 30, 2002 10:14 am | |
| cost...@covalent.net | Aug 30, 2002 10:53 am | |
| Ignacio J. Ortega | Aug 30, 2002 11:26 am | |
| cost...@covalent.net | Aug 30, 2002 11:49 am | |
| Steve Downey | Aug 30, 2002 1:27 pm | |
| Ignacio J. Ortega | Aug 30, 2002 1:46 pm | |
| Bojan Smojver | Aug 30, 2002 5:55 pm |
| Subject: | RE: Spec question: RE BUG 12052 | |
|---|---|---|
| From: | Craig R. McClanahan (crai...@apache.org) | |
| Date: | Aug 28, 2002 10:59:37 am | |
| List: | org.apache.tomcat.dev | |
On Wed, 28 Aug 2002, John Trollinger wrote:
Date: Wed, 28 Aug 2002 13:21:26 -0400 From: John Trollinger <jaka...@trollingers.com> Reply-To: Tomcat Developers List <tomc...@jakarta.apache.org> To: 'Tomcat Developers List' <tomc...@jakarta.apache.org> Subject: RE: Spec question: RE BUG 12052
-----Original Message----- From: cost...@covalent.net [mailto:cost...@covalent.net] Sent: Wednesday, August 28, 2002 1:04 PM To: Tomcat Developers List 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.
Costin
I can agree that mod_jk can be seen as part of the servlet container, but I wonder how you are going to "fake" tomcat into thinking the request came from port 80 when it really came from port 8009 and what other implication / assumptions would occur because of this.
I included at least three different ways to implement this. It's just a matter of including the requierd information in the messages sent to Tomcat, just like the host name is forwarded.
The implications of implementing this correctly include:
* A web application can construct an absolute URL that will always be able to get back to this app (consider what happens if you return a URL with 8009 in it because that is what getServerPort() returned).
* Tomcat can construct correct URLs for redirects (it is required to do relative->absolute conversion) and URL-rewriting for session management.
The implications of not implementing this correctly include:
* Web applications have to include separately configured or hard coded information about the server port number when constructing absolute URLs.
* Bug reports from users (there have been several on this topic).
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-> unsu...@jakarta.apache.org> For
additional commands, e-mail:
<mailto:tomc...@jakarta.apache.org>





