CentOS 6 Linux Server Cookbook

CentOS 6 Linux Server Cookbook
eBook: $29.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $79.98    Print cover: $49.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Delivering comprehensive insight into CentOS server with a series of starting points that show you how to build, configure, maintain and deploy the latest edition of one of the world’s most popular community based enterprise servers.
  • Providing beginners and more experienced individuals alike with the opportunity to enhance their knowledge by delivering instant access to a library of recipes that addresses all aspects of CentOS server and put you in control.
  • Giving you immediate access to a thriving knowledge base that illustrates just how quickly you can master CentOS server with a whole host of tricks of the trade thrown in for good measure.

Book Details

Language : English
Paperback : 374 pages [ 235mm x 191mm ]
Release Date : April 2013
ISBN : 1849519021
ISBN 13 : 9781849519021
Author(s) : Jonathan Hobson
Topics and Technologies : All Books, Networking and Servers, Cookbooks, Linux Servers, Open Source

Table of Contents

Chapter 1: Installing CentOS
Chapter 2: Configuring CentOS
Chapter 3: Working with CentOS
Chapter 4: Managing Packages with Yum
Chapter 5: Securing CentOS
Chapter 6: Working with Samba
Chapter 7: Working with Domains
Chapter 8: Working with Databases
Chapter 9: Providing Mail Services
Chapter 10: Working with Apache
Chapter 11: Working with FTP
  • Chapter 1: Installing CentOS
    • Introduction
    • Downloading CentOS and confirming the checksum on a Windows desktop
    • Performing an installation of CentOS using the graphical installer
    • Running a netinstall over HTTP
    • Installing CentOS in Text Mode and building a minimal installation
    • Re-installing the boot loader
    • Updating the installation and enhancing the minimal install with additional administration and development tools
    • Finishing the installation process with Firstboot
    • Adding the GNOME desktop environment,
    • changing the runlevel, and installing additional software
    • Chapter 2: Configuring CentOS
      • Introduction
      • Changing the time zone and updating the hardware clock
      • Synchronizing the system clock with NTP
      • Setting a static IP address
      • Binding multiple IP addresses to a single Ethernet device
      • Bonding two Ethernet devices to increase bandwidth and provide redundancy
      • Changing the hostname and resolving a fully qualified domain name
      • Switching SELinux off
      • Disabling the IPv6 module
      • Chapter 3: Working with CentOS
        • Introduction
        • Creating an administrative user and becoming root with the switch user command
        • Introducing mailx and forwarding the root's e-mail to an external e-mail address
        • Automating tasks with cron
        • Synchronizing files and directories with
        • rsync and working towards a full system backup with cron
        • Issuing customized e-mail reports with Mutt
        • Using logrotate to manage logfiles
        • Extending log rotation by adding NTP to logrotate
        • Using chkconfig to enable a custom service at boot
        • Evaluating current memory usage with the free and top commands and clearing the memory cache
        • Chapter 4: Managing Packages with Yum
          • Introduction
          • Updating the system with YUM
          • Cleaning the YUM cache
          • Automating Yum updates with Yum-cron
          • Installing packages with YUM
          • Removing packages with YUM
          • Finding packages with YUM
          • Installing Yum Priorities to support additional repositories
          • Enhancing CentOS with the EPEL and Remi repositories
          • Chapter 5: Securing CentOS
            • Introduction
            • Escalating user privilege with sudo
            • Hardening the secure shell environment
            • Configuring a firewall and working with IPTables
            • Protecting SSH with fail2ban
            • Preventing dictionary-based attacks with DenyHosts
            • Running antivirus scans with ClamAV
            • Chapter 6: Working with Samba
              • Introduction
              • Configuring Samba as a standalone server and enabling home directories
              • Adding, deleting, and disabling a Samba user
              • Providing a network recycle bin for Samba
              • Hiding folders and files with Samba
              • Creating a custom share folder for a specific user or a group of users
              • Chapter 7: Working with Domains
                • Introduction
                • Building a caching-only nameserver with BIND
                • Writing zone files for BIND
                • Adding zones to BIND and configuring a nameserver
                • Deploying a local nameserver with dnsmasq
                • Logging events with dnsmasq and combining this with logrotate
                • Enabling domain name wildcards with dnsmasq
                • Hardening BIND with chroot and providing better security measures
                • Chapter 8: Working with Databases
                  • Introduction
                  • Installing and hardening MySQL server with mysql_secure_installation
                  • Creating a MySQL database, adding a MySQL user, and assigning user privilege from the command line
                  • Installing PostgreSQL, adding a user, and creating your first database
                  • Configuring remote access to PostgreSQL
                  • Chapter 9: Providing Mail Services
                    • Introduction
                    • Enabling a domain-wide Mail Transport Agent (MTA) and testing your SMTP configuration with Telnet
                    • Building a local POP3/SMTP server with Postfix and Dovecot
                    • Closing the open relay, enabling SMTP authentication and dealing with Spam by configuring SASL, and enabling Postfix header and body checks
                    • Using Postfix and Dovecot to serve e-mails across virtual domains
                    • Chapter 10: Working with Apache
                      • Introduction
                      • Installing the Apache web server with CGI/Perl, PHP, configuring mod_perl, and preparing httpd for a production environment
                      • Adding a secure connection to the Apache web server by creating a self-signed SSL certificate using OpenSSL
                      • Hosting peers by enabling user directories on the Apache web server and troubleshooting suexec
                      • Configuring Apache name-based virtual hosting
                      • Working with publishing directories, vhosts.d, error documents, directives, and the rewrite rule for virtual hosting with the Apache web server
                      • Chapter 11: Working with FTP
                        • Introduction
                        • Building a basic FTP service by installing and configuring VSFTP
                        • Providing a secure connection to VSFTP with SSL/TLS using OpenSSL encryption
                        • Implementing virtual users and directories in standalone mode on VSFTP
                        • Providing an anonymous upload and download or download only FTP server with VSFTP

                        Jonathan Hobson

                        Jonathan Hobson is a web developer, systems engineer, and applications programmer, who, for more than 20 years, has been working behind the scenes to support companies, organizations, and individuals around the world to realize their digital ambitions. With an honors degree in both English and History and as a respected practitioner of many computer languages, Jonathan enjoys writing code, publishing articles, building computers, playing video games, and getting out and about in the big outdoors. He has been using CentOS since its inception and over the years, it has not only earned his trust, but it has become his first choice server solution. CentOS is a first class community-based enterprise class operating system, and it is a pleasure to work with, and because of this Jonathan has written this book in order for his knowledge and experience to be passed on to others.
                        Sorry, we don't have any reviews for this title yet.

                        Submit Errata

                        Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


                        - 5 submitted: last submission 20 Feb 2014

                        Errata type: Typo | Page number: 47 On step 11, a command to run types "ntpq-p" is given in the book, but you are missing a whitespace, the real format should be "ntpq -p".

                        Errata type: Code

                        The book states the command: /sbin/ifconfig | grep -ihwaddr

                        However the command should read: /sbin/ifconfig | grep -ihw addr

                        Errata type: Code

                        Page 78: "passwd your_password_here" should be "passwd your_username_here" which then prompts for a password.

                        Page 146: "vi /etc/rsyslog" should be "vi /etc/rsyslog.conf"

                        Page 147: "service syslog restart" should be "service rsyslog restart"

                        Page 65: " localhostlocalhost.localdomain localhost4" should be " localhost localhost.localdomain localhost4"

                        Page 35: 'yum groupinstall "Desktop" "X Window System" "Fonts" "Desktop Platform" ' should be 'yum -y groupinstall "Desktop" "X Window System" "Fonts" "Desktop Platform" '

                        Page 138: "vi/etc/yum.repos.d/CentOS-Base.repo" should be "vi /etc/yum.repos.d/CentOS-Base.repo"

                        Errata type: Typo

                        Page 79: "we now need to modify its preset conditions in order that members of the wheel group will have access to su." should be "we now need to modify its preset conditions in order that menbers of the wheel group only will have access to su."

                        Errata type: Technical

                        Page 82: The line 'echo "Test Mail" | mail -s "This is a testemail." externalemail@domain.com' won't work until you configure an MTA\email server that excepts forwarding from your shell account. The reader has to wait for chapter 9 to know how to configure Postfix as an MTA to sent email.


                        Errata type: code 

                        Page 44:

                        This should be as follows:
                        hwclock -systohc
                        Page 45:

                        This should be as follows:
                        hwclock -show
                        Page 46:
                        yum install -y install ntpd 
                        This should be as follows:
                        yum install -y install ntp
                        Page: 47 | Bullet points 5 and 6. 
                        Restrict XXX.XXX.XXX.XXX mask YYY.YYY.YYY.YYY nomodifynotrap

                        This should this be as follows:
                        Restrict XXX.XXX.XXX.XXX mask YYY.YYY.YYY.YYY nomodify notrap
                        Page 52:
                        NETMASK= XXX.XXX.XXX.XXX
                        BROADCAST= XXX.XXX.XXX.XXX
                        This should be as follows:
                        Same is the case with commands such as NETMASK, BROADCAST, PREFIX, and HOSTNAME in pages numbers 52, 54, and 56.
                        Page 56:
                        /sbin/ifconfig | grep -ihw addr
                        This should be as follows:

                        /sbin/ifconfig | grep -i hwaddr

                        Errata type: code

                        Page no: 231

                        In how to do it section, step 3, "vi /etc/logrotate.d/dnsmasq" should be as follows:

                        vi /etc/logrotate.d/dnsmasq.conf

                        Errata type: code


                        Page no: 48


                        This should be as follows:

                        ntpq -p


                        Page no: 66 and 68

                        hostname -fqdn

                        This should be as follows:

                        hostname --fqdn


                        Page no: 97 and 98


                        This should be as follows:

                        rotate 7


                        Page no: 99

                        size 500M

                        This should be as follows:

                        size 5M


                        Page no:106

                        chkconfig[servicename] off

                        This should be as follows:

                        chkconfig [servicename] off


                        Page no:110


                        This should be as follows:

                        crontab -e


                        Page no:275

                        vi /etc/dovecot/conf.d/10-mail.conf

                        This should be as follows:

                        vi /etc/dovecot/conf.d/10-auth.conf

                        Page no:297


                        This should be as follows:




                        Errata type: code

                        Page 48: "ntpq-p" should be "ntpq -p"
                        Page 66: "hostname -fqdn" should be "hostname --fqdn"
                        Page 68: "hostname -fqdn" should be "hostname --fqdn"
                        Page 97: "rotate7" should be "rotate 7"
                        Page 98: "rotate7" should be "rotate 7"
                        Page 99: "size 500M" should be "5M"
                        Page 106: "chkconfig[servicename] off" should be "chkconfig [servicename] off"
                        Page 110: "crontab-e" should be "crontab -e"
                        Page 275: "vi /etc/dovecot/conf.d/10-mail.conf" should be "vi /etc/dovecot/conf.d/10-auth.conf"

                        Page 297: "http://XXX.XXX.XXX.XXX/php.php" should be http://XXX.XXX.XXX.XXX/phpinfo.php


                        Errata type: typo
                        Page 335: "for a period of 356 days;" should be "for a period of 365 days;"

                        Sample chapters

                        You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                        Frequently bought together

                        CentOS 6 Linux Server Cookbook +    Advanced Penetration Testing for Highly-Secured Environments: The Ultimate Security Guide =
                        50% Off
                        the second eBook
                        Price for both: $30.59

                        Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                        What you will learn from this book

                        • Installing and validating CentOS 6 and adding a desktop environment
                        • Configuring CentOS to allow you to manage time and multiple IP addresses
                        • Managing log files by using logrotate, memory usage and databases
                        • Managing Packages will show you how to manage the system with the Yum package manager
                        • Administering CentOS through creating new administrative users and creating customized email reports
                        • Securing your shell environment, ascending user privileges and building firewalls to prevent outside attacks
                        • Building networks, domains and implementing the Apache web server.


                        In Detail

                        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.


                        Presented in a step by step, easy to read tutorial style, this book presents the reader with real world solutions to every aspect of CentOS 6.

                        Who this book is for

                        "CentOS 6 Linux Server Cookbook"  is for those professionals, students and enthusiasts who want a down-to-earth or hands-on approach to installing, configuring and running a Centos 6 server. Where a new user may experience this book as a series of solutions, a more experienced user will find a basis on which you can develop your existing skills. So rest assured, there is something for everyone and regardless of your current level of experience, if you are interested in using CentOS 6, then this is the book that offers the insight you need to move forward and master your server.

                        Code Download and Errata
                        Packt Anytime, Anywhere
                        Register Books
                        Print Upgrades
                        eBook Downloads
                        Video Support
                        Contact Us
                        Awards Voting Nominations Previous Winners
                        Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                        Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software