Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
litespeed_wiki:config:mitigating-ddos-attacks [2019/01/10 15:45]
Jackson Zhang
litespeed_wiki:config:mitigating-ddos-attacks [2019/02/27 17:12]
Jackson Zhang [Troubleshooting]
Line 53: Line 53:
 ===== Virtual Host-Level Bandwidth Throttling ===== ===== Virtual Host-Level Bandwidth Throttling =====
  
-LiteSpeed Web Server version 5.0 introduces virtual host-level bandwidth throttling. This can be thought of as an extension of LSWS's **Per Client Throttling settings** explained as above, which allow you to control the amount of stress a single IP can put on your server. Virtual host-level bandwidth throttling allows you to customize bandwidth throttling, in Apache configs, for particular virtual hosts. Please check [[litespeed_wiki:​config:​vhost-level_bw_throttling|here]] for details.+LiteSpeed Web Server version 5.0 introduces virtual host-level bandwidth throttling. This can be thought of as an extension of LSWS's **Per Client Throttling settings** explained as above, which allow you to control the amount of stress a single IP can put on your server. Virtual host-level bandwidth throttling allows you to customize bandwidth throttling, in Apache configs, for particular virtual hosts through ''​MaxConnPerClient <​limit_for_connections>'',''​LargeFileLimit [Type] [Minimum Size in kilobytes] [Speed in bytes/​s]'',​ ''​BandWidth [Origin] [Speed in bytes/​s]''​ and ''​MinBandWidth all -1''​. 
 +. Please check [[litespeed_wiki:​config:​vhost-level_bw_throttling|here]] for details.
  
 ===== Use Max Request/​Response Settings ===== ===== Use Max Request/​Response Settings =====
Line 120: Line 121:
 ===== Troubleshooting ===== ===== Troubleshooting =====
  
 +==== Check concurrent connections ====
 +To check how many concurrent TCP connections,​ you can run:
 +  netstat -an | grep 80 | grep ESTA | wc 
 +
 +If you want to check concurrent connections sorted by IP, you can run the following:
 +  netstat -ntu | grep ESTABLISHED | awk '​{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr
 +  ​
 +Please keep in mind that ''​netstat -ntu''​ will list TCP in TIME_WAIT state, which will inflate the number. For correct concurrent TCP connections counting method, you should only count TCPs in ''​ESTABLISHED''​ state. Hence ''​grep ESTA''​ or ''​grep ESTABLISHED''​ will be required. ​
 ==== Check the Banned IP and Reason ==== ==== Check the Banned IP and Reason ====
 If an IP has been banned, but you don't know why, you can check it with SSH. Here is an example of a connection that was banned because it reached the hard limit. If an IP has been banned, but you don't know why, you can check it with SSH. Here is an example of a connection that was banned because it reached the hard limit.
Line 168: Line 177:
  
 === Set Trusted IP on Virtual Host Level ===  === Set Trusted IP on Virtual Host Level === 
-Since LSWS 5.4RC1, LSWS added virtual host trusted IP support, where you use "Trusted 1.2.3.4, 5.6.7.8" ​in Virtual Host document root .htaccess to unblock blocked IP and make that IP trusted for that vhost.+Since LSWS 5.4RC1, LSWS added virtual host trusted IP support, where you use ''​Trusted 1.2.3.4, 5.6.7.8'' ​in Virtual Host document root .htaccess to unblock blocked IP and make that IP trusted for that vhost.
  
 ==== Drop or Deny ==== ==== Drop or Deny ====
 What if ModSecurity does a drop (TCP FIN) rather than deny for a trusted IP? The trusted list only has an effect on the "​drop"​ action, but not on the "​deny"​ action. A trusted IP won't be added to blacklist, but trust status has no effect on other actions. What if ModSecurity does a drop (TCP FIN) rather than deny for a trusted IP? The trusted list only has an effect on the "​drop"​ action, but not on the "​deny"​ action. A trusted IP won't be added to blacklist, but trust status has no effect on other actions.
  • Admin
  • Last modified: 2020/01/07 17:21
  • by Lisa Clarke