NEOCROME
Bug :Basic support for cluster servers
Status :Fixed
Severity :Normal
Reporter :orkan 18-02-2008 10:54
Updated by :Olivier C. 26-05-2008 21:37
CategoryGeneral
Version :121
Frequency :Consistently
Fixed in :125
Details :Firstly, I dunno how much Seditio is supposed to be environment independent? (uhh, I hope you get my point ;)
Heres, what the hosting company says:

Your script is calling for the "REMOTE_ADDR" and receives the IP of a server in front of one of our back-end servers. The web facing server is then passing the scripts output without giving the expected REMOTE_ADDR of the visitor. In order for your scripts to recognize that they are on a cluster and log the correct IP of your visitors, you will need to replace and add the code below.

For PHP:
Locate any lines of code that are similar to this snippet of code,
$_SERVER['REMOTE_ADDR'];
And replace it with this snippet of code,
$_SERVER['HTTP_X_CLUSTER_CLIENT_IP'];
Items affected :system/common.php, system/functions.admin.php, admin.lang.php

History and comments :

26-05-2008 21:37   Olivier C.

PM sent to the reporter :
This bug is now fixed.

26-05-2008 21:36   Olivier C.

Added.

$usr['ip'] = ($cfg['clustermode']) ? $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'] : $_SERVER['REMOTE_ADDR'] ;

20-03-2008 22:24   Olivier C.

Huu, not gonna be easy to have it nice and clean :[

20-02-2008 13:52   Trustmaster

Cluster support should be a core feature, IMO.

20-02-2008 03:10   orkan

yes, but without a core hack its hard to change the SED's defaults. The firts possible hook is after $usr['ip'] assignment

18-02-2008 18:27   Trustmaster

Each cluster / load balancer / webserver uses different environment variable to pass the real client REMOTE_ADDR. Some of them don't pass it at all.

There are generally 2 ways to add cluster support:
1) Try all possible combinations for all known cluster solutions.
2) Add a configuration option, so that Seditio administrator has to learn himself from his hosting company / server documentation, which environment variable is used, so that it looks like this in Seditio code:

Code:
$_SERVER[$cfg['real_ip_var']];