一:环境说明:
ip:192.168.10.1, dhcp分配的ip段为192.168.10.2-192.168.10.30 网关:192.168.10.1
dhcp服务 tftp服务 httpd服务,我安装在同一台
二:安装
(1)安装dhcp,并拷贝dhcpd.conf.sample 模板文件到 /etc/dhcp/dhcpd.conf
# yum install dhcp
# cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf
(2) dhcp具体配置文件如下:
option domain-name "test.com";option domain-name-servers 192.168.20.1;
subnet 192.168.10.0 netmask 255.255.255.0 {
range 192.168.10.2 192.168.10.30;
option routers 192.168.10.1;
next-server 192.168.10.1
filename "pxelinux.0";
}
(3) 安装tftp服务,该服务是由xinetd 启动的。
# yum install tftp-server tftp
(4)用于PXE网络安装的引导程序为pxelinux.0,由软件包syslinux提供。安装好软件包syslinux,然后将文件pxelinux.0也复制到tftp服务的根目录下
# yum install syslinux
# cd /var/lib/tftpboot/
# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
(5)挂载光盘到/mnt,并拷贝文件到tftpboot根目录
# cp /mnt/p_w_picpaths/pxeboot/vmlinuz initrd.img /var/lib/tftpboot/
# cp /mnt/isolinux/splash.jpg vesamenu.c32 boot.msg isolinux.cfg /var/lib/tftpboot/
(6)默认的启动菜单文件为default,应放置在tftp根目录的pxelinux.cfg子目录中
# mkdir /var/lib/tftpboot/pxelinux.cfg -pv
# cp /mnt/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
三:建立httpd目录,把安装光盘挂载到httpd目录
# mkdir /www/vhosts/centos6
httpd2.4的配置文件:<VirtualHost *:80> DocumentRoot "/www/vhosts/" ServerName www.test.com ErrorLog "logs/test_error_log" CustomLog "logs/test_access_log" combined <Directory "/www/vhosts/"> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory></VirtualHost>
四: 启动服务开始安装:
# service httpd start
# service dhcpd start
# service xinetd start