You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2014/10/03 05:43:47 UTC

[Bug 57051] New: HTTP_PORT env var does not reflect the true connected port

https://issues.apache.org/bugzilla/show_bug.cgi?id=57051

            Bug ID: 57051
           Summary: HTTP_PORT env var does not reflect the true connected
                    port
           Product: Apache httpd-2
           Version: 2.4.10
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: All
          Assignee: bugs@httpd.apache.org
          Reporter: casper.cg@gmail.com

The HTTP_PORT env var was working correctly in 2.2, but it seems 2.4 has
introduced a bug where HTTP_PORT is always 80, even when the true connected
port is something else, like 8080 example.

This is really problematic, as many settings and script relying on HTTP_PORT
for configuration now fail.

Steps to reproduce (on Linux):

1: Clean install of 2.4.10
2: Add "Listen 8080" to httpd.conf
3: Add "%{local}p" to LogFormat so that you can monitor and verify the real
port
4: Enable cgi-bin and verify that http://host/cgi-bin/printenv works
5: Enable port forwarding "sysctl net.ipv4.ip_forward=1"
6: Add simple forwarding rule for testing purposes: 
   "iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080"
   This will forward any connection on port 80 to port 8080.
7: Navigate to http://host/cgi-bin/printenv
8: Observe bug: HTTP_PORT should be 8080, but it's 80.

If you added "%{local}p" to LogFormat you can verify that port 8080 is being
used, as the port is correctly reported in the log. 

You can also verify the connection to 8080 with "netstat -na | grep 8080" 
for example.

The server status line has the same bug, and port 80 is always displayed there.

Like I said in 2.2 this was working completely without problems. The real
connection port was always reported in HTTP_PORT, and on the status line.

In 2.4 how can I now get the real connection port? There's no other ENV 
vars which display the port number.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57051] HTTP_PORT env var does not reflect the true connected port

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57051

Casper <ca...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |casper.cg@gmail.com

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57051] SERVER_PORT env var does not reflect the true connected port

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57051

--- Comment #4 from Casper <ca...@gmail.com> ---
Eric apparently not. I didn't know about that setting, and I didn't use it
before in 2.2. 

Just added it to my 2.4 installation and it resolved my problem. Sorry for the
noise.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57051] SERVER_PORT env var does not reflect the true connected port

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57051

Casper <ca...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |WORKSFORME

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57051] SERVER_PORT env var does not reflect the true connected port

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57051

--- Comment #2 from Casper <ca...@gmail.com> ---
SERVER_PORT !!, not HTTP_PORT (don't write bug reports at 5 AM).

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57051] SERVER_PORT env var does not reflect the true connected port

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57051

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #3 from Eric Covener <co...@gmail.com> ---
http://httpd.apache.org/docs/current/mod/core.html#usecanonicalphysicalport has
the same default in 2.2 and 2.4 as far as I can tell

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57051] SERVER_PORT env var does not reflect the true connected port

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57051

Casper <ca...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|HTTP_PORT env var does not  |SERVER_PORT env var does
                   |reflect the true connected  |not reflect the true
                   |port                        |connected port

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57051] SERVER_PORT env var does not reflect the true connected port

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57051

--- Comment #1 from Casper <ca...@gmail.com> ---
SERVER_PORT !!, not HTTP_PORT (don't write bug reports at 5 AM).

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org