• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Always 1 Guest online...

faeronsayn

Well-known member
#1
Okay I usually have over 100 guests online and for some reason after using easyapache in WHM I only have one guest online.

Its been like that for about an hour now, not sure whats happening.

I looked around and I found out that everyone's IP is the same! and its the server's IP as well.

so I have around 35 members online right now that have the same exact IP, and obviously 1 guest with the same IP ( the server's ip) ... although I usually have over 100 guests online...
 

Mike

XenForo developer
Staff member
#3
Please do not bump - especially after 2 hours.

If you have server elements that have changed, then I'd look there. The IP address (of the user) that is being exposed to you is probably incorrect, perhaps only exposing one IP for everyone.
 

faeronsayn

Well-known member
#4
Please do not bump - especially after 2 hours.

If you have server elements that have changed, then I'd look there. The IP address (of the user) that is being exposed to you is probably incorrect, perhaps only exposing one IP for everyone.
Sorry about that, is there any way i could possibly do it by maybe rebuilding caches or running some crons ?

I have WHM on my server, and easy apache, thats the only thing I touched. Not sure if that made the difference though.

I checked the IP of the 1 guest that I have ... and its the IP of my server....


I just remembered I had put the user sessions line thing to cache in my config.php file and then i couldn't login to my adminpanel, so I tool it off. It could be because of that.

How would you flush that?
 

Jake Bunce

XenForo moderator
Staff member
#5
I checked the IP of the 1 guest that I have ... and its the IP of my server....
That's not good. It sounds like your server is behind a proxy that is messing up reporting of the client IP address. You can visit this page in your Admin CP to check the IP reporting:

admin.php?tools/phpinfo

Search the page for "REMOTE_ADDR". It should show your correct external IP address. If the IP is incorrect or it changes between requests then you will have problems.

I just remembered I had put the user sessions line thing to cache in my config.php file and then i couldn't login to my adminpanel, so I tool it off. It could be because of that.

How would you flush that?
You posted a separate thread about that:

http://xenforo.com/community/threads/caching-sessions-v1-1-beta-5-giving-problems.23161/

The session cache is a separate issue. That wouldn't cause the IP problem.
 

Jake Bunce

XenForo moderator
Staff member
#7
I got your PM with the phpinfo link. It's definitely an IP problem. Your host or server person needs to look at this.

Or you can try fixing it in XenForo by adding this line to your library/config.php file:

Code:
// FIX IP ADDRESS FOR PROXY
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_REAL_IP'];
Try it and let me know if it works. I am not able to test it.
 

faeronsayn

Well-known member
#9
I got your PM with the phpinfo link. It's definitely an IP problem. Your host or server person needs to look at this.

Or you can try fixing it in XenForo by adding this line to your library/config.php file:

Code:
// FIX IP ADDRESS FOR PROXY
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_REAL_IP'];
Try it and let me know if it works. I am not able to test it.
so I have around 35 members online right now that have the same exact IP, and obviously 1 guest with the same IP ( the server's ip) ... although I usually have over 100 guests online...
 

Jake Bunce

XenForo moderator
Staff member
#12
Yep. The proxy was messing up the IP, but your phpinfo page showed that HTTP_X_REAL_IP contained the real IP. So the config.php code sets them equal.
 

yavuz

Well-known member
#13
I was told that this problem is caused by a reverse proxy problem in nginx that you'll have to configure nginx to forward the IP address to apache, and apache will need a 3rd party module to work correctly with proxy'd IPs.

I'm having the same problem, how would make it global for all sites not just xenforo to use reverse proxy?
 

shawn

Well-known member
#14
It's not a problem specific to Xenforo. The problem is that nginx sees the visitor IP address, then reverse proxies through to apache to handle the php files. When it does that, all apache sees is the IP address of the nginx server.

You need to add a couple of lines to the nginx conf file to tell it to add the IP headers for Apache. I think X-Forwarded-For and X-Real-IP are the right ones, but you can probably find this in the nginx documentation.

Then you'll need to add mod-rpaf to Apache. I don't know what distro you're running, but it should be available from 'normal' repositories via apt-get or yum, etc.

Then have Apache and Nginx reload their configuration files, and you're good to go.
 

yavuz

Well-known member
#15
It's not a problem specific to Xenforo. The problem is that nginx sees the visitor IP address, then reverse proxies through to apache to handle the php files. When it does that, all apache sees is the IP address of the nginx server.

You need to add a couple of lines to the nginx conf file to tell it to add the IP headers for Apache. I think X-Forwarded-For and X-Real-IP are the right ones, but you can probably find this in the nginx documentation.

Then you'll need to add mod-rpaf to Apache. I don't know what distro you're running, but it should be available from 'normal' repositories via apt-get or yum, etc.

Then have Apache and Nginx reload their configuration files, and you're good to go.
Forgot to post this, there is a WHM module (automated installer) for nginx here which supports reverse proxy. That solved my problem.
 

Will

Active member
#18
I forgot to update yesterday. The issue I had here along with the issue in the other thread was fixed by reinstalling that Nginx module for WHM. The problem was caused when I had recompiled Apache.