关闭Selinux
selinux有点像安全管家,会杀死一些被它认为有安全漏洞的自启动配置。
- 用root全权限用户登录centos 并编辑selinux配置文件
vim /etc/selinux/config
配置成
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
#SELINUX=enforcing
# SELINUXTYPE= can take one of these three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
防火墙放行端口
- 刚安装好的centos拦截了绝大多数端口,因此需要放行我们要用的端口
# 加白名单
firewall-cmd --zone=public --remove-port=8080/tcp --permanent
# 刷新
firewall-cmd --reload
配置固定ip网卡(可选)