Linux iTOps Tube

Thursday, 24 November 2011

Setting Up The Kickstart Server

Setting Up The Kickstart Server

Kickstart can be configured on an FTP, NFS or Apache server. Each method is explained below, but my experience has been that the Apache server has a number of advantages over the other two.


Using a web server for kickstart is generally easier because:

  • Sometimes a kickstart server has to be located on a remote network, often passing through a firewall. Strict firewall rules for HTTP are generally easier to configure than those for FTP or NFS.
  • The http:// nomenclature used by kickstart for accessing files is more familiar to users than that used for NFS and FTP. This may be important for you when configuring files for automated kickstart installation.

Basic Preparation

In this example we are going to set up a kickstart server that will be used in Fedora Core installations. All the necessary files will be placed in the /data/network-install directory.

Create The Installation Directories

We'll first create the directories /data/network-install/RPM and /data/network-install/ISO in which we will copy the necessary files.


[root@bigboy tmp]# mkdir -p /data/network-install/RPM
[root@bigboy tmp]# mkdir -p /data/network-install/ISO

You now need to place the network installation driver files into the base directory.

Copying The Files

The HTTP, NFS and FTP kickstart methods all require the base set of Fedora files to be installed on the kickstart server. Here's how to do it:

1) Create a mount point for your CD ROM drive.


[root@bigboy tmp]# mkdir /mnt/cdrom


2) Mount your first Fedora CD ROM.


[root@bigboy tmp]# mount /dev/cdrom /mnt/cdrom


3) Copy the files from the CD ROM base directory to the hard disk


[root@bigboy tmp]# cp -r /mnt/cdrom/* /data/network-install/RPM


4) Unmount your CD ROM and use the eject command to retrieve it from the drive bay.


[root@bigboy tmp]# umount /dev/cdrom
[root@bigboy tmp]# eject cdrom

5) Repeat steps 2 to 4 with all your CDROMs. Overwrite files when prompted.

Note: Note: You also have the option to FTP all the files of the desired version of Fedora from the Fedora website to the /data/network-install/RPM directory.

HTTP & FTP Preparation

Copy all the contents of each installation CD to the /data/network-install/RPM directory. This will require about 3-5 GB of space. When this is completed, your /data/network-install/RPM directory should look like this:


[root@bigboy tmp]# ls -1 /data/network-install/RPM
eula.txt
Fedora
fedora.css
GPL
images
index.html
isolinux
README-Accessibility
RELEASE-NOTES-en_US.html
repodata
RPM-GPG-KEY
RPM-GPG-KEY-beta
RPM-GPG-KEY-fedora
RPM-GPG-KEY-fedora-extras
RPM-GPG-KEY-fedora-legacy
RPM-GPG-KEY-fedora-rawhide
RPM-GPG-KEY-fedora-test
RPM-GPG-KEY-rawhide
stylesheet-images 
[root@bigboy tmp]#

NFS Preparation

Create ISO images of the installation CDs and place them in the /data/network-install/ISO directory. This will require about 3-5 GB of space as well. You can download the ISO images from the Fedora website or use the Fedora CDs as shown below. If you create the ISOs files from CDs, make sure they have the same file names as the ones you can download from the Fedora Web site.

Follow these steps for each CD, substituting the filename where necessary:


[root@bigboy tmp]# cd /data/network-install/ISO
[root@bigboy ISO]# dd if=/dev/cdrom of=filename.iso bs=32k
...
...
[root@bigboy ISO]# eject cdrom

Note: Here is a sample procedure to make ISO files with the older mkisofs command. You may have to install the mkisofs RPM on newer Fedora versions. The command requires a mounted CDROM drive, so don't forget the mount command.


[root@bigboy ISO]# mount /mnt/cdrom
[root@bigboy ISO]# mkisofs -J -r -T -o filename.iso /mnt/cdrom
[root@bigboy ISO]# eject cdrom

Setup Your Webserver

You will now have to setup Apache to give the file listings of your /data/network-install/RPM and/data/network-install/ISO directories by pointing your browser to the URL http://192.168.1.100/network-install/RPM/ or http://192.168.1.100/network-install/ISO/ respectively. A sample/etc/httpd/conf.d/kickstart.conf configuration is below. Remember to restart Apache to make these settings take effect.


NameVirtualHost 192.168.1.100
 
#
# For HTTP Installations
#
<VirtualHost 192.168.1.100>
  ServerName 192.168.1.100
  DocumentRoot /data/
</VirtualHost>

<Directory /data/network-install>
   Options +Indexes
   AllowOverride AuthConfig
   order allow,deny
   allow from all
</Directory>

Setup Your FTP Server

You'll also have to set up your VSFTPD server to make incoming anonymous FTP connections log in to the/data/network-install/RPM directory by default. You will also want to enable the correct logging. Here is a sample snippet of the vsftpd.conf file. Remember to restart VSFTPD to make these settings take effect


#
# File: vsftpd.conf
#

#
# Anonymous FTP Root Directory
#

anon_root=/data/network-install/RPM

#
# Log file definition
#

xferlog_enable=YES
xferlog_file=/var/log/vsftpd.log

Create A Special FTP User

You can also create a special user for non anonymous FTP installations with its home directory as "/". You must also make sure that the user has read access to the /data/network-install directory. An example is below.


[root@bigboy tmp]# useradd -g users ftpinstall
[root@bigboy tmp]# passwd ftpinstall
Changing password for user ftpinstall.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[root@bigboy tmp]#
[root@bigbot tmp]# usermod -d / ftpinstall
[root@bigbot tmp]#

Setup Your NFS Server

The steps for setting up an NFS server are more complicated.

1) Create a /etc/exports file with the following entry in it. You must use tabs, not spaces between the entries


/data/network-install *(ro,sync)


2) Make sure that the rpcbind (portmap on older versions of Linux) , nfs, nfslock and netfs daemons are all running to create an NFS server. The startup scripts for these are found in the /etc/init.d directory. Chapter 29, "Remote Disk Access with NFS", will explain this in more detail.

3) Run the exportfs command to add this directory to the NFS database of network available directories.


[root@bigboy tmp]# exportfs -ra


4) The installation client must have a matching pair of forward and reverse DNS entries on your DNS server. In other words, a DNS lookup on the IP address of the installation client must return a server name that will map back to the original IP address when a DNS lookup is done on that same server name.


[root@bigboy tmp]# host 192.168.1.96
96.1.168.192.in-addr.arpa domain name pointer 192-168-1-96.my-site.com.
[root@bigboy tmp]#
 
[root@bigboy tmp]# host 192-168-1-96.my-site.com
192-168-1-96.my-site.com has address 192.168.1.96
[root@bigboy tmp]#

This may mean that you will have to create entries for all your DHCP IP addresses if you choose to use a DHCP method of assigning IP addresses during installation.

Configure Your DHCP Server

During the installation procedure, the installation client will prompt you for the IP address it should use for the installation process. I recommend selecting the option that makes the Installation Client get its address via DHCP. This will automate the installation more and will therefore make it faster. It will also reduce the possibility of human error.

Setting up the Installation Server as a DHCP server is fairly straight forward and can be found in Chapter 8, "Configuring the DHCP Server".

No comments:

Post a Comment