XF 1.5 Members Online - Remove Counts

popowich

Active member
Is there a way to remove the count from the members online?
'
Total: 21 (members: 2, guests: 18)

My xenforo seems to be confused because all my visitors appear as the same source IP now (backend of load balancer).

There are still some robots hitting the site directly at the old IP which is why some visitors are still showing up and not just 1.
 
Yes, in apache I update the LogFormat to pick it up and log both at the start of each line like this:

Code:
LogFormat "%h %{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

What's the way to replace what XenForo thinks is the users IP in config.php? From the above it would be overwriting %h with %{X-Forwarded-For}i

I didn't care yesterday, but now that you mention it, it's needed for part of the spam checking during registration, and probably some other things too.
 
In library/config.php, add:
Code:
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR']; }
 
I added the missing parenthesis, looks like it working, thanks!

Code:
// Fix members online when behind an ELB
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
 
As info, since we are also on load balancers, I checked with our support folk and they sent this:

"I am seeing that the remoteip module was not configured on the webservers. I have added the configuration so IPs should be properly logged on the web01/02/03 servers. I am not sure if XenForo requires any additional configuration but if you are still seeing the issues, it should be okay to add the configuration that they suggested. If you have any questions or concerns, feel free to let me know."

...so you may want to see if remote is enabled/configured for your setup then you likely won't need to add any additional configuration settings to XF, etc.

Ray
 
Top Bottom