Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
CentOS 7 Linux Server Cookbook, Second Edition
CentOS 7 Linux Server Cookbook, Second Edition

CentOS 7 Linux Server Cookbook, Second Edition: Get your CentOS server up and running with this collection of more than 80 recipes created for CentOS 7 - essential for Linux fans! , Second Edition

eBook
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

CentOS 7 Linux Server Cookbook, Second Edition

Chapter 2. Configuring the System

In this chapter, we will cover the following topics:

  • Navigating text files with less
  • Introduction to Vim
  • Speaking the right language
  • Synchronizing the system clock with NTP and the chrony suite
  • Setting your hostname and resolving the network
  • Becoming a superuser
  • Building a static network connection
  • Customizing your system banners and messages
  • Priming the kernel

Introduction

This chapter is a collection of recipes that covers the basic practice of establishing the basic needs of a server. For many, building a server can often seem to be a daunting task, and so the purpose of this chapter is to provide you with an instant method to achieve the desired goals.

Navigating text files with less

Throughout this book, you will often use programs and tools that use the program less or a less-like navigation to view and read file content or display output. At first, the control can seem a bit unintuitive .Here, in this recipe, we will show you the basics of how to navigate through a file using less controls.

Getting ready

To complete this recipe, you will require a working installation of the CentOS 7 operating system with root privileges.

How to do it...

  1. To begin, log in as root and type the following command to open a program that uses less for navigation:
    man man
    
  2. To navigate, press the up and down key to scroll up and down one line at a time, the spacebar to scroll down a page, and the b key to scroll up a page. You can search within the text using the forward slash key, /,followed by the search term, then press Return to search. Press n to jump to the next search result. Press the q key to exit.

How it works...

Here, in this short recipe, we have shown...

Introduction to Vim

In this recipe, we will give you a very brief introduction to the text editor, Vim, which is used as the standard text editor throughout this book. You can also use any other text editor you prefer, such as nano or emacs, instead.

Getting ready

To complete this recipe, you will require a working installation of the CentOS 7 operating system with root privileges.

How to do it...

We will start this recipe by installing the vim-enhanced package, as it contains a tutorial you can use to learn working with Vim:

  1. To begin, log in as root and install the following package:
    yum install vim-enhanced
    
  2. Afterwards, type the following command to start the Vim tutorial:
    vimtutor
    
  3. This will open the Vim tutorial in the Vim editor. To navigate, press the up and down key to scroll up and down single-line wise. To exit the tutorial, press the Esc key, then type :q!, followed by the Return key to exit.
  4. You should now read through the file and go through the lessons to get a basic understanding of...

Speaking the right language

In this recipe, we will show you how to change the language settings of your CentOS 7 installation for the whole system and for single users. The need to change this is rare but can be important, for example if we accidentally chose the wrong language during installation.

Getting ready

To complete this recipe, you will require a working installation of the CentOS 7 operating system with root privileges, and a console-based text editor of your choice. You should have read the Navigating text files with less recipe, because some commands in this recipe will use less for printing output.

How to do it...

There are two categories of settings that you have to adjust if you want to change the system-wide language settings of your CentOS 7 system. We begin by changing the system locale information and then the keyboard settings:

  1. To begin, log in as root and type the following command to show the current locale settings for the console, graphical window managers (X11 layout...

Synchronizing the system clock with NTP and the chrony suite

In this recipe, we will learn how to synchronize the system clock with an external time server using the Network Time Protocol (NTP) and the chrony suite. From the need to time-stamp documents, e-mails, and log files, to securing, running, and debugging a network, or to simply interact with shared devices and services, everything on your server is dependent on maintaining an accurate system clock, and it is the purpose of this recipe to show you how this can be achieved.

Getting ready

To complete this recipe, you will require a working installation of the CentOS 7 operating system with root privileges, a console-based text editor of your choice, and a connection to the Internet to facilitate downloading additional packages.

How to do it...

In this recipe, we will use the chrony service to manage our time synchronization. As chrony is not installed by default on CentOS minimal, we will start this recipe by installing it:

  1. To begin, log...

Setting your hostname and resolving the network

The process of setting the hostname is typically associated with the installation process. If you ever need to change it or your server's Domain Name System (DNS) resolver, this recipe will show you how.

Getting ready

To complete this recipe, you will require a working installation of the CentOS 7 operating system with root privileges, and a console-based text editor of your choice.

How to do it...

To begin this recipe, we shall start by accessing the system as root and opening the following file in order to name or rename your current server's hostname:

  1. Log in as root and type in the following command to see the current hostname:
    hostnamectl status
    
  2. Now, change the hostname value to your preferred name. For example, if you want to call your server jimi, you would type (change appropriately):
    hostnamectl set-hostname jimi
    

    Note

    Static hostnames are case-sensitive and restricted to using an Internet-friendly alphanumeric string of text. The...

Introduction


This chapter is a collection of recipes that covers the basic practice of establishing the basic needs of a server. For many, building a server can often seem to be a daunting task, and so the purpose of this chapter is to provide you with an instant method to achieve the desired goals.

Navigating text files with less


Throughout this book, you will often use programs and tools that use the program less or a less-like navigation to view and read file content or display output. At first, the control can seem a bit unintuitive .Here, in this recipe, we will show you the basics of how to navigate through a file using less controls.

Getting ready

To complete this recipe, you will require a working installation of the CentOS 7 operating system with root privileges.

How to do it...

  1. To begin, log in as root and type the following command to open a program that uses less for navigation:

    man man
    
  2. To navigate, press the up and down key to scroll up and down one line at a time, the spacebar to scroll down a page, and the b key to scroll up a page. You can search within the text using the forward slash key, /,followed by the search term, then press Return to search. Press n to jump to the next search result. Press the q key to exit.

How it works...

Here, in this short recipe, we have shown...

Introduction to Vim


In this recipe, we will give you a very brief introduction to the text editor, Vim, which is used as the standard text editor throughout this book. You can also use any other text editor you prefer, such as nano or emacs, instead.

Getting ready

To complete this recipe, you will require a working installation of the CentOS 7 operating system with root privileges.

How to do it...

We will start this recipe by installing the vim-enhanced package, as it contains a tutorial you can use to learn working with Vim:

  1. To begin, log in as root and install the following package:

    yum install vim-enhanced
    
  2. Afterwards, type the following command to start the Vim tutorial:

    vimtutor
    
  3. This will open the Vim tutorial in the Vim editor. To navigate, press the up and down key to scroll up and down single-line wise. To exit the tutorial, press the Esc key, then type :q!, followed by the Return key to exit.

  4. You should now read through the file and go through the lessons to get a basic understanding of...

Speaking the right language


In this recipe, we will show you how to change the language settings of your CentOS 7 installation for the whole system and for single users. The need to change this is rare but can be important, for example if we accidentally chose the wrong language during installation.

Getting ready

To complete this recipe, you will require a working installation of the CentOS 7 operating system with root privileges, and a console-based text editor of your choice. You should have read the Navigating text files with less recipe, because some commands in this recipe will use less for printing output.

How to do it...

There are two categories of settings that you have to adjust if you want to change the system-wide language settings of your CentOS 7 system. We begin by changing the system locale information and then the keyboard settings:

  1. To begin, log in as root and type the following command to show the current locale settings for the console, graphical window managers (X11 layout...

Left arrow icon Right arrow icon

Key benefits

  • A practical guide to install, configure, administer and maintain CentOS 7 servers
  • An in-depth guide to the CentOS 7 operating system, exploring its various new features and changes in server administration
  • Presents tricks and solutions to tackle common server issues with the help of practical examples and real-life scenarios

Description

This book will provide you with a comprehensive series of starting points that will give you direct access to the inner workings of the latest CentOS version 7 and help you trim the learning curve to master your server. You will begin with the installation and basic configuration of CentOS 7, followed by learning how to manage your system, services and software packages. You will then gain an understanding of how to administer the file system, secure access to your server and configure various resource sharing services such as file, printer and DHCP servers across your network. Further on, we cover advanced topics such as FTP services, building your own DNS server, running database servers, and providing mail and web services. Finally, you will get a deep understanding of SELinux and you will learn how to work with Docker operating-system virtualization and how to monitor your IT infrastructure with Nagios. By the end of this book, you will have a fair understanding of all the aspects of configuring, implementing and administering CentOS 7 Linux server and how to put it in control.

Who is this book for?

This book is targeted at beginner and more experienced system administrators alike who want to use CentOS as their server solution. Readers do not need much pre-knowledge or experience at all to work with this book.

What you will learn

  • Install and configure CentOS 7 Linux server system from scratch using normal and advanced methods
  • Maintain a performance-based and secure server solution by deploying expert configuration advice and managing software packages
  • Monitor, manage and develop your server s file system to maintain a stable performance
  • Gain best practice methods on sharing files and resources through a network
  • Install and configure common standard services such as web, mail, FTP, database and domain name server technologies
  • Introduce you to the world of operating-system-level virtualization using the Docker platform.
  • Understand the fundamentals of the Security-Enhanced Linux access control architecture
  • Monitor your IT infrastructure using Nagios

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jan 29, 2016
Length: 326 pages
Edition : 2nd
Language : English
ISBN-13 : 9781785883989
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jan 29, 2016
Length: 326 pages
Edition : 2nd
Language : English
ISBN-13 : 9781785883989
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 148.97
CentOS High Performance
$38.99
Mastering CentOS 7 Linux Server
$54.99
CentOS 7 Linux Server Cookbook, Second Edition
$54.99
Total $ 148.97 Stars icon
Banner background image

Table of Contents

16 Chapters
1. Installing CentOS Chevron down icon Chevron up icon
2. Configuring the System Chevron down icon Chevron up icon
3. Managing the System Chevron down icon Chevron up icon
4. Managing Packages with YUM Chevron down icon Chevron up icon
5. Administering the Filesystem Chevron down icon Chevron up icon
6. Providing Security Chevron down icon Chevron up icon
7. Building a Network Chevron down icon Chevron up icon
8. Working with FTP Chevron down icon Chevron up icon
9. Working with Domains Chevron down icon Chevron up icon
10. Working with Databases Chevron down icon Chevron up icon
11. Providing Mail Services Chevron down icon Chevron up icon
12. Providing Web Services Chevron down icon Chevron up icon
13. Operating System-Level Virtualization Chevron down icon Chevron up icon
14. Working with SELinux Chevron down icon Chevron up icon
15. Monitoring IT Infrastructure Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.1
(10 Ratings)
5 star 50%
4 star 30%
3 star 0%
2 star 20%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Mike Feb 18, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Was very helpful, I had never used this version of Linux before.
Amazon Verified review Amazon
edgar p. Oct 29, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great book.
Amazon Verified review Amazon
J. Osborne Feb 19, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This is the book I have been looking for. It walks you through step by step from installation to having a complete server up and running. Other books tend to show you the technical use of the commands but don't apply the use to specifically setting up a server. Well written and easy to understand. This book will get new CentOS users up and running with a basic linux server while providing useful information for those that already have a better understanding of Linux servers. Great book!
Amazon Verified review Amazon
Paul McDowell Dec 01, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
CentOS 7 is kind of a slap in the head to those of us used to the more conventional server platform OS setups. This book helps get you past a lot of that.
Amazon Verified review Amazon
Amazon Customer Jan 11, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Excellent! Taught me how to do many things that was second nature with CentOS 6 exactly how to do it in CentOS 7.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.