4.基于HTTPD配置yum软件仓库为PXE提供安装源
[root@localhost /]# rpm -q httpd
httpd-2.2.15-29.el6.CentOS.x86_64
#通过光盘提供yum仓库
[root@localhost /]# mount --bind /mnt/cdrom/ /var/www/html/cdrom/
#启动服务
[root@localhost /]# service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
[ OK ]
#通过浏览器测试源是否可以正常访问

5.提供ks.cfg文件
#安装system-config-kickstart
[root@localhost /]# yum install system-config-kickstart
[root@localhost /]# rpm -q system-config-kickstart
system-config-kickstart-2.8.6.5-1.el6.noarch
#通过xstart运行systm-config-kickatart,生成ks.cfg文件


#ks.kfg文件详细内容
[root@localhost /]# cat ~/ks.cfg
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url="http://172.16.21.250/cdrom"
# Root password
rootpw --iscrypted $1$8kLebhx5$XaCCpB3fvBnQutl9iQW3S1
# 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/Chongqing
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all
# Disk partitioning information
part / --fstype="ext4" --ondisk=sda --size=8000
part /boot --fstype="ext4" --ondisk=sda --size=500
part swap --fstype="swap" --size=1000
%packages
@chinese-support
@ftp-server
@internet-browser
@web-server
%end
6.测试可否通过网络远程自动安装系统
#指定ks文件位置并回车运行

#可以看到系统已经在自动分区

#正在安装软件包,可见yum源配置也没有问题

#系统安装完成

更多CentOS相关信息见CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14
本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-08/105383.htm
