# 挂载iso镜像 
[root@skype ~]# mount /dev/cdrom /mnt 
mount: block device /dev/sr0 is write-protected, mounting read-only 
  
# 复制光盘全部内容至 http的 documentroot 目录: /var/www/html 
[root@skype ~]# cp -ar /mnt/ /var/www/html
四、配置TFTP
4.1 安装 tftp-server
# 安装 xinetd, tftp-server 
[root@skype ~]# yum -y install xinetd 
[root@skype ~]# yum -y install tftp-server 
  
# 编辑 tftp 配置文件, 将 disable 设置为 no 
[root@skype ~]# vi /etc/xinetd.d/tftp 
service tftp  
{  
        socket_type            = dgram  
        protocol              = udp  
        wait                = yes 
        user                = root  
        server                = /usr/sbin/in.tftpd  
        server_args              = -s /var/lib/tftpboot 
        disable                = no  
        per_source              = 11  
        cps                = 100 2  
        flags                = IPv4  
} 
  
# 启动 tftp服务, 由于tftp由 xinetd 控管,所以需要重启 xinetd服务即可 
[root@skype ~]# service xinetd start 
Starting xinetd:                                          [  OK  ] 
  
# 设置xinetd 开机启动 
[root@skype ~]# chkconfig xinetd on
五、配置支持 PXE 的启动程序
5.1 复制pxelinux.0 文件至/var/lib/tftpboot/ 文件夹中
[root@skype ~]# yum -y install syslinux 
# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
说明:syslinux是一个功能强大的引导加载程序,而且兼容各种介质。更加确切地说:SYSLINUX是一个小型的Linux操作系统,它的目的是简化首次安装Linux的时间,并建立修护或其它特殊用途的启动盘。
5.2 复制iso 镜像中的/image/pxeboot/initrd.img 和vmlinux 至/var/lib/tftpboot/ 文件夹中
# cp /var/www/html/mnt/images/pxeboot/{initrd.img,vmlinuz} /var/lib/tftpboot/
5.3 复制iso 镜像中的/isolinux/*.msg 至/var/lib/tftpboot/ 文件夹中
# cp /var/www/html/mnt/isolinux/*.msg /var/lib/tftpboot/
5.4 在/var/lib/tftpboot/ 中新建一个pxelinux.cfg目录
# mkdir /var/lib/tftpboot/pxelinux.cfg
5.5 将iso 镜像中的/isolinux 目录中的isolinux.cfg复制到pxelinux.cfg目录中,同时更改文件名称为default
# cp /var/www/html/mnt/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
5.6 修改default文件
# vi /var/lib/tftpboot/pxelinux.cfg/default
default ks             #默认启动的是 'label ks' 中标记的启动内核 
prompt 1          #显示 'boot: ' 提示符。为 '0' 时则不提示,将会直接启动 'default' 参数中指定的内容。 
timeout 6      #在用户输入之前的超时时间,单位为 1/10 秒。 
display boot.msg  #显示某个文件的内容,注意文件的路径。默认是在/var/lib/tftpboot/ 目录下。也可以指定位类似 '/install/boot.msg'这样的,路径+文件名。 
F1 boot.msg     #按下 'F1' 这样的键后显示的文件。 
F2 options.msg  
F3 general.msg  
F4 param.msg  
F5 rescue.msg  
label linux      #'label' 指定你在 'boot:' 提示符下输入的关键字,比如boot: linux[ENTER],这个会启动'label linux' 下标记的kernel 和initrd.img 文件。 
  kernel vmlinuz  #kernel 参数指定要启动的内核。 
  append initrd=initrd.img #append 指定追加给内核的参数,能够在grub 里使用的追加给内核的参数,在这里也都可以使用。 
label text  
  kernel vmlinuz  
  append initrd=initrd.img text  
label ks  
  kernel vmlinuz  
  append ks=http://192.168.100.254/ks.cfg initrd=initrd.img    #告诉系统,从哪里获取ks.cfg文件  
label local 
  localboot 1  
label memtest86  
  kernel memtest  
  append -
六、配置DHCP
6.1 安装DHCP服务
# yum -y install dhcp
6.2 复制配置模板文件到DHCP的配置目录中
# cp -f /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample  /etc/dhcp/dhcpd.conf

