Home > Article > CMS Tutorial > Detailed explanation of how to prevent the dedecms website from being attacked by DDos
This article mainly introduces relevant information on how to prevent DDos attacks on the dedecms website. The editor thinks it is quite good, so I will share it with you now and give it as a reference.
Step one: Enter the background, system-》Add new variable Variable name: cfg_anquan_cc
Variable type: Boolean (Y /N) (Recommended learning: dedecms tutorial)
Parameter description: Whether to enable anti-CC attacks:
Variable value: Y
Step 2: Edit, /member/config.php and add code under require_once(DEDEINC.'/dedetemplate.class.php');
if($cfg_anquan_cc == 'Y'){<br/>//php防CC攻击 在3秒内连续刷新页面5次以上将指向本机 //www.jb51.net/404.htm<br/> <br/>$P_S_T = $t_array[0] + $t_array[1];<br/>$timest amp = time();<br/>session_start();<br/>$ll_nowtime = $timestamp ;<br/>if (session_is_registered('ll_lasttime')){<br/>$ll_lasttime = $_SESSION['ll_lasttime'];<br/>$ll_times = $_SESSION['ll_times'] + 1;<br/>$_SESSION['ll_times'] = $ll_times;<br/>}else{<br/>$ll_lasttime = $ll_nowtime;<br/>$ll_times = 1;<br/>$_SESSION['ll_times'] = $ll_times;<br/>$_SESSION['ll_lasttime'] = $ll_lasttime;<br/>}<br/>if (($ll_nowtime - $ll_lasttime)<3){<br/>if ($ll_times>=5){<br/>header(sprintf("Location: %s",'//www.jb51.net/404.htm'));<br/>exit;<br/>}<br/>}else{<br/>$ll_times = 0;<br/>$_SESSION['ll_lasttime'] = $ll_nowtime;<br/>$_SESSION['ll_times'] = $ll_times;<br/>}<br/>}<br/>
The above is the detailed content of Detailed explanation of how to prevent the dedecms website from being attacked by DDos. For more information, please follow other related articles on the PHP Chinese website!