Last update at :2024-06-13,Edit by888u
The Internet is rich and colorful, and we can basically find the resources we need. Because of this, many friends have joined the ranks of webmasters. There will also be open and covert fighting among many webmasters. Especially for our personal webmasters, due to limited technical and financial resources, we were attacked after finally using a host or VPS and had no ability to defend ourselves. As a result, our host or VPS provider suspended our account, suspended our IP, etc. Especially in the VPS host we use, because it is consumed according to traffic, after exhausting our traffic and encountering a large number of DDOS attacks, we are helpless, including Snail, who has also seen DDOS attacks before.
When encountering these problems, can we deal with them in the VPS settings? Even a little bit of defense. I saw that the DDOS deflate script can assist the VPS in preventing attack processes. If it encounters a sustained attack from a certain IP, the IP can be automatically set into an IP blacklist. All I can say is that it can give our VPS a little bit of defense.
The first step is to install.
wget http://myvps-scripts.googlecode.com/files/deflate.shchmod +x deflate.sh./deflate.sh
The second step is to configure the /usr/local/ddos/ddos.conf file.
##### Paths of the script and other filesPROGDIR=\\\"/usr/local/ddos\\\"PROG=\\\"/usr/local/ddos/ddos.sh\\\"IGNORE_IP_LIST=\ \\"/usr/local/ddos/ignore.ip.list\\\"CRON=\\\"/etc/cron.d/ddos.cron\\\"APF=\\\"/etc/apf/ apf\\\"IPT=\\\"/sbin/iptables\\\"##### frequency in minutes for running the script##### Caution: Every time this setting is changed, run the script with - -cron##### option so that the new frequency takes effectFREQ=1##### How many connections define a bad IP Indicate that below.NO_OF_CONNECTIONS=150##### APF_BAN=1 (Make sure your APF version is atleast 0.96)##### APF_BAN=0 (Uses iptables for banning ips instead of APF)APF_BAN=0##### KILL=0 (Bad IPs are\\\'nt banned, good for interactive execution of script )##### KILL=1 (Recommended setting)KILL=1##### An email is sent to the following address when an IP is banned.##### Blank would suppress sending of mailsEMAIL_TO=\\\ "root\\\"##### Number of seconds the banned ip should remain in blacklist.BAN_PERIOD=600Mark description:
NO_OF_CONNECTIONS=150#Maximum number of connections, if exceeded, they will be blocked. The default is APF_BAN #The default is 1, it is recommended to use 0, indicating iptables restriction EMAIL_TO=\\”\\” Fill in the email account, and information will be sent when the time comes Go to our mailbox and BAN_PERIOD=600 means restricting the IP for 600 seconds
Recommended site search: free registration of website domain name, website domain name IP address query, overseas server, website registration information query, view IP, local IP query, US host network, Alibaba Cloud free virtual host, overseas server rental price, < /p>
发表评论