Home  >  Article  >  CMS Tutorial  >  Detailed explanation of how to prevent the dedecms website from being attacked by DDos

Detailed explanation of how to prevent the dedecms website from being attacked by DDos

(*-*)浩
(*-*)浩Original
2019-11-08 15:29:591800browse

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.

Detailed explanation of how to prevent the dedecms website from being attacked by DDos

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 == &#39;Y&#39;){<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(&#39;ll_lasttime&#39;)){<br/>$ll_lasttime = $_SESSION[&#39;ll_lasttime&#39;];<br/>$ll_times = $_SESSION[&#39;ll_times&#39;] + 1;<br/>$_SESSION[&#39;ll_times&#39;] = $ll_times;<br/>}else{<br/>$ll_lasttime = $ll_nowtime;<br/>$ll_times = 1;<br/>$_SESSION[&#39;ll_times&#39;] = $ll_times;<br/>$_SESSION[&#39;ll_lasttime&#39;] = $ll_lasttime;<br/>}<br/>if (($ll_nowtime - $ll_lasttime)<3){<br/>if ($ll_times>=5){<br/>header(sprintf("Location: %s",&#39;//www.jb51.net/404.htm&#39;));<br/>exit;<br/>}<br/>}else{<br/>$ll_times = 0;<br/>$_SESSION[&#39;ll_lasttime&#39;] = $ll_nowtime;<br/>$_SESSION[&#39;ll_times&#39;] = $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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn