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

Always 1 Guest online...

Discussion in 'Troubleshooting and Problems' started by faeronsayn, Nov 13, 2011.

  1. faeronsayn

    faeronsayn Well-Known Member

    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...
     
  2. faeronsayn

    faeronsayn Well-Known Member

  3. Mike

    Mike XenForo Developer Staff Member

    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.
     
  4. faeronsayn

    faeronsayn Well-Known Member

    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?
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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.

    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.
     
  6. faeronsayn

    faeronsayn Well-Known Member

    REMOTE_address is my server's IP. and it hasn't changed, while I was observing it.
     
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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.
     
    mrGTB and faeronsayn like this.
  8. faeronsayn

    faeronsayn Well-Known Member

    so I just change the "HTTP_X_REAL_IP" to .... my IP right ?
     
  9. faeronsayn

    faeronsayn Well-Known Member

    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...
     
  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Nope. Add that code exactly as it is shown. Change nothing.
     
    faeronsayn likes this.
  11. faeronsayn

    faeronsayn Well-Known Member

    Oh my god! Thank you so much :D ..

    It worked, so it was being proxied or changing ? my remote address?
     
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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.
     
  13. yavuz

    yavuz Well-Known Member

    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?
     
  14. shawn

    shawn Well-Known Member

    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 likes this.
  15. yavuz

    yavuz Well-Known Member

    Forgot to post this, there is a WHM module (automated installer) for nginx here which supports reverse proxy. That solved my problem.
     
  16. Will

    Will Active Member

    I use this same module but I am having the issue of my users having the server's ip address. Any ideas?
     
  17. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  18. Will

    Will Active Member

    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.
     

Share This Page