News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Most recent IP address of members shows server IP

Started by Tonyvic, June 17, 2015, 11:38:38 AM

Previous topic - Next topic

Tonyvic

I'm running SMF 2.0.10 and for the last two days every member who has logged in has their correct IP address and our server IP address listed in the 'Most recent IP address' of 'Track User'.
We have not added/deleted or altered anything for some weeks, has anyone got any idea why this should suddenly start happening?

Illori

ask your host if they have changed anything recently?

margarett

Is the ip showing with their IP, your server IP, or both?

If it's using the server IP, chances are that your host is using CloudFlare or similar cache/proxy system.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Tonyvic

Illori, I have submitted a ticket asking them.
Margarett, Both their normal IP address and the server IP address.

Tonyvic

Reply from host, although not sure I believe them:
QuoteWe have not make any changes under your hosting account or on our server end. We do not edit our clients data without his prior permission. May be it is due to theme so we will request you to please check the same with your web developer.

I also have a test site which is an exact copy (file and database backup from May) of the main site and is permanently in 'Maintenance Mode', I am the only one who has logged in for a week and now my profile on there also has the server IP as well as my own.


DSystem

Very easy to find out what's going on.

Create this file ipclient.php and upload in the root of your hosting (public_html)

<?php
echo '<BR><BR>REMOTE_ADDR ' $_SERVER['REMOTE_ADDR'] . '<BR><BR>';
?>


ex.: http://xxxxxx.xxx/ipclient.php

If the result is the server IP the problem this on hosting.


Tonyvic

Quote from: DSystem on June 17, 2015, 07:14:25 PM
Very easy to find out what's going on.

Create this file ipclient.php and upload in the root of your hosting (public_html)

<?php
echo '<BR><BR>REMOTE_ADDR ' $_SERVER['REMOTE_ADDR'] . '<BR><BR>';
?>


ex.: http://xxxxxx.xxx/ipclient.php

If the result is the server IP the problem this on hosting.
Thanks for that DSystem, the result is my ISP IP address so must assume it's not a server problem.

Any other ideas guys, maybe a clue as to where to look.

Kindred

Quote from: margarett on June 17, 2015, 11:49:07 AM
If it's using the server IP, chances are that your host is using CloudFlare or similar cache/proxy system.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

DSystem

Tonyvic

Contact your webhosting support and ask why the REMOTE_ADDR variable showing the server ip.

Tonyvic

Quote from: DSystem on June 18, 2015, 08:07:41 AM
Tonyvic

Contact your webhosting support and ask why the REMOTE_ADDR variable showing the server ip.
DSystem,
When I ran the file you kindly suggested, it only shows my ip address and not the server's.

Tonyvic

Quote from: Kindred on June 18, 2015, 07:46:08 AM
Quote from: margarett on June 17, 2015, 11:49:07 AM
If it's using the server IP, chances are that your host is using CloudFlare or similar cache/proxy system.
Kindred,
I read the following to mean if it was only the server ip address showing.
Quote from: margarett on June 17, 2015, 11:49:07 AM
Is the ip showing with their IP, your server IP, or both?

If it's using the server IP, chances are that your host is using CloudFlare or similar cache/proxy system.
As it is the members ip address from their ISP and the server ip address, I assumed it wouldn't be that. Plus of course the reply from my host stated:
QuoteWe have not make any changes under your hosting account or on our server end. We do not edit our clients data without his prior permission. May be it is due to theme so we will request you to please check the same with your web developer.

This has only been happening for about 3 days now.

Kindred

well, I have known hosts to be unclear over what constitutes a "change"
(there are any number of hosts out there who are actually very clueless)

As for why it would show both...  does it show both as RECENT or is it only HISTORICAL?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Tonyvic

Quote from: Kindred on June 18, 2015, 08:43:33 AM
(there are any number of hosts out there who are actually very clueless)

As for why it would show both...  does it show both as RECENT or is it only HISTORICAL?
Most support staff at my host can't even understand English, the servers are in UK but I suspect support is in another country! ::)

Both as recent in Profile/Track User/Most recent IP address.
Also both IP addresses appear in new registrations whilst they wait for 'approval', so even before they login.


margarett

#13
SMF, on its own, wouldn't magically start to record different IPs, methinks...

Anyway, user IPs are obtained from
$_SERVER['REMOTE_ADDR']
or
$_SERVER['HTTP_CLIENT_IP']
or
$_SERVER['HTTP_X_FORWARDED_FOR']

So try this code
<?php
echo '<BR><BR>REMOTE_ADDR ' $_SERVER['REMOTE_ADDR'] . '<BR><BR>';
echo 
'<BR><BR>HTTP_CLIENT_IP ' $_SERVER['HTTP_CLIENT_IP'] . '<BR><BR>';
echo 
'<BR><BR>HTTP_X_FORWARDED_FOR ' $_SERVER['HTTP_X_FORWARDED_FOR'] . '<BR><BR>';
?>


Anyway it has to be something in the server configuration which has changed.
Does it happen to all users or just some?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Tonyvic

margarett,
Attached is screenshot of the result with your code.

The server ip address has been added to every members profile who has logged in over the last 3 days. When I check users profiles who haven't logged in for more than 3 days, it is only their own ISP ip address showing.

margarett

I changed the code a bit. Can you please repeat? (it's just the text, which I copy/pasted and forgot to change :P )

Then you should send the new image to your host. If you have the X_FORWARDER_FOR, there is a proxy in the way...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Tonyvic

Many thanks for that, will send result to them and let you know their response.

Tonyvic

Their answer is:
QuoteYour domain "********-******.net" is pointing to *.**.47.72. It seems your forum having some code which is showing the server IP for you domain. Please let us know the exact URL or steps to replicate the error so we check and update you accordingly.
???

Will have to wait for the next response. ::)


Tonyvic

Quote from: margarett on June 18, 2015, 04:14:05 PM
SMF, on its own, wouldn't magically start to record different IPs, methinks...

Anyway it has to be something in the server configuration which has changed.

Spot on Margarett, they finally come clean:
QuoteWe have recently install nginx and varnix behind the regular web service on server to boost the website performance. It seem you are facing issue due this new settings. If possible then please ask your developer to update related code Or if you wish we will migrate your domains to other server not having such custom configuration.

Also from about the same time myself and a number of members have noticed a change in Browser habit. After reading new posts the 'new' icon remains, the only way to clear it is an F5 refresh or logout and back in. Would that also be caused by the server change?

Illori

assuming they mean varnish, yes that can be causing the issue as it is a cache method/app.

https://en.wikipedia.org/wiki/Varnish_(software)

Tonyvic

Many thanks margarett and Illori I take it there is no updated code or fix for this issue?

margarett

The code is correct... There is a proxy in the way so it stores its IP.
We can change the code slightly so that it doesn't store the second IP...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Tonyvic

That would be great, but I'm also concerned about the browser problem
QuoteAfter reading new posts the 'new' icon remains, the only way to clear it is an F5 refresh or logout and back in.
It was also reported:
QuoteI was logged in (using IE) earlier this morning and the problem was still there (read posts still showing as unread); I logged out and have come back in again after just over an hour. I noticed initially the same thing but then, after reading the odd post, I noticed the clock time (in the top right corner by my avatar) was still showing the time that I was logged in earlier. I refreshed the screen and the clock time corrected itself and the read posts then disappeared.

If that type of thing is also a result of nginx and varnish being added to the server, maybe I should simply transfer my domain to another server.

margarett

Yes.

That kind of cache serves you "old" page views until the cache expires. It's really a bad idea to have that for dynamic content like a PHP script...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Tonyvic

Thanks for that margarett, that  helps me to understand it more. All I need to do now is decide whether I should change servers. :-\

Illori

maybe time to look into changing hosts... your host should have told you about the changes before they were made, this way you could have changed servers before if you had wanted.

Tonyvic

Quote from: Illori on June 22, 2015, 06:04:29 AM
maybe time to look into changing hosts... your host should have told you about the changes before they were made, this way you could have changed servers before if you had wanted.
Illori, You are probably correct, especially as the first response when I asked if they had changed/added anything on the server was:
QuoteWe have not make any changes under your hosting account or on our server end. We do not edit our clients data without his prior permission. May be it is due to theme so we will request you to please check the same with your web developer.
But then the same thing could happen with a different host. I am about to 'do battle' with them regarding this, who knows I might be offered Fully Managed VPS Hosting for the same price as my shared package for my inconvenience. :) 

margarett

I wouldn't count on that :P

Do note that it IS possible to use cache without these issues. It's just necessary to configure it properly. Varnish and CloudFlare are very widespread (although they are not the same thing) and used in many many sites. It seems to me that they are caching database content and that cannot happen in a forum...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Tonyvic

QuoteI wouldn't count on that :P
Well, I can dream. lol

QuoteDo note that it IS possible to use cache without these issues. It's just necessary to configure it properly.
Possible maybe, but I doubt my host could. :'(

sumocomputers

Looks like I have the same problem with my host confirmed by using the ipclient.php script.

And the host (A Small Orange) confirmed that all their shared hosting like my site uses a reverse proxy, but couldn't (or wouldn't) tell me if this had been turned on recently.  We only saw this issue with users logged in within the last 48 hours.

I know caching is bad, but for the moment I am stuck with this until I can find another plan or host.

I read through all the posts in this topic, but didn't see which core php file I would need to modify in order to solve the issue.  Or is it solvable this way?

Thanks,

Chris

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

DSystem

@sumocomputers, Easy to solve.

Change all the REMOTE_ADDR by HTTP_X_REAL_IP found in the script from the forum.

Changed files:
/SSI.php
/Sources/Load.php
/Sources/ManageSearchEngines.php
/Sources/QueryString.php

Kindred

not sure that would fix the issue with the HOST-SIDE proxy...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

sumocomputers

Made the changes, and so far with limited testing, it seems to be showing up correctly now...

Found this old 2012 thread, and looks like it is supposed to be in 2.1, but that could be months away for a production release.
http://www.simplemachines.org/community/index.php?topic=151317.0

Thank You,

Chris

Advertisement: