centos系统使用的基本环境配置简述
1.配置网络文件
vim /etc/sysconfig/network-scripts/ifcfg-ens33
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.71.11
GATEWAY=192.168.71.2
NETMASK=255.255.255.0
DNS1=114.114.114.114
DNS2=8.8.8.8
systemctl restart network
2.关闭防火墙并设置开机不自启动
systemctl stop firewalld
systemctl disabled firewalld
systemctl status firewalld
3.临时或永久关闭selinux
getenforce
setenforce 0
vim /etc/selinux/config
Enforcing=disabled
reboot
4.修改主机名并配置IP与主机名映射
vim /etc/hostname
server1
reboot
vim /etc/hosts
192.168.71.11 server1
5.设置系统光盘开机自动挂载
echo ”/dev/cdrom /mnt iso9660 defaults 0 0“ >> /etc/fstab
mount -a
df -h
6.配置本地yum源
ls /etc/yum.repos.d/
rm -rf /etc/yum.repos.d/*
vim /etc/yum.repos.d/CentOS7.repo
[CentOS7]
name=CentOS7-Server
baseurl=file:///mnt
enabled=1
gpgcheck=0
yum clean all
yum repolist
7.配置网络yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo
http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum repolist
8.配置企业linux扩展源(epel)
yum install -y epel-release
yum clean all
yum repolist
la /etc/yum.repos.d
CentOS7.repo CentOS-Base.repo epel.repo epel-testing.repo
9.拍摄快照