Bug 65095

Summary: please clarify "default port" in UseCanonicalPhysicalPort documentation
Product: Apache httpd-2 Reporter: Christoph Anton Mitterer <calestyo>
Component: DocumentationAssignee: HTTP Server Documentation List <docs>
Status: NEW ---    
Severity: minor    
Priority: P2    
Version: 2.5-HEAD   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Christoph Anton Mitterer 2021-01-21 05:46:33 UTC
Hey.

I was testing the UseCanonicalPhysicalPort option and it seems to me the term "default port" (i.e. that last in the list) is not really defined.

I did some intensive testing of all combinations of UseCanonicalPhysicalPort On/Off, ServerName unset, set without port, set with different ports (80, 8080) and ports the server not even listens on (8888).... and with all kinds of wget accesses that provoked redirects, with/without artificial Host: header... with connection 80/8080, with/without "fake" Host: Header that prevented wget from automatically setting the port used in the connection.

All worked as described, I've just couldn't find any definitive definition of the "Default Port"...i.e. when all other means fail.


Is it simply 80 for everything http and 443 for everything http?


Thanks,
Chris.
Comment 1 Christoph Anton Mitterer 2021-01-21 05:49:57 UTC
Oh and perhaps please clarify the following in addition:

Is there any risk or other drawback in using the non-default UseCanonicalPhysicalPort On


I just wondered that the default is Off, cause to me it seemed like the more "natural" behaviour if Apache would use the physical port (actually even over the "Port provided in Servername" respectively "Parsed port from Host: header")... cause this is the port where it's already clear that the client "successfully" ended up at the vhost that also sends the redirect (which likely goes into the vhost again - when we speak of things like error documents or mod_dir /-addition).
Comment 2 Christoph Anton Mitterer 2021-01-21 06:04:50 UTC
And one more:

It seems at least in the UseCanonicalName On (but probably also for off) AND UseCanonicalPhysicalPort On case:


The two lines "Port provided in Servername" in the order list of the doc really mean "the LITERALLY provided port number, if any".

That is if one says:
a) ServerName example.org
=> the rule *won't* kick in, and e.g. the physical port kicks in

but:
b) ServerName example.org:80 (i.e. the :80 literally written in the config, and not just the silent "default"
=> the rule *does* kick in, and e.g. the physical port is ignored