SERVER_PORT always reported at 80 (apache 2.2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I'm running apache 2.2 on ubuntu 7.04 and I'm seeing come strange behaviour 
with the SERVER_PORT environment variable.

My server does not listen on port 80. My ports.conf contains :
Listen *:4242

and an nmap of my host shows only port 4242 listening. However, when I make a 
request to a cgi application, the SERVER_PORT env variable is set to 80. I've 
seen a few people with the same problem, but they were running 1.3 so the 
solution of having a Port directive does not work for me.

Here's the output of a session :

mikeh@chewbacca:/etc/apache2$ nmap localhost

Starting Nmap 4.20 ( http://insecure.org ) at 2007-09-04 16:10 BST
Interesting ports on localhost (127.0.0.1):
PORT     STATE SERVICE
4242/tcp   open  http

mikeh@chewbacca:/etc/apache2$ telnet localhost 4242
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /cgi-bin/test.php HTTP/1.0

Content-type: text/html

SERVER_PORT is 80


content of test.php :

<?php echo $_ENV['SERVER_PORT']; ?>

I've tried this with perl and python to make sure it's not a php problem.

What am I missing?

Cheers,

Mike

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux