Because of the special nature of the admincp file. When a new connection is generated. It will occupy a lot of system resources. Therefore, when multiple IP addresses continuously access the admincp. php file, the server is vulnerable to DDOS attacks.
Solution:
In the beginning of the admincp. php file <? Add the following code to php: if (preg_replace ("/https? : // ([^/] +). */I "," \ 1 ", $ HTTP_SERVER_VARS ['HTTP _ referer'])! = $ HTTP_SERVER_VARS ['HTTP _ host']) {
Exit ('Warning ---- your operation has been disabled. ');
} Extension. Adding the same code to each file header in the same way can greatly improve the anti-ddos capability of the Forum:
Add the index. php header to if (preg_replace ("/https? : // ([^/] +). */I "," \ 1 ", $ HTTP_SERVER_VARS ['HTTP _ referer'])! = $ HTTP_SERVER_VARS ['HTTP _ host']) {
Exit ('click to enter the forum. <A href = "http://www.freediscuz.com '> http://www.freediscuz.com/index.php"> http://www.freediscuz.com </a> ');
} Add the following code to other PHP file headers in the Forum root directory: if (preg_replace ("/https? : // ([^/] +). */I "," \ 1 ", $ HTTP_SERVER_VARS ['HTTP _ referer'])! = $ HTTP_SERVER_VARS ['HTTP _ host']) {
Exit ('Warning ---- your operation has been disabled. <A href = "http://www.freediscuz.com '> http://www.freediscuz.com/index.php"> http://www.freediscuz.com </a> ');
}
After this modification, everyone accessing your forum must click a link on the homepage to access the Forum. If it is a DDOS attack Forum, the information sent by attackers will not be transmitted to the php program of the Forum. This greatly saves system resources and greatly increases the anti-DDOS capability of the Forum. Especially in unix systems, the defense capability is even several times higher. Of course, if you want to completely defend against DDOS attacks, it is best to block IP access, but we usually lease space, the Administrator will not easily block the IP address, so this is the only thing you can do.
Change the address in the code to your forum address.