一:環境說明:linux
ip:192.168.10.1, dhcp分配的ip段爲192.168.10.2-192.168.10.30 網關:192.168.10.1
centos
dhcp服務 tftp服務 httpd服務,我安裝在同一臺網絡
二:安裝
dom
(1)安裝dhcp,並拷貝dhcpd.conf.sample 模板文件到 /etc/dhcp/dhcpd.confide
# yum install dhcpui
# cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.confspa
(2) dhcp具體配置文件以下:
router
option domain-name "test.com";
option domain-name-servers 192.168.20.1; server
subnet 192.168.10.0 netmask 255.255.255.0 {ip
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