Book Image

CentOS 6 Linux Server Cookbook

By : Jonathan Hobson
Book Image

CentOS 6 Linux Server Cookbook

By: Jonathan Hobson

Overview of this book

CentOS is a community-based enterprise class operating system and this book will provide a series of practical solutions that will not only show you how to install and maintain CentOS as a server, but to explore this well-known Linux distribution with the intention of tackling many common issues by providing some tricks of the trade in order to simplify the task of building a server."CentOS 6 Linux Server Cookbook" is a practical guide to installation, configuration, administration, and maintenance. This is a one-stop-shop to all things CentOS, so regardless as to whether you need a mail server, web server, database server, domain server or a file sharing platform, this book provides a comprehensive series of starting points that will give you direct access to the inner workings of this open source, community-based enterprise server."CentOS 6 Linux Server Cookbook" is a practical guide to the complete installation, configuration, administration, and maintenance of one of the world's most popular community-based enterprise servers.From installation to configuration, this book of recipes will take you on a journey to explore inner workings of CentOS server. Within this book you will learn how to install CentOS in variety of settings, enhance your installation with the correct tools of the trade and prepare your server to fulfil almost any role you could ever need.By discovering more about time, networking, package management, system management and security, this book will serve to show you how to get the very best from this freely available, open source server by presenting a series of solutions that will enable you to master the art of building your very own web, database, mail, domain name, file sharing services.CentOS 6 Linux Server Cookbook is a hands-on approach to installing, configuring and managing this ever popular community based enterprise server. By taking you from installation to customization this book will serve all Linux professionals and enthusiasts alike by providing you with a practical guide to using CentOS as a world-class server solution that is capable of delivering your mail, web, ftp, domain and file sharing services.
Table of Contents (18 chapters)
CentOS 6 Linux Server Cookbook
About the Author
About the Reviewers

Updating the installation and enhancing the minimal install with additional administration and development tools

In this recipe we will learn how to enhance the minimal install with additional tools that will give you a variety of administrative and development options that will prove vital during the lifetime of your server.

The minimal install is probably the most efficient way you can install a server, but having said that, a minimal install does require some additional features in order to make it a more compelling model. We are all aware that a server will require a variety of administration and development tools and with this in mind, this recipe will show you how to install the extra packages that will not only prove useful throughout the reading of this book, but they will endeavor to improve your workflow and your overall enjoyment of CentOS.

Getting ready

To complete this recipe, you will require a minimal installation of the CentOS 6 operating system with root privileges with a connection to the Internet in order to facilitate the download of additional packages.

How to do it...

We will begin this recipe by updating the system.

  1. To do this, log in as root and type:

    yum –y update
  2. CentOS will now search for the relevant updates and, if available, they will be installed. On completion and depending on what was updated (that is, kernel and new security features to name but a few), you can decide to reboot your computer. To do this type:

  3. Your server will now reboot and having returned to the login screen, we will now complete the main recipe and enhance our current installation with a series of package groups that will prove to be very useful in the future. To do this, log in as root and type:

    yum –y groupinstall "Base" "Development Libraries" "Development Tools"
  4. When the installation process is complete, simply reboot your server by typing the following command:


How it works...

The purpose of this recipe is to enhance a minimal installation of the CentOS 6 operating system and by doing this you have not only introduced yourself to the Yum Package Manager (something to which we will return to later on in this book), but you now have a system that is capable of running a vast amount of applications right out of the box.

So what have we learned from this experience?

We started the recipe by updating the system in order to ensure that our system was up to date:

yum –y update

At this stage it is often a good idea to reboot the system. The reason behind this is typically based on the desire to take advantage of a new kernel or revised security updates (that is, SELinux or IPTables). It is not expected that we will do this very often, but rebooting the server was simply a matter of using the following command:


In the next phase the recipe showed you how to add a series of package groups that may prove to be more than useful in the future. To save time we wrapped the instruction to install three main package groups in a single command like so:

yum –y groupinstall "Base" "Development Libraries" "Development Tools"

The preceding action alone installs over 200 individual packages thereby giving your server the ability to compile code and run a vast array of applications out of the box. This list includes Perl, Python, GCC, Make, nslookup, ping, and a vast array of other necessary and important packages you may need over the life time of your server.

For example, you can run nslookup as follows:


Moreover, instead of using the Vi text editor, you now have the opportunity to use the Nano text editor and many more. Which, given its lack of complexity, usually makes the process of managing your server that much simpler.

For example, if you are ever asked to edit or create a new a file. Instead of typing the following:

vi /path/to/some_file_name

You could type:

nano /path/to/some_file_name

You will be happy to know that this form of text editor replacement will work for all the examples shown throughout this book.

On top of this, you will also have the chance to use vim-enhanced , another fantastic text editor that supports scripts and color coding, but as a tutorial on this subject is beyond the purpose of this recipe I have included some links at the end of this section that will get you started.

The final part of this recipe was to action another reboot by typing:


Again this is not always required, but given the number of new packages you have just installed, it is often advisable in order for you to enjoy the benefits of your new server.

See also

  • GNU Nano project's home page:

  • GNU Nano Guide:

  • The Vi Lovers home page:

  • Vim project home page:

  • Vim documentation and help: