用iptables来防止web服务器被CC攻击

0 个评论
当apache站点受到严重的cc攻击,我们可以用iptables来防止web服务器被CC攻击,实现自动屏蔽IP的功能。 1.系统要求 (1)LINUX 内核版本:2.6.9-42ELsmp或2.6.9-55ELsmp(其它内核版本需要重新编译内核,比较麻烦,但是也是可以实现的)。 (2)iptables版本:1.3.7 2. 安装 安装iptables1.3.7和系统内核版本对应...
2010-08-02 / Unix日志 / 46 views浏览
阅读全文

LINUX/CentOS防CC攻击脚本

0 个评论
#!/bin/sh cd /var/log/httpd/ cat access_log|awk ‘{print $1}’|sort|uniq -c|sort -n -r|head -n 20 > a cp /dev/null access_log cp /dev/null error_log cp /dev/null limit.sh cp /dev/null c #awk ‘{print $2}’ a|awk -F. ‘{print $1″.”$2″.”$3}’|s...
2010-08-02 / Unix日志 / 65 views浏览
阅读全文

Linux/CentOS 使用 iptables封ip段

0 个评论
封单个IP的命令是: iptables -I INPUT -s 211.1.0.0 -j DROP 封IP段的命令是: iptables -I INPUT -s 211.1.0.0/16 -j DROP iptables -I INPUT -s 211.2.0.0/16 -j DROP iptables -I INPUT -s 211.3.0.0/16 -j DROP 封整个段的命令是: iptables -I INPUT -s 211.0.0.0/8 -j DROP 封几个段的命令是: iptable...
2010-08-02 / Unix日志 / 97 views浏览
阅读全文

Linux下为RPM方式安装的PHP添加GD库支持

0 个评论
最近遇到一台装有Fedora Core 5.0 Linux操作系统的服务器,原来安装的Apache 2.0、PHP 5.1.2不支持GD库,PHP网页中用GD库生成的验证码图片、统计图都无法显示。我试过在此基础上安装php-gd- 5.1.2-5.i386.rpm包后还是不行。于是,想到了先卸载已安装PHP的所有RPM包,再重装PHP的方法。于是动手尝试,问题解决...
2010-08-01 / Unix日志 / 110 views浏览
阅读全文

freebsd 7.0 内核编译sctp_usrreqs Error

0 个评论
/usr/src/sys/net/rtsock.c:897): undefined reference to `sctp_addr_change’ in_proto.o(.data+0xa): undefined reference to `sctp_input’ in_proto.o(.data+0xb0): undefined reference to `sctp_ctlinput’ in_proto.o(.data+0xb4): undefined reference to `sctp_ctloutput’ in_...
2010-08-01 / Unix日志 / 24 views浏览
阅读全文

出现mysql max-connections问题解决

0 个评论
mysql -p show variables; 或者 mysql -uroot -p variables |grep max_connections 显示当前运行的Query:mysql> show processlist; 显示当前状态:mysql> show status; 修改MYSQL最大连接数的3种方法: 1. mysql>set GLOBAL max_connections=1000 2.修改 /usr/bin/mysqld_safe vi /usr/bin/my...
2010-08-01 / Unix日志 / 96 views浏览
阅读全文

CentOS + rar + unrar 安装 rar unrar命令详解

0 个评论
先记下2个最常用的 rar 命令 将 21andy.com 目录打包为 andy.rar # rar andy.rar ./21andy.com/ 解压 andy.rar 到当前目录 # rar x andy.rar CentOS + rar + unrar 安装 # vi /etc/yum.repos.d/dag.repo 放入如下内容 [dag] name=Dag RPM Repository for Red Hat Enterprise Linux baseurl=http://apt....
2010-08-01 / Unix日志 / 40 views浏览
阅读全文

wget断点下载和文档合并

0 个评论
默认情况下,wget是支持断点下载的,假如在下载过程中出现网络故障发生中断,待网络连接恢复后,wget会自动从前面中断点继续下载。 例如在网络条件恶劣的条件下下载10G文档all-20100424.tar.bz: wget http://www.unixidc.com/all-20100424.tar.bz 假如中间间断了两次,则下载完毕后当前目录下会有三个文档,分...
2010-08-01 / Unix日志 / 50 views浏览
阅读全文

Cannot find autoconf. Please check your autoconf installation

0 个评论
If this error occurs when you are trying to install a PHP Pecl extension, the chances are you don’t have autoconf installed on your system: root@unixidc:/usr/src/php-5.2.6# pecl install pdo WARNING: channel “pecl.php.net” has updated its protocols, use “channel-update pecl.php.n...
2010-08-01 / Unix日志 / 44 views浏览
阅读全文

Linux下监控网卡流量的软件iftop

0 个评论
1. download source package  from http://www.ex-parrot.com/~pdw/iftop/ 2.  untar package 3. cd dir(untar dir)run:./configure and there is an error: configure: error: can’t find pcap.h cause libpcap or libpcap-devel not installed, 4. run: rpm -qa | grep libpcap. find that  l...
2010-08-01 / Unix日志 / 52 views浏览
阅读全文