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
€22.99 €32.99
Paperback
€41.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
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 : 9781785887284
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

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

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.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
€189.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
€264.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 113.97
CentOS High Performance
€29.99
Mastering CentOS 7 Linux Server
€41.99
CentOS 7 Linux Server Cookbook, Second Edition
€41.99
Total 113.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

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.