autoDevops,CI,CD
您所在的组无权查看该日志
Linux查看连接数与连接IP的脚本在centos6.7 上测试下面的脚本,取的数据正常。使用其它的方法会有一些问题netstat -ntu | grep ':' | awk '{print $5}' | sed 's/::ffff://' | cut -d: -f1 | sort | uniq -c | sort -nrnetstat -ntu | awk '{print $5}' | egrep -o "[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}" | sort | uniq -c | sort -nr以下方法会有些问题:netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nnetstat -anlp|grep 80|grep tcp|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -nr|head -n20 | netstat -ant |awk '/:80/{split($5,ip,":");++A[ip[1]]}END{for(i in A) print A[i],i}' |sort -rn|head -n20
介绍一个强大的分析网络的shell脚本,此脚本是从EZHTTP拆分出来的,觉得有必要单独介绍下。脚本运行效果截图:此脚本包含的功能有:1、实时监控任意网卡的流量2、统计10秒内平均流量3、统计每个端口在10秒内的平均流量,基于客户端和服务端端口统计。可以看出哪些端口占流量比较大,对于web服务器,一般是80端口。其它端口受到攻击时,也有可能其它端口流量比较大。所以此功能可以帮助我们端口流量是否正常。4、统计在10s内占用带宽最大的前10个ip。此项功能可以帮助我们来查出是否有恶意占用带宽的ip。5、统计连接状态。此项功能可以让我们看出哪些连接状态比较大。如果SYN-RECV状态比较多的话,有可以受到半连接攻击。如果ESTABLISED非常大,但通过日志发现没有那么多请求,或者通过tcpdump发现大量ip只建立连接不请求数据的话,可能是受到了全连接攻击,这时候如果你使用的是nginx服务器,可以在配置文件增加listen 80 deferred来防止。6、统计各端口连接状态。当可能受到攻击时,此项功能可以帮助我们发现是哪个端口受到攻击。7、统计端口为80且状态为ESTAB连接数最多的前10个IP。此项功能可以帮助我们来找出创建连接过多的Ip,进而屏蔽。8、统计端口为80且状态为SYN-REC...
 
0

CentOS7一键VPN脚本

发表者:admin分类:Devops2016-01-12 09:50:23 阅读[2781]
安装PPTP脚本------------------------------------------------------------------ #!/bin/bash yum -y update wget -c http://dl.fedoraproject.org/pub/epel/7/x86_64/p/pptpd-1.4.0-2.el7.x86_64.rpmyum -y install pptpd-1.4.0-2.el7.x86_64.rpm cp -rf /etc/pptpd.conf /etc/pptpd.conf.bakcat >> /etc/pptpd.conf << EOFlocalip 192.168.144.1remoteip 192.168.144.2-254EOF cp -rf /etc/ppp/options.pptpd /etc/ppp/options.pptpd.bakcat >> /etc/ppp/options.pptpd <<EOFms-dns 8.8.8.8ms-dns 8.8.4.4EOF yum -y install ppp cp -rf /etc/ppp/chap-secrets /etc/ppp/chap-secrets.bakcat >> /etc/ppp/chap-secrets << EOFvpn pptpd 123456 *EOF cp -rf /etc/rc.d/rc.local /etc/rc.d/rc.local.bakcat >> /etc/rc.d/rc.local <<EOFiptables -A INPUT -p gre -j ACCEPTiptables -t nat -A POSTROUTING -s 192.168.144.0/24 -j MASQUERADEiptables -A INPUT -p tcp -m multiport --dport 1723 -j ACCEPTecho 1 > /proc/sys/net/ipv4/ip_forwardsystemctl restart pptpdEO...
APACHE中限制IP连接数与IP并发数和流量控制实现方法,如果只限制连接数据我们可以直接使用limit,如果要限制其它的需要使用其它第三方模块了使用mod_limitipconn模块限制IP并发连接数安装:?1234wget http://dominia.org/djao/limit/mod_limitipconn-0.24.tar.bz2tar jxvf mod_limitipconn-0.24.tar.bz2cd mod_limitipconn-0.24/usr/local/apache2/bin/apxs -c -i mod_limitipconn.c编辑httpd.conf?123456789101112ExtendedStatus OnLoadModule limitipconn_module modules/mod_limitipconn.so  <ifModule mod_limitipconn.c><location />                       #对应根目录   MaxConnPerIP 5                 #最大并发数为5   NoIPLimit image/*                #对图片不做限制</location><location /test> &n...
How to Set Up the Minecraft Control Panel Multicraft On CentOS 7This article describes in detail how you can install the Multicraft control panel for Minecraft on your Linux server. In particular we focus on a Multicraft setup on CentOS 7 on one of our DDoS proof VPS servers, which work very well for running a Multicraft server due to their fast local SSD storage and high-frequency DDR3 RAM. Both are very important types of resources when it comes to Minecraft hosting. DDoS filtering is at least as important, because you can be almost certain that your server will get attacked sooner or later (learn all about DDoS attacks). Table of ContentsWhat is the Multicraft Control Panel?How to Install Multicraft on CentOS 7Installing the DependenciesInstalling the Multicraft Control PanelFinishing the Multicraft InstallationAdditional Multicraft Setup StepsHow to Create Your First Minecraft ServerStarting the Minecraft ServerMulticraft PluginsFinal Thoughts What is the Multicraft Cont...
您所在的组无权查看该日志
您所在的组无权查看该日志
 
0

Centos7 安装PHP7

发表者:admin分类:Devops2016-01-05 23:27:47 阅读[2468]
PHP终于要迎接PHP7的时代了,现在的稳定版本是PHP5.6,而PHP官方表示终止PHP5.7及PHP6发布,下一个PHP版本是7。PHP7开发版的源代码以phpng已经在git上公布也有一段时间了,简单介绍一下在CentOS7安装phpng的方法。前期准备查看bison及re2c安装PHP7需要bison及re2c。# rpm -qa | grep bison bison-2.7-4.el7.x86_64 # rpm -qa | grep re2c 安装re2c# cd /tmp # wget http://sourceforge.net/projects/re2c/files/re2c/0.14.3/re2c-0.14.3.tar.gz # tar -xzvf re2c-0.14.3.tar.gz # cd re2c-0.14.3 # ./configure --prefix=/usr/local/bin # make # make install 安装phpng# git clone https://git.php.net/repository/php-src.git # cd php-src # git branch phpng # git checkout phpng # ./buildconf # ./configure --prefix=/opt/php7 # make # make test # make install # cp php.ini-production /opt/php7/lib/php.ini 配置php.ini文件max_execution_time=600 memory_limit=128M error_reporting=0 display_errors=0 log_errors=0 user_ini.filename= realpath_cache_size=2M cgi.check_shebang_line=0 zend_extension=opcache.so opc...
Centos 7 PHP7环境配置 LNMP (centos7+nginx+MySQL5.7.9+PHP7)首先更新系统软件$ yum update安装nginx1.安装nginx源$ yum localinstall http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm2.安装nginx$ yum install nginx3.启动nginx$ service nginx startRedirecting to /bin/systemctl start  nginx.service4.访问http://你的ip/如果成功安装会出来nginx默认的欢迎界面安装MySQL5.7.*1.安装mysql源$ yum localinstall  http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm2.安装mysql$ yum install mysql-community-server确认一下mysql的版本,有时可能会提示mysql5.63.安装mysql的开发包,以后会有用$ yum install mysql-community-devel4.启动mysql$ service mysqld startRedirecting to /bin/systemctl start  mysqld.service5.查看mysql启动状态$ service mysqld status出现pid证明启动成功6.获取mysql默...
    总共68页,当前第18页 | 页数:
  1. 8
  2. 9
  3. 10
  4. 11
  5. 12
  6. 13
  7. 14
  8. 15
  9. 16
  10. 17
  11. 18
  12. 19
  13. 20
  14. 21
  15. 22
  16. 23
  17. 24
  18. 25
  19. 26
  20. 27
  21. 28