Unattended automated installation of the RHEL 5.5 operating system using Kickstart, DCHP, TFTP, and HTTP

Source: Internet
Author: User
Tags ldap dchp

//
Unattended automated installation of the RHEL 5.5 operating system using Kickstart, DCHP, TFTP, and HTTP
Server ip:192.168.10.178 Operating system: Red Hat Enterprise Linux Server release 5.5
//
The steps are as follows:

1. Installing and configuring the DHCP service
1.1 Use the following command to check whether DHCP is installed, RHEL5 system default installation Dhcp-3.0.5-23.el5
[Email protected] ~]# Rpm-qa | grep DHCP
If the system does not have DHCP service installed, first install the following RPM package:
dhcp-3.0.5-23.el5.i386.rpm

1.2 Configuring DHCP, modifying/etc/dhcpd.conf
[Email protected] ~]# vi/etc/dhcpd.conf

Examples of #dhcpd. conf configuration files:
#
# DHCP Server Configuration file.
# See/usr/share/doc/dhcp*/dhcpd.conf.sample
#
Ddns-update-style Interim;
Ignore client-updates;
Allow booting;
Allow BOOTP;

FileName "pxelinux.0"; #pxelinux Loader file location
Next-server 192.168.10.178; #tftp所在服务器ip, my serverip.

Subnet 192.168.10.0 netmask 255.255.255.0
{
Option routers 192.168.10.1;
Option Subnet-mask 255.255.255.0;
Range DYNAMIC-BOOTP 192.168.10.100 192.168.10.110; #dhcp动态提供的ip地址范围
Default-lease-time 21600;
Max-lease-time 43200;
}
1.3 After modifying the configuration, restart the service
[[email protected] ~]#/ETC/INIT.D/DHCPD start# start
[[email protected] ~]#/ETC/INIT.D/DHCPD restart# restart

2. Installing and enabling the TFTP service
2.1 Verify that the TFTP service is installed and, if none, install it first.
[Email protected] ~]# Rpm-qa | grep tftp
If TFTP is not installed, first install the following two RPM packages:
tftp-0.49-2.i386.rpm
tftp-server-0.49-2.i386.rpm

2.2 After installing TFTP, modify the configuration file to enable the service
[Email protected] ~]# vi/etc/xinetd.d/tftp

#例子:
# Default:off
# description:the TFTP server serves files using the trivial file transfer \
# protocol. The TFTP protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to-start the installation process for some operating systems.
Service TFTP
{
Socket_type = Dgram
protocol = UDP
Wait = yes
user = root
Server =/USR/SBIN/IN.TFTPD
Server_args =-s/tftpboot
Disable = no# default is yes, here to No
Per_source = 11
CPS = 100 2
Flags = IPV4
}

2.3 After modifying the configuration, restart the service
[[email protected] ~]#/etc/init.d/xinetd start# start
[[email protected] ~]#/etc/init.d/xinetd restart# restart

3. Install and start the HTTP service
3.1 Verify that the HTTP service is installed and, if none, install the service first.
[Email protected] ~]# Rpm-qa | grep http

If there are no HTTP packets in the returned results, install the following RPM packages:
httpd-2.2.3-43.el5.i386.rpm

3.2 After the installation is complete, restart the service
[[email protected] ~]#/etc/init.d/httpd start# start
[[email protected] ~]#/etc/init.d/httpd restart# restart

4. Mount the system image
4.1 Place the RHEL5.5 disc image Rhel-server-5.5-i386-dvd.iso in the server, such as the/home directory.

4.2 Mount ISO image to a directory, such as the/media/rhel5_iso directory
[[email protected] ~]# mkdir/media/rhel5_iso# Create mount directory
[email& Nbsp;protected] ~]# mount-t iso9660-o loop/home/rhel-server-5.5-i386-dvd.iso/media/rhel5_iso

4.3 Use HTTP to provide security Install the source file
under HTTP directory/var/www/html/to create a link to hang in directory/media/rhel5_iso
[[email protected] ~]# ln-s/media/rhel5_iso/var/ www/html/rhel5# Create a link
or
Create a folder under HTTP directory/var/www/html/and mount the image to that folder
[[email protected] ~]# mkdir/var/ www/html/rhel5.5
[[email protected] ~]# mount-t iso9660-o loop/home/rhel-server-5.5-i386-dvd.iso/var/www/ HTML/RHEL5.5/

5. Configure the system boot file
5.1 RHEL5 is the default installation syslinux, copy/usr/lib/syslinux/pxelinux.0 to/tftpboot/directory
[[ Email protected] ~]# cp/usr/lib/syslinux/pxelinux.0/tftpboot/

5.2 Copy the Initrd.img,vmlinuz,isolinux.cfg file from the system installation image/media/rhel5_iso/isolinux directory to the/tftpboot/directory
The Initrd.img,vmlinuz in the above file is also present in the #在/media/rhel5_iso/images/pxeboot directory
[Email protected] ~]# cp/media/rhel5_iso/isolinux/initrd.img/tftpboot/
[Email protected] ~]# cp/media/rhel5_iso/isolinux/vmlinuz/tftpboot/
[Email protected] ~]# cp/media/rhel5_iso/isolinux/isolinux.cfg/tftpboot/

5.3 Create folder Pxelinux.cfg under/tftpboot/directory, move isolinux.cfg into pxelinux.cfg directory and rename to default
[Email protected] ~]# mkdir/tftpboot/pxelinux.cfg
[Email protected] ~]# Mv/tftpboot/isolinux.cfg/tftpboot/pxelinux.cfg/default
[Email protected] ~]# chmod 777/tftpboot/pxelinux.cfg/default

5.4 Edit Modify/tftpboot/pxelinux.cfg/default file
[Email protected] pxelinux.cfg]# Vi/tftpboot/pxelinux.cfg/default

#文件内容修改如下: About Ks.cfg, the next

Default Linux
Prompt 1
Timeout 100
Display Boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
Label Linux
Kernel Vmlinuz
Append ks=http://192.168.10.178/ks.cfg initrd=initrd.img
Label text
Kernel Vmlinuz
Append initrd=initrd.img Text
Label KS
Kernel Vmlinuz
Append KS initrd=initrd.img
Label Local
Localboot 1
Label Memtest86
Kernel memtest
Append-


6. Kickstart configuration, configuration file is Ks.cfg
#kickstart是Red Hat provides an installation method that allows you to automate most of the installation tasks for Red Hat Linux.
#kickstart的配置文件ks. CFG is a text file that can be created by using the Kickstart Configurator, or by writing one manually, or by using the/root/anaconda-ks.cfg file to make changes
#关于kickstart选项可参照: http://man.ddvip.com/os/redhat9.0cut/s1-kickstart2-options.html
#
#将ks the. cfg file to the HTTP directory
[Email protected] ~]# MV ks.cfg/var/www/html/

An example of #ks. cfg file is the ks.cfg file used when installing rhel5.5
# Kickstart file automatically generated by Anaconda.

install# specifies that the system is a new installation, not an upgrade or other
URL--url=http://192.168.10.178/rhel5# is installed from the installation tree on the remote server via HTTP
Key--skip# Skip input installation serial number
Lang en_US. utf-8# language Selection
Keyboard us# Keyboard Selection
Xconfig--startxonboot--defaultdesktop=gnome# Select Desktop System
Network--device eth0--bootproto static--ip 192.168.10.70--netmask 255.255.255.0--gateway 192.168.10.1--nameserver 10 .90.0.5# setting up the network
ROOTPW--iscrypted $1$ixspthfc$0mq4qol1b2be6ly1yveht/#设置root密码, the password set here is Hzalcatel, MD5 encrypted
#firewall--enabled--port=22:tcp
Firewall--disabled# fire wall off
Authconfig--enableshadow--ENABLEMD5
#selinux--enforcing
SELinux--disabled#selinux off
TimeZone--UTC asia/shanghai# time zone settings
bootloader--location=mbr #--driveorder=sda--append= "RHGB quiet"
ZEROMBR Yes
# The following is the partition information you requested
# Note that any partitions deleted is not expressed
# unless you clear all partitions first
# Guaranteed to work
#以下为分区设置, can be modified according to the actual situation
Clearpart--linux# Clear All Linux partitions
Part/boot--fstype ext3--size=100
Part/--fstype ext3--size=20000# Create root partition, ext3 format, size 20000M
Part swap--size=512
Part/home--fstype ext3--size=100--grow# remaining disk space allocated to/home
reboot# after the installation is complete, restart the computer

#以下为定制的, packages that need to be installed
%packages
@admin-tools
@base
@chinese-support
@core
@dns-server
@development-libs
@development-tools
@dialup
@editors
@engineering-and-scientific
@ftp-server
@gnome-desktop
@gnome-software-development
@graphical-internet
@java
@java-development
@legacy-network-server
@legacy-software-development
@legacy-software-support
@mysql
@network-server
@openfabrics-enterprise-distribution
@sql-server
@printing
@ruby
@server-cfg
@system-tools
@text-internet
@web-server
@smb-server
@x-software-development
@base-X
System-config-kickstart
Tunctl
Libhbaapi
Kexec-tools
Bridge-utils
Authd
Fipscheck
Device-mapper-multipath
Fuse-libs
Sgpio
Systemtap-sdt-devel
Perl-xml-sax
Pth
Perl-xml-twig
Perl-xml-dumper
Perl-timedate
Perl-libxml-perl
Tog-pegasus-devel
Perl-convert-asn1
Libstdc++44-devel
Libassuan-devel
Perl-xml-namespacesupport
Perl-datemanip
Libksba-devel
Fipscheck-devel
Sblim-cmpi-dhcp-devel
Perl-crypt-ssleay
Perl-mozilla-ldap
Pth-devel
Log4cpp-devel
Perl-ldap
Perl-xml-grove
Libpciaccess-devel
Python-imaging
Libhbaapi-devel
Python-dmidecode
Fuse-devel
Libksba
Perl-archive-zip
Es.
Gcc44-c++
Gcc44-gfortran
Pexpect
Dejagnu
Imake
Java-1.6.0-openjdk-devel
Gcc-objc
Electricfence
memtest86+
Gcc-gnat
Libgfortran44
Gcc44
Expect
Java-1.6.0-openjdk
Unifdef
Python-docs
Nasm
Emacs-nox
Emacs
Vim-x11
Gnuplot-emacs
Nedit
Lapack
Lam
Pvm
Xferstats
Libgnome-java
Libgtk-java
Libglade-java
Libgconf-java
Bsh-demo
Tftp-server
GTK +
Compat-db
openssl097a
Qt4
Compat-readline43
Compat-openldap
Compat-slang
Openmotif22
Mod_auth_mysql
Mysql-devel
Qt-mysql
Mysql-bench
Php-mysql
Vnc-server
Dnsmasq
Dhcp
Postgresql-tcl
Unixodbc-kde
Qt-odbc
Postgresql-contrib
Postgresql-pl
Postgresql-test
Libdbi-dbd-pgsql
Postgresql-jdbc
Postgresql-odbc
Postgresql-docs
Eruby
Ruby-ri
System-config-bind
System-switch-mail-gnome
System-config-boot
Rdesktop
Tog-pegasus
Festival
Tsclient
Audit
Sysstat
Tftp
Php-odbc
Php-pear
Mod_auth_kerb
Mod_nss
Mod_auth_pgsql
Mod_auth_mysql
Mod_authz_ldap
Php-mysql
Php-pgsql
Xorg-x11-xbitmaps
Mesa-libglw-devel
Openmotif-devel
Mesa-libglu-devel
Xorg-x11-server-sdk
Libxp-devel
Xorg-x11-utils
Libpciaccess
Xorg-x11-server-xnest
Xorg-x11-server-xvfb

Unattended automated installation of the RHEL 5.5 operating system using Kickstart, DCHP, TFTP, and HTTP

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.