第一部分,基础环境
一.
修改IP地址
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 #接口名称
#HWADDR=00:0C:29:3B:28:82 #物理地址
TYPE=Ethernet
#UUID=7b1faf53-73b4-4a50-844c-fac2b9997a74 #UUID
ONBOOT=yes #开机启动
NM_CONTROLLED=yes
BOOTPROTO=static #设置为静态地址
IPADDR=192.168.66.176 #IP地址
GATEWAY=192.168.66.6 #网关
NETMASK=255.255.255.0 #子网掩码
DNS1=8.8.8.8 #DNS
DNS2=218.85.152.99 #DNS
ARPCHECK=no #检查ARP
二.修改hostname
vi /etc/hosts
127.0.0.1 localhost lnmp localhost4 localhost4.localdomain4 #localhost更改为lnmp
::1 localhost lnmp localhost6 localhost6.localdomain6 #localhost更改为lnmp
2.vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=lnmp #设置主机名为lnmp
三.更新wget命令
yum -y install wget
四.更改yum源
1. cd /etc/yum.repos.d/
2. mv CentOS-Base.repo CentOS-Base.repo.bak
3. wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
4.mv CentOS6-Base-163.repo CentOS-Base.repo
5.yum clean all