所需:VMware9.0 Centos 6.4 X64系统镜像
a、安装kickstart,生成kc.cfg文件
[root@localhost Packages]# yum localinstall system-config-kickstart-2.8.6.5-1.el6.noarch.rpm
ks.cfg文件如下:#最小化安装CENTOS
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url="http://192.168.1.197/" #本机IP
# Root password
rootpw --iscrypted $1$uxAeY1$rLYlQ0gFDYLgAuLv.EClj1 #设置root密码为123456,用grub-md5-crypt生成
# System authorization information
auth --useshadow --passalgo=sha512
# Use text mode install
text
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level=info
# System timezone
timezone Asia/Shanghai
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype="ext4" --size=500
part swap --fstype="swap" --size=8192
part / --fstype="ext4" --size=102400 #如用虚拟机测试安装,注意分区大小
part /home --fstype="ext4" --grow --size=1
%packages
@chinese-support
@core
%end
reboot
b、安装Apache
[root@localhost ~]# yum install httpd*
[root@localhost ~]# service httpd start
Starting httpd: [ OK ]
[root@localhost ~]# cp -rf /misc/cd/* /var/www/html/ #将CENTOS6.4 x64系统光盘拷贝至/var/www/html目录下
c、安装tftp-server,并启用tftp服务,同时启动Xinetd进程
[root@localhost ~]# yum install tftp-server tftp
[root@localhost ~]# vi /etc/xinetd.d/tftp
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = yes #disable的值由yes变为no
per_source = 11
cps = 100 2
flags = IPv4
}
[root@bogon Server]# service xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
[root@localhost Server]# cp /usr/share/syslinux/pxelinux.0 /tftpboot
[root@localhost cd]# cp /misc/cd/images/pxeboot/initrd.img /tftpboot/
[root@localhost cd]# cp /misc/cd/images/pxeboot/vmlinuz /tftpboot/
[root@localhost cd]# cp /misc/cd/isolinux/*.msg /tftpboot/
[root@localhost cd]# mkdir -p /tftpboot/pxelinux.cfg
[root@localhost cd]# cp /misc/cd/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default
[root@ks pxelinux.cfg]# vi /tftpboot/pxelinux.cfg/default #修改文件第一行内容
default linux ks=http://192.168.1.197/ks.cfg
d、安装配置DHCP
[root@localhost ~]# yum install dhcp
[root@localhost ~]# vi /etc/dhcp.conf #增加如下配置
ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
filename "/pxelinux.0";
subnet 192.168.1.0 netmask 255.255.255.0 {
# --- default gateway
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option nis-domain "example.com";
option domain-name "example.com";
option domain-name-servers 192.168.1.1;
option time-offset -18000;
# Eastern Standard Time
# option ntp-servers 192.168.2.1;
# option netbios-name-servers 192.168.2.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
range dynamic-bootp 192.168.1.100 192.168.1.254;
default-lease-time 21600;
max-lease-time 43200;
# we want the nameserver to appear at a fixed address
#host ns {
# next-server marvin.redhat.com;
# hardware ethernet 12:34:56:78:AB:CD;
# fixed-address 192.168.2.110;
#}
}
[root@localhost ~]# service dhcpd start
Starting dhcpd: [ OK ]
e、用VMware创建一个Centos X64虚拟机测试,测试过程略。