Go Back   vb.org Archive > Community Discussions > Forum and Server Management
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-04-2013, 07:30 AM
uwcfx uwcfx is offline
 
Join Date: Mar 2010
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 15 minute block due to ... what?

Hi,

We currently have vBulletin running in a multi server server and we're having some issues at the moment I'll try to describe.

We got two server, lets call them server1 and server2.
Server1 runs Nginx and ourdomain but also proxies ourdomain.com/forum down to server2 which runs a regular Apache with vBulletin installed.

We've had to do some changes to make vBulletin behave like we want for example change the X-Real-IP header to Remote Host as well as X-Forwarded-For.
This makes us see the actual clients IP address in the access logs on Server2.

But, we're still seeing that if one of our users try to log in to our admin panel and types the wrong password too many times _all_ users gets blocked out and it tells us to wait 15 minutes . Our current workaround is just to truncate the strikes table but that's obviously quite ugly.

So my question is, what does vBulletin use to decide from which IP address a client actually comes from? I tried dumping the $_SERVER variable and the only thing I can see in there that shows Server1 is a GEO_IP variable.

Thoughts?

Best regards,
Lars
Reply With Quote
  #2  
Old 04-04-2013, 11:58 AM
snakes1100 snakes1100 is offline
 
Join Date: Dec 2001
Location: Michigan
Posts: 3,733
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As one particular part of your question was a bit confusing, can you clarify a bit more on what you mean here?

Quote:
We've had to do some changes to make vBulletin behave like we want for example change the X-Real-IP header to Remote Host as well as X-Forwarded-For.
This makes us see the actual clients IP address in the access logs on Server2.
As i run numerous simular setups with nginx doing a lb, i do it a little differently, in most cases, when the servers are on a gigabit switch or close enough for nic to nic.

Server 1:
Nginx Front End - Proxy LBs to both servers
Apache backend (mod_rpaf installed)
All files kept on server 1 for site(s)
NFS

Server 2:
Nginx Front End
Apache backend (mod_rpaf installed)
No Site Files.

mod_rpaf would resolve all IPs to the actual client IP in the access logs of apache.

In two cases of the above setup for the owner that wants Stats for the site, the apache logs files are merged together daily via cat & cron.

As rsync is faster, in the above cases i dont have to worry about any cron issues, file problems, date stamp etc, but i do rsync in a few cases as well using smaller drives, as there is no space requirements.
Reply With Quote
  #3  
Old 04-04-2013, 12:46 PM
uwcfx uwcfx is offline
 
Join Date: Mar 2010
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi, we do have mod_rpaf installed and in the access logs I do see the actual clients IP address, but still if one of our moderators manages to "block" his account, all our accounts gets blocked. So somehow vBulletin is taking our Nginx (Server1) IP address and puts it in the strikes table blocking every moderator and admin. Do you understand what I mean?
Reply With Quote
  #4  
Old 04-04-2013, 03:22 PM
nhawk nhawk is offline
 
Join Date: Jan 2011
Posts: 1,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

vB uses these server variables to establish which IP is used for a member...

This is used first...
Code:
$_SERVER['REMOTE_ADDR']
If any of these are set, then the IP used is changed to the set value...
Code:
$_SERVER['HTTP_X_FORWARDED_FOR']

$_SERVER['HTTP_CLIENT_IP']

$_SERVER['HTTP_FROM']
Then if a proxy list is defined in config.php, the IP can be changed again to the proxy IP.
Reply With Quote
  #5  
Old 04-04-2013, 04:59 PM
uwcfx uwcfx is offline
 
Join Date: Mar 2010
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nhawk View Post
vB uses these server variables to establish which IP is used for a member...

This is used first...
Code:
$_SERVER['REMOTE_ADDR']
If any of these are set, then the IP used is changed to the set value...
Code:
$_SERVER['HTTP_X_FORWARDED_FOR']

$_SERVER['HTTP_CLIENT_IP']

$_SERVER['HTTP_FROM']
Then if a proxy list is defined in config.php, the IP can be changed again to the proxy IP.
Hi, here's what I have set up as test now.
Code:
<?php
var_dump($_SERVER['REMOTE_ADDR']);
var_dump($_SERVER['HTTP_X_FORWARDED_FOR']);
var_dump($_SERVER['HTTP_CLIENT_IP']);
var_dump($_SERVER['HTTP_FROM']);
?>
And here's the output.
Code:
string(13) "1.2.3.4" string(13) "1.2.3.4" NULL NULL
Where 1.2.3.4 is my actual home routers address which I've confirmed multiple times.

Here's the relevant part in config.php, all commented out which I presume is default.
Code:
/* Enter your known [trusted] proxy servers here. You can list multiple trusted IPs separated by a comma.*/
//$config['Misc']['proxyiplist'] = '127.0.0.1, 192.168.1.6';

/* If the real IP is passed in a http header variable other than HTTP_X_FORWARDED_FOR, then you can set the name here; */
//$config['Misc']['proxyipheader'] = 'HTTP_X_FORWARDED_FOR';
... yet still if someone manage to block their account, all accounts gets blocked and the Server1 gets listed in the automated e-mail to our forumadministrator e-mail address, for example:

Code:
Dear USER,

Someone has tried to log into your account on Mayzus Forum with an incorrect password at least 5 times. This person has been prevented from attempting to login to your account for the next 15 minutes.

The person trying to log into your account had the following IP address: 4.3.2.1 (Server1)

All the best
Thank you.
Reply With Quote
  #6  
Old 04-09-2013, 07:30 AM
uwcfx uwcfx is offline
 
Join Date: Mar 2010
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

I'm no fan of bumping threads but I do would really appreciate if someone could have another glance at this.

Forgive me if I'm wrong, but these are the official support forums for paying customers, right?

Thanks
Reply With Quote
  #7  
Old 04-09-2013, 01:39 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looking at the code for vb4, it looks like the ip address and an "alt_ip" are determined. The ipaddress is always from REMOTE_ADDR if there is no proxy configured. The alt_ip is from one of the fields mentioned above. So I think unless you configure a proxy in config.php, it's going to use REMOTE_ADDR for blocking due to strikes. However, from what I've read above, I don't understand what's happening either.

Maybe you can temporarily modify the code in functions_login.php and in verify_strike_status() and exec_strike_user(), put in code to log all info to a file and include the $_SERVER fields as well as the IPADDRESS and ALT_IP, then maybe you can figure out why it's happening.


Quote:
Originally Posted by uwcfx View Post
Forgive me if I'm wrong, but these are the official support forums for paying customers, right?

No, this is the site for modifications, and it's supposed to be a community. It depends on people helping each other out, so unfortunately you aren't guaranteed to get an answer to a question (but we try). You can post at vbulletin.com (and it might be a good idea because not everyone from there participates here), but I think unless you have ticket support and you put in a ticket, you're not guaranteed an answer there either.
Reply With Quote
  #8  
Old 04-09-2013, 03:38 PM
uwcfx uwcfx is offline
 
Join Date: Mar 2010
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
Looking at the code for vb4, it looks like the ip address and an "alt_ip" are determined. The ipaddress is always from REMOTE_ADDR if there is no proxy configured. The alt_ip is from one of the fields mentioned above. So I think unless you configure a proxy in config.php, it's going to use REMOTE_ADDR for blocking due to strikes. However, from what I've read above, I don't understand what's happening either.

Maybe you can temporarily modify the code in functions_login.php and in verify_strike_status() and exec_strike_user(), put in code to log all info to a file and include the $_SERVER fields as well as the IPADDRESS and ALT_IP, then maybe you can figure out why it's happening.





No, this is the site for modifications, and it's supposed to be a community. It depends on people helping each other out, so unfortunately you aren't guaranteed to get an answer to a question (but we try). You can post at vbulletin.com (and it might be a good idea because not everyone from there participates here), but I think unless you have ticket support and you put in a ticket, you're not guaranteed an answer there either.
Thank you very much for your reply, I'll see if I can do some modification and figure out what's happening, and I'm indeed sorry for the confusion about the support forum - I'll make sure to post in the right place next time.

Thanks.
Reply With Quote
  #9  
Old 04-09-2013, 04:24 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by uwcfx View Post
... and I'm indeed sorry for the confusion about the support forum - I'll make sure to post in the right place next time.

You didn't really post in the wrong place - it's OK to ask questions here that aren't about modifications. It's just that this isn't the main support site.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:02 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04362 seconds
  • Memory Usage 2,253KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (8)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete