httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars Oppermann <>
Subject Incorrect behaviour in ap_get_server_port()?
Date Mon, 19 Feb 2001 16:59:17 GMT
Hi everybody,

I am working as a software engineer for Sun Microsystems in Hamburg,
Germany. We are currently developing a web based application framework
that should be integratable with the apache webserver. Most application
layer functionality is implemented via java servlets. (We are currently
using Tomcat for that part)

In this framework, there is an application which distributes http
requests among several webservers. (in my case, those webserver are
Apache 1.3.xx connected via mod_jk/ajp13 to one or more Tomcat servlet

Now, whenever a self-referencing, absolute URL is to be constructed, it
has to point to said application responsible for request distribution,
and not to the particular Apache server that generated the response
containing this URL. To achive this, we set the 'Host:' header in the
request sent from the distributing application to the Apache server
accordingly. This does indeed work for hostnames, but not for
Portnumbers (UseCanonicalName is turned off in Apache).

Looking at the code of both mod_jk and Apache, I found that as far as
the Host header field is concerned, when use_canonical_name is
supplied, the function will return the port-number, the client actualy
connected to, not the one specified in the host header as one would
expect from the documentation of UseCanonicalName.

It might be that I'm simply not getting something here, so please
correct me if I'm wrong. Otherwise I'd like to know if you are intersted
in a patch and to whom it should be sent.

(Mod_jk also does not handle the port correctly, but that is not to the
concern of this group, I think),

Lars Oppermann                                        Sun Microsystems
Software Engineer                                      Staroffice GmbH  
Phone: +49 40 23646 959                                  Sachsenfeld 4
Fax:   +49 40 23646 550                                D-20097 Hamburg 

View raw message