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: [email protected]
Reporter: [email protected]
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: [email protected]
For additional commands, e-mail: [email protected]