Dhcpd + vsFTPd + TFTP + KickStart + PXE Automatic Installation of RHEL5.4

Source: Internet
Author: User
1. The reason for installing the RHEL5.x system over the network is to solve a large number of bare metal installation systems, and perform simple system tuning for the system. In this case, you can use vsftpd + dhcp + tftp + kickstart to install RHEL5.x over the network, kickstart is used to customize the system. It is to install the system's boot file 2 system requirement 1. In the system environment, vsftpdtftpddhcp is the same Server. Make sure that the software package has been installed. If not, install 1. Reasons for installing the RHEL5.x system over the network
To solve a large number of bare metal installation systems and perform simple system tuning for the system, use vsftpd + dhcp + tftp + kickstart to install RHEL5.x over the network. kickstart is used to customize the system, is the boot file for installing the system

System Requirements

1 In the system environment vsftpd tftpd dhcp for the same Server, make sure that the software package has been installed, if not installed please install Vsftpd-2.0.5-16.el5.i386 Tftp-server-0.49-2.i386 Xinetd-2.3.14-10.el5 system-config-kickstart-2.6.19.8-2.el5 dhcp-3.0.5-21.el5 libdhcp4client-3.0.5-21.el5 libdhcp-1.20-10.el5 dhcp-devel-3.0.5-21.el5 libdhcp4client-devel-3.0.5-21.el5 2 configure dhcp service, vsftp Service (Note: dhcp server configuration is omitted here) Add the following two lines to the main configuration file of the dhcp service: next-server 192.168.2.19; note: the IP address of the tftp server is filename "pxelinux.0" # boot file 3 after pxe obtains the IP address. Configure the tftp service and restart the tftp service # cd/etc/xinetd. d # vim tftp modify the tftp configuration file as follows: disable = yes; change to disable = no; # chkconfig tftpd on # service xinetd restart 4 mount the system CD, copy the required boot file # mkdir/media/cdrom # mount/dev/cdrom/media/cdrom # cd/tftpboot # cp/usr/lib/syslinux/pxelinux.0/ tftpboot/# mkdir pxelinux. cfg # cp/media/cdrom/isolinux. cfg pxelinux. cfg/default # cp/media/cdrom/images/pxeboot/initrd. img/tftpboot # cp/media/cdrom/images/pxeboot/vmlinuz/tftpboot 5 Modify/tftpboot/default file as follows # cat/tftpboot/default linux prompt 1 timeout 10 display boot. msg F1 boot. msg F2 options. msg F3 general. msg F4 param. msg F5 rescue. msg label linux kernel vmlinuz append linux ks = ftp://192.168.2.19/pub/ks.cfg Initrd = initrd. img # note that ks is specified here. cfg file. this file is the kickstart installation configuration file. The system installs this file to install label text kernel vmlinuz append initrd = initrd. img text label ks kernel vmlinuz append ks = ftp://192.168.2.19/pub/ks.cfg Initrd = initrd. img # note that ks is specified here. cfg file. this file is the kickstart installation configuration file. The system installs this file to install label local localboot 1 label memtest86 kernel memtest append-6 to configure ks. cfg file, you can refer to the existing system on the anaconda-ks.cfg, you can use a variety of text editors to modify the file, of course, in this is to use the system-config-kickstart compilation tool to modify the kickstart file, also you need to refer to the anaconda-ks.cfg file # system-config-kickstart & 7 to confirm in ks. key-skip # vim ks in the configuration file of cfg. cfg text Note: install the system auth -- useshadow -- enablemd5 in text mode # Note: your password uses md5 for encryption bootloader -- append = "rhgb quiet" -- location = mbr -- driveorder = sda zerombr clearpart -- linux -- drives = sda graphical firewall -- disabled firstboot -- disable keyboard us key-skip note: you must have this option. Otherwise, you must manually enter the system serial number lang en_US logging -- level = info url -- url = during installation. ftp://192.168.2.19/pub/OS Note: ftp is used to install the system network -- bootproto = dhcp -- device = eth0 -- onboot = on reboot rootpw -- iscrypted $1 $ 2t748Yno $ qJJYHyXe4CioPhP6hjj650 selinux-disabled note: disable the selinux system skipx timezone -- isUtc Asia/Shanghai install clearpart -- linux -- drives = sda # The following is the disk partition. Of course, you can manually specify the size of each partition here. Note: disk Partitions are divided as needed part/boot -- fstype ext3 -- size = 100 -- ondisk = sda part pv.2 -- size = 0 -- grow -- ondisk = sda volgroup VolGroup00 -- pesize = 32768 pv.2 logvol /-- fstype ext3 -- name = LogVol00 -- vgname = VolGroup00 -- size = 1024 -- grow logvol swap -- fstype swap -- name = LogVol01 -- vgname = VolGroup00 -- size = 1000 -- grow -- maxsize = 4000 # script executed after system installation; to disable unrelated services and their optimization, refer to % post # Note: the script executed after installation # set open max file Num sed-I '/# End of file/I * soft nofile 819200'/etc/security/limits. conf sed-I '/# End of file/I * hard nofile 819200'/etc/security/limits. conf # some service are stop chkconfig apmd off chkconfig autofs off chkconfig restart-daemon off chkconfig restart-Disable off chkconfig bluetooth off chkconfig hidd off chkconfig hcid off chkconfig dund off chkconfig pand off chkconfig capi off chkconfig cups off chkconfig firstboot off chkconfig restart off irda off chkconfig isdn off chkconfig restart off chkconfig sendmail off chkconfig revoke off chkconfig ypbind off chkconfig yum-updatesd off chkconfig xend off chkconfig setroubleshoot off chkconfig winbind off # System optimization System tuning echo "# System Optimization">/etc/sysctl. conf sed-I '/# System Optimization/a net. ipv4.tcp _ keepalive_intvl = 2'/etc/sysctl. conf sed-I '/# System Optimization/a net. ipv4.tcp _ keepalive_probes = 2'/etc/sysctl. conf sed-I '/# System Optimization/a net. ipv4.cp _ keepalive_time = 30'/etc/sysctl. conf sed-I '/# System Optimization/a net. required tcp_tw_recycle = 1'/etc/sysctl. conf sed-I '/# System Optimization/a net. ipv4.tcp _ tw_reuse = 1 '/etc/sysctl. conf sed-I '/# System Optimization/a fs. file-max = 819200 '/etc/sysctl. conf # set character sed-I's/en \ _ US \. UTF \-8/zh \ _ CN \. GBK/G'/etc/sysconfig/i18n sed-I '/LANG/a LANGUAGE = "en_US.GBK'/etc/sysconfig/i18n sed-I '/LANGUAGE/a LC_CTYPE =" zh_CN.GBK "'/etc/sysconfig/i18n
8 ks. cfg is copied to the ftp working directory # cp ks. cfg/var/ftp/pub Note: It must be/tftpboot/pxelinux. ks. the configuration position of cfg is the same. otherwise, the system cannot be installed over the network.
9. Place the image file in the System Disk Under/var/ftp/pub/OS, restart the physical host to be installed, and start the instance from the network.
Related Article

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.