Linux configuration PXE Server build method

Source: Internet
Author: User
Tags mkdir centos file transfer protocol

A boot package is then downloaded to native memory using the TFTP (Trivial File Transfer Protocol) or MTFTP (multicast trivial file transfer) protocol. By this boot package completes the terminal (customer?) Basic software settings to boot the terminal operating system preinstalled in the server. PXE can boot a variety of operating systems, such as: Windows95/98/2000/windows2003/windows2008/winxp/win7/win8,linux.

Example

[Root@pxe ~]# yum install syslinux xinetd tftp-server dhcp-y
Dependencies resolved

===============================================
Package Arch Version Repository Size
===============================================
Installing:
Syslinux x86_64 4.04-3.EL6 Base 346 k
Tftp-server x86_64 0.49-7.EL6 Base K
xinetd x86_64 2:2.3.14-39.el6_4 Base 121 K
Installing for dependencies:
Mtools x86_64 4.0.12-1.EL6 Base 194 k
Syslinux-nonlinux Noarch 4.04-3.el6 Base 584 K

Transaction Summary
=============================================================================================================== ======================
Install 5 Package (s)

Total Download size:1.3 M
Installed size:2.8 M
########### #DHCP ############
[Root@pxe ~]# yum Install DHCP
[Root@pxe ~]# CAT/ETC/SYSCONFIG/DHCPD
# Command Line Options
Dhcpdargs=eth0
########### #安装apache ############
[Root@pxe ~]# Yum Install httpd
[Root@pxe ~]# Rpm-qa|grep httpd
Httpd-tools-2.2.15-47.el6.centos.1.x86_64
Httpd-2.2.15-47.el6.centos.1.x86_64
[Root@pxe ~]#/etc/init.d/httpd start
########### #镜像拷贝到apache根目录 ############
[Root@pxe ~]# Mkdir/mnt/cdrom
[Root@pxe ~]# mount/dev/cdrom/mnt/cdrom/
Mount:block Device/dev/sr0 is write-protected, mounting read-only
[Root@pxe ~]# cp-r/mnt/cdrom//var/www/html/#yum Apache The default path is/var/www/html
########### #网络守护进程服务程序 ############
[Root@pxe ~]# cp/etc/xinetd.d/tftp/etc/xinetd.d/tftp.bk$ (date +%f)
Disable = yes
Modified to disable = no
[Root@pxe ~]#/etc/init.d/xinetd Restart
########### #必要镜像 ############
[Root@pxe ~]# Cp/var/www/html/cdrom/images/pxeboot/{initrd.img,vmlinuz}/var/lib/tftpboot/
[Root@pxe ~]# cp/var/www/html/cdrom/isolinux/*.msg/var/lib/tftpboot/
[Root@pxe ~]# cp/usr/share/syslinux/menu.c32/var/lib/tftpboot/
[Root@pxe ~]# Mkdir/var/lib/tftpboot/pxelinux.cfg
[Root@pxe ~]# Cp/var/www/html/cdrom/isolinux/isolinux.cfg/var/lib/tftpboot/pxelinux.cfg/default
[Root@pxe ~]# cp/usr/share/syslinux/pxelinux.0/var/lib/tftpboot/
[Root@pxe ~]# Ll/var/lib/tftpboot/pxelinux.cfg/default
-r--r--r--. 1 root root 936 15:00/var/lib/tftpboot/pxelinux.cfg/default
[Root@pxe ~]# cp/var/www/html/cdrom/isolinux/vesamenu.c32/var/lib/tftpboot/
[Root@pxe ~]# ll/var/lib/tftpboot/
Total 38316
-r--r--r--. 1 root 15:45 boot.msg
-r--r--r--. 1 root root 34815427 15:45 initrd.img #这是一个初始化文件, a minimal system image
-rw-r--r--. 1 root root 61796 15:48 menu.c32
-rw-r--r--. 1 root root 26759 15:51 pxelinux.0 #这文件是为legcay启动, which is the Legcay boot mirror
Drwxr-xr-x. 2 root root 4096 15:50 pxelinux.cfg #该文件夹下放的是启动菜单, manually created
-r--r--r--. 1 root root 163728 15:54 vesamenu.c32 #legacy BIOS boot Menu tool, can be found from CD or/usr/share/syslinux/
-r-xr-xr-x. 1 root root 4152336 15:45 vmlinuz #内核文件

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.