nginx限制请求数和连接数来防御cc攻击
主要通过nginx的http_limit_conn和http_limit_req模块来防御cc攻击。 ngx_http_limit_req_module可以限制单个IP每秒请求数 ngx_http_limit_conn_module可以限制单个IP的连接数 通 … 阅读全文
主要通过nginx的http_limit_conn和http_limit_req模块来防御cc攻击。 ngx_http_limit_req_module可以限制单个IP每秒请求数 ngx_http_limit_conn_module可以限制单个IP的连接数 通 … 阅读全文
使用yum源直接安装nginx 1、配置nginx源 centos6:
1 |
rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm |
centos7:
1 |
rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm |
2、安装nginx(默认会安装最新的稳 … 阅读全文
当前系统Centos7.4,关闭selinux,关闭防火墙(或自行设置) 1、配置好yum源,安装依赖
1 |
yum install wget gcc gcc-c++ pcre pcre-devel openssl openssl-devel zlib zlib-devel |
2、创建nginx启动用户 [crayon-67d4478ba1e89054010687/ … 阅读全文
由于部分pip安装包升级原因,安装时可能会报错,需指定版本,本文部分操作步骤可能会报错,建议有能力的进行参考! 简单方便建议使用rpm安装:https://blog.whsir.com/post-2163.html 对于KVM(kernel-based vir … 阅读全文
Docker的镜像和容器有两种方式导出 Docker Save镜像方法,会保存该镜像的所有历史记录 获取IMAGE ID
1 |
docker images |
方法一: 导出镜像,后缀为tar [crayon-67d4478ba22 … 阅读全文
对于KVM(kernel-based virtual machine)大家并不陌生,它是基于内核的虚拟机,在测试或者生产环境中经常用到,由于管理起来不是很方便,我在这里推荐一个kvm web管理工具。 什么是Wok? Wok基于cherrypy的web框架,可 … 阅读全文
执行docker info出现如下警告
1 2 |
WARNING: bridge-nf-call-iptables is disabled WARNING: bridge-nf-call-ip6tables is disabled |
解决办法:
1 |
vi /etc/sysctl.conf |
添加以下内容 [crayon-67d4478ba2612816947568/ … 阅读全文
ss&ssr windows客户端下载地址: https://down.whsir.com/downloads/ss-2.5.8.zip https://down.whsir.com/downloads/ss-3.4.3.zip https://down.wh … 阅读全文
ss全局代理SocksCap64下载 https://down.whsir.com/downloads/sockscap64w_V3.3_setup.zip https://down.whsir.com/downloads/SocksCap64-setup-4 … 阅读全文
脚本修改默认端口,替换iptables防火墙等,内容如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
#!/bin/bash #关闭selinux sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config sed -i 's/#UseDNS yes/UseDNS no/g' /etc/ssh/sshd_config setenforce 0 #安装wget yum -y install wget yum-utils #更换yum源 repo=`ls /etc/yum.repos.d/repo.bak | wc -l` if [ $repo -eq 0 ]; then mkdir /etc/yum.repos.d/repo.bak mv /etc/yum.repos.d/CentOS* /etc/yum.repos.d/repo.bak cd /etc/yum.repos.d/ wget http://blog.whsir.com/uploads/CentOS7-Base-163.repo yum clean all yum makecache else echo "yum OK" fi #更新时间和系统 cd yum -y install vim screen ntp /usr/sbin/ntpdate ntp1.aliyun.com yum -y update #更改端口 sed -i 's/#Port 22/Port 2188/' /etc/ssh/sshd_config #设置防火墙ifconfig systemctl stop firewalld.service systemctl disable firewalld.service yum -y install iptables-services net-tools systemctl enable iptables.service sed -i 's/22/2188/' /etc/sysconfig/iptables systemctl restart iptables.service systemctl restart sshd yum -y install epel-release #关闭postfix systemctl disable postfix #更改ulimit limit=`cat /etc/security/limits.conf | grep 65535 | wc -l` if [ $limit -eq 0 ]; then echo "ulimit -SHn 65535" >> /etc/rc.local cat >> /etc/security/limits.conf << EOF * soft nofile 65535 * hard nofile 65535 EOF else echo "ulimit ok" fi #开机启动优化 for i in acpid gpm lvm2-monitor anacron haldaemon mcstrans oddjobd setroubleshoot atd halt mdmonitor pand single auditd hidd mdmpd pcscd smartd hplip messagebus avahi-daemon ip6tables microcode_ctl snmptrapd avahi-dnsconfd ipmi multipathd psacct bluetooth rawdevices svnserve conman irda netconsole rdisc cpuspeed irqbalance netfs readahead_early tcsd iscsi netplugd readahead_later winbind cups iscsid restorecond wpa_supplicant cups-config-daemon kdump NetworkManager rpcgssd dnsmasq killall nfs rpcidmapd ypbind dund krb524 nfslock rpcsvcgssd yum-updatesd firstboot lm_sensors nscd saslauthd do chkconfig $i off > /dev/null 2>&1 done date |
下载地址:
1 |
wget https://down.whsir.com/downloads/centos7init.sh |
~微信打赏~ 赏