当前主机越来越便宜,给了众多站长独立建站的机会。但受限于技术、财力等因素,大部分个人站长在配上虚拟主机、vps等空间后,没有更多的能力去加强网站的防御能力,只能依靠云服务提供商的基础防御。一旦被ddos攻击、cc攻击后,很多时候个人站长没有有效办法。这里我们先不讨论各云服务商提供的防御服务,因为大部分是需要付费的,我们今天讨论从技术角度,我们是否有可能加强自己的网站主机呢?我们拿vps主机来举例使用ddos deflate抵御少量ddos攻击。(虽然像西部数码等一些大的云服务商在减少vps主机的供应,但对于个人站长来说,还是比较实惠的空间产品,毕竟云服务器还是偏贵,是给企业以及财力足的个人更合适。)
当遭遇ddos攻击时,我们是否能在vps设置中进行处理呢?哪怕是一点点的防御。看到ddos deflate脚本是可以协助vps阻止攻击进程的,如果遇到来自某个ip的持续攻击,可以给该ip自动的设置成ip黑名单。只能说可以给我们的vps一点点防御。
第一步,安装。
wget http://myvps-scripts.googlecode.com/files/deflate.sh
chmod +x deflate.sh
./deflate.sh第二步,配置/usr/local/ddos/ddos.conf文件。
##### paths of the script and other files
progdir=/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 effect
freq=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 mails
email_to=root
##### number of seconds the banned ip should remain in blacklist.
ban_period=600标示说明:
no_of_connections=150#最大连接数,超过会被屏蔽,默认即可
apf_ban #默认是1,建议使用0,标示iptables限制
email_to= 填写邮箱账号,到时候有信息会发送到我们邮箱中
ban_period=600 代表限制该ip 600秒通过这样的操作,我们能稍微减轻攻击,真正能防御这类流量攻击的,还是需要云服务商提供的各类云安全产品,虽然对于个人站长来说,这类价格有点高,但能给网站起到一定的保护。另外一种选择,则是可以购买低配置的云主机来使用,这样可以比较好的提升空间安全性,另外使用体验也会好很多。
阿里云服务器怎么办安装宝塔虚拟主机安装dedecms要注意什么一般网站购买阿里云服务器的价格为用云服务器部署web项目商标审核不过-市场咨询如何在Gmail和Outlook中安排电子邮件一级域名价格和二级域名价格高吗?域名过期了网站还能打开吗?域名过期有什么注意事项