首页 > 其他 > 详细

新装centos设置

时间:2017-03-24 20:58:24      阅读:377      评论:0      收藏:0      [点我收藏+]

1)清空iptables

Centos6系列关闭防火墙方法:        

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

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


Centos7系列关闭防火墙方法:

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

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



2)关闭selinux

查看selinux状态 # getenforce

Selinux文件位置 /etc/selinux/config 

enforcing改成desabled保存即可

技术分享


3)配置好静态IP

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

技术分享


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

# vim /etc/hosts

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

技术分享


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设置

原文:http://qq512430.blog.51cto.com/5955081/1910106

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!