From nobody@hyperreal.com Fri Apr 25 05:32:14 1997 Received: (from nobody@localhost) by hyperreal.com (8.8.5/8.8.4) id FAA19400; Fri, 25 Apr 1997 05:32:14 -0700 (PDT) Message-Id: <199704251232.FAA19400@hyperreal.com> Date: Fri, 25 Apr 1997 05:32:14 -0700 (PDT) From: Aleksandar Susnjar Reply-To: sule@bktv.com To: apbugs@hyperreal.com Subject: Wrong SERVER_PORT reported to CGI scripts when server listens to multiple ports X-Send-Pr-Version: 3.2 >Number: 485 >Category: mod_cgi >Synopsis: Wrong SERVER_PORT reported to CGI scripts when server listens to multiple ports >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: closed >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Fri Apr 25 05:40:00 1997 >Last-Modified: Fri Apr 25 13:20:15 PDT 1997 >Originator: sule@bktv.com >Organization: >Release: 1.1.1 >Environment: OS: Solaris 2.5 Compiler: GNU v2.6 >Description: We need our server to listen to multiple ports (eg. 80-85). Some of our CGI scripts need to know which port was used to invoke them, and the server reports the first one (80) no matter which one was used. >How-To-Repeat: You can see this even with your (included) script: http://www.bktv.com:80/cgi-bin/test-cgi ... reports SERVER_PORT=80 (correct) http://www.bktv.com:81/cgi-bin/test-cgi ... reports SERVER_PORT=80 (incorrect) http://www.bktv.com:82/cgi-bin/test-cgi ... reports SERVER_PORT=80 (incorrect) http://www.bktv.com:83/cgi-bin/test-cgi ... reports SERVER_PORT=80 (incorrect) http://www.bktv.com:84/cgi-bin/test-cgi ... reports SERVER_PORT=80 (incorrect) http://www.bktv.com:85/cgi-bin/test-cgi ... reports SERVER_PORT=80 (incorrect) >Fix: Make whatever module responsible for this report the correct SERVER_PORT used. %0 >Audit-Trail: State-Changed-From-To: open-closed State-Changed-By: dgaudet State-Changed-When: Fri Apr 25 13:20:15 PDT 1997 State-Changed-Why: This is covered by PR#459. To which I responded: This is the expected behaviour actually. Each server has exactly one ServerName and one Port. The Listen directive tells apache which sockets to listen on, but doesn't tell it what the main server's (or any other server's) Port setting is. Consider the case of multiple Listens, each intended for a different virtual host. You'll have to set Port in the main server config. If you have a need to serve the same config on multiple ports and have SERVER_PORT set for each port you will have to use multiple VirtualHosts. Thanks for using Apache. Dean >Unformatted: