新装centos设置

1)清空iptables

Centos6系列关闭防火墙方法

关闭防火墙#/etc/init.d/iptables stop

开机自动关闭防火墙:# chkconfigiptables off


Centos7系列关闭防火墙方法

关闭防火墙:# systemctl stop firewalld.service

开机自动关闭防火墙:# systemctl disable firewalld.service


2关闭selinux

查看selinux状态# getenforce

Selinux文件位置 /etc/selinux/config

enforcing改成desabled保存即可

wKioL1jU0QigKbb8AABHlTidu9A514.png



3)配置好静态IP

# vim /etc/sysconfig/network-scripts/ifcfg-eth0

wKioL1jU06vRchwqAAAggoKdtio650.png


4)配置主机和ip映射关系

# vim /etc/hosts

新增一行:公网ip 主机名域名 主机名

wKiom1jU23_xjZnTAAAZy-sH0J0314.png


5)修改主机名

Centos6系列:# vim /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=主机名

NTPSERVERARGS=iburst


Centos7系列:#vim /etc/hostname

新增一行,主机名


重启系统即可生效


6)配置好yum源

yum存放位置:/etc/yum.repos.d/

备份本地yum源

# cp CentOS-Base.repo ./CentOS-Base.repo.bak


配置阿里yum源替换本地yum

Centos6系列

# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

Centos7系列

# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo


安装扩展源epel:

# yum -y install epel-release


yum缓存清理:# yum clean all

生成yum缓存:# yum makecache

相关文章

Centos下搭建性能监控Spotlight
CentOS 6.3下Strongswan搭建IPSec VPN
在CentOS6.5上安装Skype与QQ
阿里云基于centos6.5主机VPN配置
CentOS 6.3下配置multipah
CentOS安装、配置APR和tomcat-native