一、准备阶段
1、准备环境Vmware workstation Centos7一台做pxe-server 地址:192.168.138.5 子网掩码:255.255.255.0 网关:192.168.138.2 关闭selinux和防火墙
2、安装方式Kickstart安装。 Kickstart是一种无人值守的安装方式。它的工作原理是在安装过程中记录典型的需要人工干预填写的各种参数,并生成一个名为ks.cfg的文件。安装程序首先会去查找Kickstart生成的文件,如果找到合适的参数,就采用这些参数;安装程序会根据ks.cfg中的设置重启系统,并结束安装。
3、网卡配置网卡选择hostonly模式,取消hostonly模式的dhcp功能。 
二、安装阶段因为后面要用到system-config-kickstart工具生成ks文件,它必须依赖于X Windows,所以我们要提前安装好桌面环境。 yum-y groupinstall ‘X Window System' yum-y groupinstall ‘GNOME Desktop Environment'
1、安装httpd需要http的环境存放系统镜像文件和ks文件,所以先安装http yum install httpd Systemctl start httpd 访问http://192.168.138.5

配置yum mount /dev/cdrom /mnt cd /mnt
2、安装tftp-server
yum-y install tftp-server
修改/etc/xinetd.d/tftp,将disable的值由yes变为no 
service tftp{socket_type = dgramprotocol = udpwait = yesuser = rootserver = /usr/sbin/in.tftpdserver_args = -s /var/lib/tftpbootdisable = noper_source = 11cps = 100 2flags = IPv4} 重启xinetd进程,若没有xinetd则需要yum安装 systemctl restart xinetd.service
新建tftpboot文件夹 mkdir -p /var/lib/tftpboot
3、复制pxe文件安装syslinux,并复制pxelinux.0文件到/var/lib/tftpboot中 cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot
新建/var/www/html/cdrom,并挂载 Mount /dev/cdrom /var/www/html/cdrom
yum源配置 
将光盘上的initrd.img和vmlinuxz复制到/var/lib/tftpboot中
cp /var/www/html/cdrom/images/pxeboot/initrd.img /var/lib/tftpboot cp /var/www/html/cdrom/images/pxeboot/vmlinuz /var/lib/tftpboot cp /var/www/html/cdrom/isolinux/boot.msg /var/lib/tftpboot
在tftpboot中新建一个pxelinux.cfg目录
mkdir pxelinux.cfg
将cdrom目录中的isolinux.cfg复制到pxelinux.cfg目录中,同时更改文件名称为default cp /var/www/html/cdrom/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default 编辑default文件 配置如下 default vesamenu.c32 timeout 6000 display boot.msg #Clear the screen when exiting the menu, instead of leaving the menu displayed. #For vesamenu, this means the graphical background is still displayed without #the menu itself for as long as the screen remains in graphics mode. menu clear menu background splash.png menu title CentOS 7 menu vshift 8 menu rows 18 menu margin 8 #menu hidden menu helpmsgrow 15 menu tabmsgrow 13 #Border Area menu color border * #00000000 #00000000 none #Selected item menu color sel 0 #ffffffff #00000000 none #Title bar menu color title 0 #ff7ba3d0 #00000000 none #Press [Tab] message menu color tabmsg 0 #ff3a6496 #00000000 none #Unselected menu item menu color unsel 0 #84b8ffff #00000000 none #Selected hotkey menu color hotsel 0 #84b8ffff #00000000 non #Unselected hotkey menu color hotkey 0 #ffffffff #00000000 none #Help text menu color help 0 #ffffffff #00000000 none #A scrollbar of some type? Not sure. menu color scrollbar 0 #ffffffff #ff355594 none #Timeout msg menu color timeout 0 #ffffffff #00000000 none menu color timeout_msg 0 #ffffffff #00000000 none #Command prompt text menu color cmdmark 0 #84b8ffff #00000000 none menu color cmdline 0 #ffffffff #00000000 none #Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message. menu tabmsg Press Tab for full configuration options on menu items. menu separator # insert an empty line menu separator # insert an empty line label linux menu label ^Install CentOS 7 kernel vmlinuz #append initrd=initrd.img inst.stage2=hd:LABEL=CentOS/x207/x20x86_64 quiet append initrd=initrd.img repo=http://192.168.138.5/cdrom ks=http://192.168.138.5/ks.cfg label check menu label Test this ^media & install CentOS 7 menu default kernel vmlinuz append initrd=initrd.img inst.stage2=hd:LABEL=CentOS/x207/x20x86_64 rd.live.check quiet menu separator # insert an empty line #utilities submenu menu begin ^Troubleshooting menu title Troubleshooting label vesa menu indent count 5 menu label Install CentOS 7 in ^basic graphics mode text help Try this option out if you're having trouble installing CentOS 7. endtext kernel vmlinuz append initrd=initrd.img inst.stage2=hd:LABEL=CentOS/x207/x20x86_64 xdriver=vesa nomodeset quiet default cdrom prompt 0 label rescue menu indent count 5 menu label ^Rescue a CentOS system text help If the system will not boot, this lets you access files and edit config files to try to get it booting again. endtext kernel vmlinuz append initrd=initrd.img inst.stage2=hd:LABEL=CentOS/x207/x20x86_64 rescue quiet label memtest menu label Run a ^memory test text help If your system is having issues, a problem with your system's memory may be the cause. Use this utility to see if the memory is working correctly. endtext kernel memtest label cdrom kernel vmlinuz append initrd=initrd.img ks=http://192.168.138.5/ks.cfg devfs=nomount menu separator # insert an empty line label local menu label Boot from ^local drive localboot 0xffff menu separator # insert an empty line menu separator # insert an empty line label returntomain menu label Return to ^main menu menu exit menu end
重启httpd服务 cp /var/www/html/cdrom/isolinux/vesamenu.c32 /var/lib/tftpboot/
4、安装dhcp服务yum 下载地址: 使用rpm安装指定版本docker(1.12.6)的详细步骤 Web应用中设置Context Path案例详解
|