Book Image

CentOS 7 Server Deployment Cookbook

By : Timothy Boronczyk, IRAKLI NADAREISHVILI
Book Image

CentOS 7 Server Deployment Cookbook

By: Timothy Boronczyk, IRAKLI NADAREISHVILI

Overview of this book

CentOS is derived from Red Hat Enterprise Linux (RHEL) sources and is widely used as a Linux server. This book will help you to better configure and manage Linux servers in varying scenarios and business requirements. Starting with installing CentOS, this book will walk you through the networking aspects of CentOS. You will then learn how to manage users and their permissions, software installs, disks, filesystems, and so on. You’ll then see how to secure connection to remotely access a desktop and work with databases. Toward the end, you will find out how to manage DNS, e-mails, web servers, and more. You will also learn to detect threats by monitoring network intrusion. Finally, the book will cover virtualization techniques that will help you make the most of CentOS.
Table of Contents (18 chapters)
CentOS 7 Server Deployment Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

Coordinating multiple installations using Kickstart


If you're planning on installing CentOS on multiple servers, it's more convenient to automate as much of the process as possible. In this recipe, you'll learn how to use Anaconda's kickstart.cfg file to perform an unattended network-based installation.

Getting ready

This recipe requires at least two systems on your network: an existing system running an HTTP server to host the installation files and Kickstart configuration (the recipe Installing Apache HTTP Server and PHP in Chapter 10, Managing Web Servers, shows you how to install Apache) and the target system on which we'll install CentOS. You'll also need the installation media and administrative privileges.

How to do it...

Follow these steps to perform unattended network installations using the Kickstart method:

  1. Log in to the system running the HTTP server using the root account.

  2. Place the installation disc in the system's optical drive.

  3. Mount the disc using the mount command so that its contents are accessible:

    mount /dev/cdrom /media
    
  4. Create a new directory under Apache's web root to host the installation files:

    mkdir -p /var/www/html/centos/7/x86_64
    
  5. Copy the contents of the installation disc to the new directory:

    cp -r /media/* /var/www/html/centos/7/x86_64
    
  6. Copy the kickstart.cfg file created by Anaconda when the system was installed to Apache's web root:

    cp /root/kickstart.cfg /var/www/html/kickstart.cfg
    
  7. Unmount and remove the installation disc:

    umount /media
    eject /dev/cdrom
    
  8. Insert the disc into the target system's drive and reboot it. The system should boot to the CentOS 7 installation menu.

  9. Highlight the Install CentOS 7 option and press Tab.

  10. Update the arguments used to boot the installer kernel to read as follows. Change the IP address as necessary to point to the system hosting the Kickstart file:

           vmlinuz initrd=initrd.img ks=http://192.168.56.100/kickstart.cfg 
    
  11. Press Enter to begin the installation process.

  12. Once the installation process begins, you can eject the disc and begin the next system's installation. Repeat steps 8-11 for each additional system.

How it works...

Anaconda writes the configuration values we provide when performing a graphical or text-based installation to kickstart.cfg. If you plan on installing CentOS on multiple servers, it's more convenient to use the file to provide the interface's answers. The remaining installations can be performed mostly unattended and the systems' configurations will be more consistent.

This recipe showed you how to make the kickstart.cfg file and the CentOS installation files available to other systems over the network, and update the boot command to tell Anaconda where to look for the installation files and prompt responses. Since the software packages are retrieved from the installation server instead of the disc, you can eject the disc as soon as the installation process is underway and use it to begin the next process on your next system.

Of course, kickstart.cfg can be used as a starting point, and you can edit the responses using a text editor to further customize the installations. If you like, you can create multiple kickstart files in the web root, each with a different configuration. Just specify the desired file when you set the installer's boot arguments.

Note

Although you can edit your kickstart files with a basic text editor, dedicated programs exist for editing them as well. Check out Kickstart Configurator (http://landoflinux.com/linux_kickstart_configurator.html).

See also

For more information on coordinating multiple installations of CentOS 7, refer to the following resources: