挂载镜像、开机自动挂载设置
# mkdir /iso
# mount -o loop /dev/sr0 /iso
# mount | tail -1 >> /etc/fstab
# vim /etc/fstab
/dev/sr0 /iso iso9660 ro,relatime 0 0
配置yum
# vim /etc/yum.repos.d/centos6-dvd.repo
[centos6-dvd]
name=centos6-dvd
baseurl=file:///iso
gpgcheck=0
# yum repolist all
安装一些基础软件包
yum install -y vim lftp openssh-clients
关闭防火墙
# service iptables stop
# chkconfig iptables off
# chkconfig ip6tables off
禁用selinux
# vim /etc/selinux/config
设置主机名
# vim /etc/sysconfig/network
centos6 此文件设主机名
设置本地域名解析
# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.60 host60
192.168.0.61 host61
192.168.0.62 host62
192.168.0.63 host63
设置网络IP
# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.0.60
PREFIX=24
GATEWAY=192.168.0.1
DNS1=101.226.4.6(windows cmd ipconfig /all可查)
DNS2=114.114.114.114
DNS3=8.8.8.8
DNS4=4.4.4.4
# service network restart
# ping www.baidu.com
安装JDK
tar -zxf jdk-8u121-linux-x64.tar.gz -C /opt/software/
cd /opt/software/
ln -s jdk1.8.0_121 java
vim /etc/profile
## SET JAVA_HOME
export JAVA_HOME=/opt/software/java
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
source /etc/profile
# java -version
三处清理
rm -rf /root/anaconda-ks.cfg /root/install.log*
rm -rf /etc/ssh/ssh_host_*
rm -rf /etc/udev/rules.d/70-persistent-*
shutdown