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

Installing CentOS using Anaconda in graphics mode


In this recipe, you'll learn how to install CentOS using the graphical installer Anaconda. This is the most common way that CentOS is installed, although there are other ways too (some of which are discussed in later recipes). This approach is also the easiest installation method, especially for setting up single-server deployments.

Getting ready

This recipe assumes that you have a copy of the CentOS 7 installation medium. If you don't, visit https://www.centos.org and download a minimal ISO image. You'll also need to make a physical disc from the image. Instructions for burning the ISO image to disc can be found at https://www.centos.org/docs/5/html/CD_burning_howto.html.

Note

If your system doesn't have an optical drive and its BIOS supports booting from a USB device, you can also write the ISO image to a USB stick.

How to do it...

Follow these steps to install CentOS using the graphical installer Anaconda:

  1. Insert the installation disc into your system's optical drive (or USB stick into a USB port) and reboot. The system should boot to the CentOS 7 installation menu:

    The installer is launched from the installation menu

    Note

    If your system doesn't boot to the installation menu then the drive may not be configured as a boot device. The exact steps to verify and adjust the configuration vary between BIOS vendors, but in general you'll press Esc, F1, F2, or Delete while the system is booting to gain access to the BIOS settings. Then you'll find the list of boot devices and change the order in which each is searched for a boot record.

  2. Using the arrow keys, make sure that the Install CentOS 7 option is highlighted and press Enter.

  3. The WELCOME TO CENTOS 7 screen confirms which language to use during the installation process. Select your desired language and click on Continue:

    You can change the language used during the installation process

  4. The next screen is a menu that organizes the installation options by category. We'll configure networking first—click on NETWORK & HOST NAME under the SYSTEM category:

    Note

    If your system doesn't have a mouse, you can navigate using Tab to cycle through the input fields, use the arrow keys to select the entry, and press Enter to select or activate an input.

    The installation summary screen organizes the installation options into categories

  5. Enter the system's hostname in the Host name field. Then, select the system's primary network interface and toggle the switch at the right to ON to enable it. Click on the Done button when you're finished to return to the INSTALLATION SUMMARY menu:

    The NETWORK & HOST NAME screen lets us configure the system's network interfaces

  6. Click on DATE & TIME under the LOCALIZATION category.

  7. Set your time zone by either selecting your region and city or by clicking on your location on the map. Then, click on Done to return to the INSTALLATION SUMMARY menu:

    The DATE & TIME screen lets us configure the system's time zone

  8. If you know what purpose the system will serve on your network and require something more than a minimal installation, click on SOFTWARE SELECTION under the SOFTWARE category. Select the environment and any additional add-ons to install the desired packages. When you're finished, click on Done:

    The SOFTWARE SELECTION screen lets us install purpose-based software

    Note

    Software can easily be installed using yum, so don't worry if you need to install additional software after you already have CentOS up and running. The SOFTWARE SELECTION section is purely for convenience.

  9. Click on INSTALLATION DESTINATION under the SYSTEM category.

  10. Click on the appropriate drive in the Local Standard Disks area to set the installation target. If the drive is not bootable, or if multiple drives are selected, click on the Full disk summary and boot loader... link at the bottom of the screen to open the Selected Disks window. Then, select the drive you want to be the boot device, click on the Set as Boot Device button, and click on Close. When you're finished, click on Done:

    The INSTALLATION DESTINATION screen lets us set the disk where CentOS will be installed

  11. Click on the Begin Installation button to start the installation process.

  12. Click on Root Password. In the input fields, enter and confirm the password you want to use for the system's root account. Click on Done when you've finished entering these details:

    Note

    You'll need to press the Done button twice to return to the configuration screen if you specify a password that's too weak. If you need help to create a strong password, visit http://www.howtogeek.com/195430/how-to-create-a-strong-password-and-remember-it/.

    The ROOT PASSWORD screen lets us set the root account's password

  13. Click on User Creation. In the input fields, provide your name, username, and desired password. Again, press Done when you've finished entering these details:

    The CREATE USER screen lets us create an unprivileged user account

  14. When the installation is complete, click on the Finish Configuration button. Anaconda will finalize the system's configuration and the button's label will change to Reboot.

  15. Remove the CentOS installation media from the drive and reboot your system.

How it works...

After installing CentOS using Anaconda in graphical mode, you should now have a basic CentOS 7 system up and running. The process began when we booted the system from the installation disc and selected Install CentOS 7 from the installation menu. The installer's kernel loaded into memory and Anaconda launched in graphical mode.

The NETWORK & HOST NAME screen shows a list of the available network interfaces and basic information about them, for instance, the card's MAC address and transfer rate. By default, the interfaces are configured to use DHCP to obtain their IP address when they are enabled. (Configuring a static IP address is discussed in a later recipe.)

The system's time zone is set on the LOCALIZATION screen. The date and time fields are disabled when NTP is enabled because the values will be set by the NTP service. The system clock's time can drift for many reasons, especially if the system is running on a virtual machine, so allowing NTP to manage the system's time is a good idea to ensure it stays correct. If the date and time fields aren't set by NTP, make sure the Network Time toggle is set ON. You can specify an NTP server by clicking on the button with the gears icon.

The INSTALLATION DESTINATION screen lets us set the installation target for CentOS and specify how the system's drives are partitioned. You can choose to configure the partitions if you have special requirements, but in this recipe I let Anaconda partition the drives automatically.

While Anaconda is busy installing CentOS and any additional software packages you may have requested, it shows us the Configuration screen. This screen gives us the opportunity to set a password for the system's administrative account (root) and create an unprivileged user account. You should only sign in with root when necessary; for your normal day-to-day work you should use your unprivileged account. Anaconda finalizes the installation by configuring the system's boot record and creating the user account.

After the system reboots, the Grub boot loader prompt appears and the arrow keys can be used to select a boot configuration. There's also a timer, so pressing nothing will eventually boot the system using the default configuration.

See also

For more information on installing CentOS 7, refer to the RHEL 7 Installation Guide (https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide).