服务器——那些年我踩过的坑

CentOS 7卸载firewalld防火墙命令

systemctl disable firewalld
systemctl stop firewalld
systemctl mask firewalld
systemctl disable firewalld.service

腾讯云

卸载云镜
/usr/local/qcloud/stargate/admin/uninstall.sh
/usr/local/qcloud/YunJing/uninst.sh
/usr/local/qcloud/monitor/barad/admin/uninstall.sh

原版bbr安装

安装脚本:

wget --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh && chmod +x bbr.sh && ./bbr.sh

输入 uname-r 显示最新版内核的就安装成功了

在输入一下命令

sysctl net.ipv4.tcp_available_congestion_control

一般显示为

net.ipv4.tcp_available_congestion_control = bbr cubic reno
或者为:
net.ipv4.tcp_available_congestion_control = reno cubic bbr




甲骨文云

1.报错

[错误] /boot/grub2/grub.cfg 找不到,请检查.

在这里插入图片描述

解决办法

grub2-mkconfig -o /boot/grub2/grub.cfg

2. 卸载内置脚本

systemctl stop oracle-cloud-agent
systemctl disable oracle-cloud-agent
systemctl stop oracle-cloud-agent-updater
systemctl disable oracle-cloud-agent-updater

3. 防火墙

一般甲骨文云默认是开启防火墙的

(1). 查看防火墙状态
systemctl status firewalld.service

停止防火墙:

systemctl stop firewalld.service

(2). 直接卸载

systemctl disable firewalld
systemctl stop firewalld
systemctl mask firewalld
systemctl disable firewalld.service

(3). 端口开放(推荐)

开放1122端口

firewall-cmd --zone=public --add-port=1122/tcp --permanent

关 闭 \color{red}{关闭} 1122端口

firewall-cmd --zone=public --remove-port=1122/tcp --permanent 

立即生效

firewall-cmd --reload

检查端口被哪个进程占用

netstat -lnpt |grep 1122

centos安装并且开启firewalld防火墙

1. 安装

yum install firewalld

ranho
# 开启服务
systemctl start firewalld.service
# 如果开启服务 报错 Failed to start firewalld.service: Unit is masked
# 以下命令取消对firewalld服务的锁定   下次需要锁定该服务时执行: systemctl mask firewalld
systemctl unmask firewalld

# 关闭防火墙
systemctl stop firewalld.service

# 开机自动启动
systemctl enable firewalld.service

Nginx 防御

防止 cc 以及ddos 攻击

# 限制ip每秒请求次数  加在http{}里面
 limit_req_zone $binary_remote_addr zone=allips:5m rate=20r/m;
 limit_conn_zone $binary_remote_addr zone=one:5m;
# 限制ip的连接数 以及速度
limit_conn one 3;
limit_req zone=allips burst=5 nodelay;
limit_rate 200k; 

你可能感兴趣的:(https,centos7,nginx)