设为首页
收藏本站
开启辅助访问
切换到窄版
登录
立即注册
快捷导航
发布信息
搜索
搜索
首页
优惠促销
云服务器
独立服务器
站群服务器
母鸡服务器
服务器托管
全球云服务器
技术文档
联系
每日签到
本版
文章
帖子
用户
主机测评网
»
论坛
›
技术文档
›
其他教程
›
Centos下Nginx版本如何平滑升级与回滚?
返回列表
发新帖
Centos下Nginx版本如何平滑升级与回滚?
[复制链接]
|
主动推送
114
|
0
|
2024-9-11 18:21:39
|
显示全部楼层
|
阅读模式
操作系统:CentOS 7.x
准备篇
一、防火墙配置
CentOS 7.x默认使用的是firewall作为防火墙,这里改为iptables防火墙。
1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
systemctl mask firewalld
systemctl stop firewalld
yum remove firewalld
2、安装iptables防火墙
yum install iptables-services #安装
vi /etc/sysconfig/iptables #编辑防火墙配置文件
# sample configuration for iptables service
# you can edit this manually or use system-config-firewall
# please do not ask us to add additional ports/services to this default configuration
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
:wq! #保存退出
systemctl restart iptables.service #最后重启防火墙使配置生效
systemctl enable iptables.service #设置防火墙开机启动
/usr/libexec/iptables/iptables.init restart #重启防火墙
二、关闭SELINUX
vi /etc/selinux/config
#SELINUX=enforcing #注释掉
#SELINUXTYPE=targeted #注释掉
SELINUX=disabled #增加
回复
使用道具
举报
返回列表
发新帖
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
立即注册
本版积分规则
发表回复
回帖后跳转到最后一页
浏览过的版块
其他文档
知足常乐77
97
主题
0
回帖
10
积分
新手上路
新手上路, 积分 10, 距离下一级还需 40 积分
新手上路, 积分 10, 距离下一级还需 40 积分
积分
10
加好友
发消息
回复楼主
返回列表
网络技术教程
软件使用教程
Windows教程
Centos教程
Ubuntu教程
Linux其他教程
综合教程
其他教程
其他文档
服务器商家推荐
华夏互联
蓝速云
米图云
全球云
文章
1
苹果电脑MAC系统登录Windows远程桌面
2
Debian拓展硬盘工具。cloud-utils-growpart、xfsprogs
3
安卓Android手机怎么使用V2rayNG?
4
WINDOWS系统电脑怎么使用WINXRAY?
5
notepad++.8.5.7编辑器,代码编辑器
6
DirectX修复工具增强版_V4.3.0.40864版本DLL修复工具C++安装
7
Visual C++运行库合集包完整版VisualCppRedist_AIO_x86_x64
8
ChromeSetup谷歌浏览器一键安装