httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Schell <>
Subject [users@httpd] Incorrect $_SERVER['SERVER_PORT'] Returned
Date Fri, 16 Oct 2009 17:05:47 GMT
Hello.  I have configured my RHEL5 Apache system with SSL.  I verified that
SSL was installed correctly and accessing the site via SSL works as expected
with the one exception described below.

The problem I am having is my PHP code is pulling the
$_SERVER['SERVER_PORT'] variable and this is coming back as 80 rather than
443.  To narrow this problem down, I've closed port 80 by commenting out
'LISTEN 80' so my server is ONLY listening on port 443.  I've verified this
via a port scan of my server ... 443 is open, 80 is not.

Here is my <VIRTUALHOST> code within HTTPD.CONF

NameVirtualHost *:443




<VirtualHost *:443>


DocumentRoot /var/www/html/redcap


ErrorLog logs/<filename>

CustomLog logs/<filename>

I can get 443 to be returned from _SERVER['SERVER_PORT'] if I edit the 3rd
line above to :


But, if I do this, it messes a few other things up internal to the site.

Does anyone have an idea why _SERVER['SERVER_PORT'] is returning 80 rather
than 443?

Any thoughts would be much appreciated.


View raw message