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
Arrow up icon
GO TO TOP
CentOS 6 Linux Server Cookbook

You're reading from   CentOS 6 Linux Server Cookbook An all-in-one guide to installing, configuring, and running a Centos 6 server. Ideal for newbies and old-hands alike, this practical tutorial ensures you get the best from this popular, enterprise-class free server solution.

Arrow left icon
Product type Paperback
Published in Apr 2013
Publisher Packt
ISBN-13 9781849519021
Length 374 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Jonathan Hobson Jonathan Hobson
Author Profile Icon Jonathan Hobson
Jonathan Hobson
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

CentOS 6 Linux Server Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Installing CentOS 2. Configuring CentOS FREE CHAPTER 3. Working with CentOS 4. Managing Packages with Yum 5. Securing CentOS 6. Working with Samba 7. Working with Domains 8. Working with Databases 9. Providing Mail Services 10. Working with Apache 11. Working with FTP Index

Adding the GNOME desktop environment, changing the runlevel, and installing additional software


In this recipe we will learn how to simplify access to your server by providing you with the option to add the GNOME desktop, change the runlevel in order that the desktop can be seen on boot, and enhance your system with an array of additional software packages typically associated with such an environment.

Adding a desktop environment is not a requirement of running a server and in many respects you can consider this action to be entirely optional. Members of the server community at large may frown with regard to the relevance of this feature, and if you are intending to run a standalone web server or mail server, then there is no reason for needing one, but the reality is, many people do find the practice of running a graphical user interface a welcome addition and in certain circumstances it really can save a huge amount of time depending on the nature and purpose of your server.

Getting ready

To complete this recipe, you will require a minimal installation of the CentOS 6 operating system with root privileges, a console-based text editor of your choice, and a connection to the Internet in order to facilitate the download of additional packages. The system should also have a computer display, a keyboard, and a mouse.

How to do it...

Before we begin, 64-bit users should be aware that the desktop environment will result in your system using a mixture of 32-bit and 64-bit software. This may change over time, but at the time of writing this book, most desktop applications are still 32-bit.

  1. To install the GNOME desktop environment, log in as root and type the following command to install the necessary packages and dependencies:

    yum groupinstall "Desktop" "X Window System" "Fonts" "Desktop Platform"
    
  2. The preceding action will install around 530 MB of packages, but for you to begin using the desktop environment at boot, you will need to change the runlevel. A runlevel is a preset operating state that determines which programs are executed at system startup. In this case, we are intending to execute the desktop environment and to do this, simply open the following configuration file by typing:

    vi /etc/inittab
    
  3. Now scroll down towards the bottom of this file and locate the following line:

    id:3:initdefault:
  4. Change this line to read:

    id:5:initdefault:
  5. Now save your work. But before we finish, it is important to consider the need to add some software in order to enhance your enjoyment of the desktop environment. To do this, return to your console and type:

    yum groupinstall "General Purpose Desktop" "Graphical Administration Tools"
    
  6. Finally, you will need to reboot your computer in order to allow the changes to take immediate effect. To do this, type:

    reboot
    

How it works...

During the course of this recipe, you have not only learned how to install the GNOME desktop environment, but have also successfully reconfigured the runlevel of your server and installed some additional software packages that will enhance your overall enjoyment of CentOS.

So what have we learned from this experience?

We began by installing the GNOME desktop environment by introducing ourselves to the Yum Package Manager's ability to install package groups. Yum is something we will return to later in this book, but in this instance we were required to install all the necessary components needed by a typical desktop, and we achieved this by typing:

yum groupinstall "Desktop" "X Window System" "Fonts" "Desktop Platform"

Having completed this initial step, we were then asked to reconfigure the runlevel of the server in order that the desktop environment would be initiated during the boot process. Without completing this step, the server will continue to boot in console mode.

Note

If you would prefer not to see the desktop at startup, simply leave the current runlevel as is (at level 3), and having accessed your system, you can always type the StartX command to initiate the desktop environment.

As described in this recipe, a runlevel is a preset operating state that determines which programs are executed at system startup. In this case, we are only considering the needs of X Window System and where a console-based server will typically start at runlevel 3, we need to modify this in order to activate the desktop environment that functions at runlevel 5.

To do this, we opened the main configuration file by typing:

vi /etc/inittab

You were then asked to scroll down towards the bottom of this file and find the following line:

id:3:initdefault:

Having found it, you were then asked to replace it with the following:

id:5:initdefault:

Finally, and last but not least, with a desktop environment everyone wants software, and by typing the following command, you were given the opportunity to enhance your system with a variety of tools that would make you feel at home:

yum groupinstall "General Purpose Desktop" "Graphical Administration Tools"

Note

Remember, if you have not created an administrative user (see the appropriate recipe in this book) at this stage, then you should consider running Firstboot (see the appropriate recipe in this chapter) in order to run the desktop setup agent. Without completing either of these steps, you will be required to log in as the root user, which is not advisable for a desktop environment.

To complete this recipe, you were then required to reboot the server and having accessed your desktop environment, you can now navigate to System | Administration | Add/Remove Software to manage new and existing packages.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image