httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Morris <aaronmor...@mindspring.com>
Subject Re: [users@httpd] port redirect (separate, but related issue)
Date Sun, 06 Jul 2003 19:20:43 GMT
I posted a question on the same issue a week or two ago, but received no 
response.

In the Apache documentation for "UseCanonicalName" it says:
"With UseCanonicalName off Apache will form self-referential URLs using 
the hostname and port supplied by the client if any are supplied..."

But from my experience and as is evident from this thread that Apache 
does NOT use port information supplied by the client to form 
self-referential URLs (it uses the port the connection was made on).

Here is an example from one of my environments where the webserver 
listens on a different port number (10000) than what you would connect 
to from the internet (80).  A frontend load-balancer does the port 
translation:
----
C:\>telnet 123.123.123.123 80
GET /home HTTP/1.0
Host: blah.gov:1234

HTTP/1.1 301 Moved Permanently
Date: Sun, 06 Jul 2003 18:50:11 GMT
Server: Apache
Location: http://blah.gov:10000/home/
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>301 Moved Permanently</TITLE>
</HEAD><BODY>
<H1>Moved Permanently</H1>
The document has moved <A HREF="http://blah.gov:10000/home/">here</A>.<P>
</BODY></HTML>
----

I have mitigated this issue by using mod_rewrite, but it does not change 
the fact that either the documentation is incorrect or Apache exhibits 
the incorrect behavior.

What needs to be done at this point?  Either the documentation needs to 
be corrected (or at least more clearly state the behavior) or notify the 
appropriate people about the "bug?" (through a bug report).  More or 
less, I'm trying to figure out if this is an Apache issue or a 
documentation issue.

Anyone want to take a shot at it?  :-)


Joshua Slive wrote:
> Whew, finally a few useful details ;-)
> 
> Anyway, the answer remains the same, but I can now be more specific about
> how to impliment it.  Place the following in httpd.conf (in place of any
> existing Listen/Port directives):
> 
> Listen 85
> Port 80
> ServerName www.blabla.de
> UseCanonicalName On
> 
> The Listen directive sets the actual port that apache will use to answer
> requests.  Port and ServerName tell apache how to identify itself when
> sending redirects.  UseCanonicalName tells apache to ignore the port and
> server name specified by the client in its request.
> 
> Joshua.


-- 
Aaron W Morris <aaronmorris@mindspring.com> (decep)
PGP Key ID:  259978D1



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message