The following section provides step-by-step instructions to install and perform a base configuration of a CentOS 5 server.
We will start with a bare server and build it to the point where it can be remotely managed and configured for a specific purpose and application stack.
The reference SME for this how-to is a single office SMB with less than 100 employees. All different departments function in the single location. A limited number of staff require regular access to information and services remotely. Microsoft Windows desktops and laptops are networked over a wired ethernet network. Several meeting spaces have wireless networks available. Internet connection is provided by a single 512 KB ADSL link. An external service provider hosts the SME's internet presence and e-commerce activity.
Howto follows a cook-book format.
While it will create a functional senvironment, this should only be your starting point. It is unwise to operate infrastructure key to your business if you do not really understand how it works or the implications of the settings that have been made.
Our base philosophy is to only install the applications that we need on a server. This approach requires more work upfront. However avoiding unused, unwanted and unnecessary applications lowers operational requirements and minimizes vulnerability to security holes in applications. See Linux Management Best Practices.
Note: Install created on a MacBook using Parallels Desktop






As a final step we will be building a kickstart file to use in future installations. The base kickstart is found at /root/anaconda-ks.cfg Select Next This should require CentOS CD #1 (CentOS DVD). It will take a number of minutes to complete the base install. Note: The kickstart file for this configuration will be made available for download. Following the base install you will need to re-boot your server to complete the install.
Congratulations, you have a minimally configured CentOS system.
At every restart CentOS provides the ability to edit basic system services (Authentication, Firewall, Network & System Services)
Allows you to configure authentication model - local passwords, WinBind, ldap, etc.
Note: in the future we will be experimenting with WinBind. Windows Active Directory is ubiquitous, and since 2003 RC it has included basic UNIX LDAP services. We are encouraged to see Winbind provided out of the box.
The firewall will be configured and set elsewhere. The base configuration has the IPtables firewall configured and limiting connections to TCP port 22. This is a responsible setting, however it prevents use of Webmin. Select the Firewall option and disable. We also disable SELinux (in part becuase so many of our CentOS/Red Hat systems run Oracle and Oracle requires this, in part becuase we are conservative and have not established an operation practice for SELinux)
Allows you to reconfigure Network services.
Allows you to enable or disable system services at boot.
NEVER login as Root. Always login as a user with less privileges. The fewer privileges your account has the less likely you will cause inadvertent damage. If more than one person administers a server provide accounts for administration do not share the sysadmin account. In many SMB's the system administrator will also be a normal user. In this case use the sysadmin account for administration and the personal account for normal-day-to-day use of the system.
No other accounts have been created so the next section must be performed as Root
.
As an alternative you can logon to you server through SSH. We will disable direct logon by root in this configuration section.
The mainstream installing/uninstalling/updating tool in CentOS is YUM (Up2Date is also installed and supported). YUM is an adequate text-based update tool that you will have to learn to manage a CentOS server. Once Webmin is installed YUM is used through Webmin's graphical interface. For a detailed How-to on Yum see this link.
Note: The best over-all update tool is Mandriva's. It clearly tells you which applications are being ungraded because of security-fix, bug-fix or enhancement and enables adding new applications at the same time. The closest available on CentOS is Webmin's Software module and YUM for updates - which are used in this How-to. Note: Often running Yum update will result in a prompt asking if you want to install the CentOS GPG key. However, in our experience this doesn't occur on all releases.
The GPG Key helps ensure that only trusted sources for applications can be used on your system. If you would not like this key to be automatically installed you can do this step manually.
Enter:
rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
Next perform a basic update. This initial update helps ensure Yum itself is up-to-date and the Centos Yum configuration is up-to-date. This update will also highlight applications that were installed that you don't want.
Use the initial YUM update to review applications that are installed that you are not interested in installing. If the update identifies an application you do not need (gaim, blue-tooth, wireless services, etc.) stop the update and uninstall that application.
Note theunwanted applications and adjust bith your Technical Architecture for your CentOS servers and your kick-start file.
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
kernel i686 2.6.18-8.1.1.el5 updates 12 M
Updating:
Deployment_Guide-en-US noarch 5.0.0-21.el5.centos updates 7.3 M
autofs i386 1:5.0.1-0.rc2.43.0.2 updates 760 k
bind-libs i386 30:9.3.3-8.el5 updates 834 k
bind-utils i386 30:9.3.3-8.el5 updates 162 k
dhclient i386 12:3.0.5-5.el5 updates 274 k
file i386 4.17-9 updates 320 k
gnupg i386 1.4.5-13 updates 1.8 M
kernel-headers i386 2.6.18-8.1.1.el5 updates 724 k
krb5-libs i386 1.5-23 updates 593 k
krb5-workstation i386 1.5-23 updates 894 k
libgcc i386 4.1.1-52.el5.2 updates 82 k
libstdc++ i386 4.1.1-52.el5.2 updates 350 k
module-init-tools i386 3.3-0.pre3.1.16.0.1.el5 updates 411 k
nss i386 3.11.5-3.el5.centos updates 799 k
nss-tools i386 3.11.5-3.el5.centos updates 650 k
tzdata noarch 2007d-1.el5 updates 746 k
Transaction Summary
=============================================================================
Install 1 Package(s)
Update 16 Package(s)
Remove 0 Package(s)
Total download size: 29 M
The first update we performed found the highlighted Deployment Guide in need of an update. Decided we didn't want the Deployment Guide on every server.
Enter
yum remove Deployment_Guide-en-US
Enter:
yum remove finger gaim cups-libs cups bluez-libs desktop-file-utils
Note: Finger should only be installed if you have a good reason, gaim is unnecessary on a server and print managment should only be there if you want it. Removing this list also removes the blue-tooth utilities (I'm sure someone has a good reason for blue-tooth on their headless remotely managed servers, we don't)
Other applications we'd rather not have, such as wireless-tools, are required dependencies of other applications we'd like to have.
yum install postfix
yum remove sendmail
Note: You must install PostFix before removing Sendmail. Your system needs an MTA and sendmail is the default.
Enter
more /root/install.log
Review the list and make your choices. Remember to update your kickstart-file.
Webmin is a web-based graphical LINUX/UNIX system administration tool developed by Jamie Cameron. Webmin is a lightweight, functional, and easily extensible. Using any browser that supports tables and forms, you can perform normal system administration (setup user accounts, DNS, file sharing, etc.).
Best operational practices use auditable tools to manage configuration - Webmin provides a solid tool. The use of a tool avoids the need to remember the details of every configuration file - where the graphical interface is a barrier Webmin provides direct access to the configuration files.
As a rule we reccomend limiting the use of applications to those drawn from an established repository. For Webmin we do not follow this guideline and recommend going direct to the developer.
www.linuxjunkies.org/adminstration%20Howto/webminguide/book1.htm
webmin.com
The first step is to install Webmin using Curl. Webmin uses Sourceforge so the URL will change. Look at the Webmin website for a download slink.
You can save the Webmin RPM to the RPM repository, or simply save in Roots directory. We save in Root's home, then delete.
Enter
curl -o (name of file to save to) (url of file)
Enter
curl -o webmin-1.330-1.noarch.rpm
http://umn.dl.sourceforge.net/sourceforge/webadmin/webmin-1.330-1.noarch.rpm
While we are still installing tools from the command line it is a good idea to install perl-Net-SSLeay. This package is required for Webmin to use SSL.
Enter
yum install perl-Net-SSLeay
With Webmin's RPM saved in Root's home directory the next step is to install Webmin, then delete the RPM to clean-up.
Enter:
rpm -Uvh webmin-1.330-1.noarch.rpm
After a successful install enter:
rm webmin-1.330-1.noarch.rpm
With Webmin's install complete and Webmin started you can now login to https://centos5.limestone.lan:10000/
Note: you may need to change the hostname to IP address if you are using DHCP, or do not have DNS configured for your new server.
Again, you will have to login as root. This will be the last time we directly connect as root.

Note: We prefer the old MSC.Linux theme.
We will need to fix a number of things:
Note: If you started with perl-NET-SSLeay installed SSL is automatically enabled. Then simply follow the directions to re-route all http traffic to https.
Encrypting administrative traffic, and user names/password combinations, is simply a good idea.
Webmin's default port 10000 often requires changes to firewalls for access. We tend to switch to 443 to enable access from wherever we are.
Webmin's default logging is fairly good. However, we have the option of extending the logging to allow for configuration roll-backs. It isn't perfect, but any opportunity we have to undo a mistake is a good thing.
Note: Without selecting the time-based rollback we will need to rotate Webmin's log on a regular basic.
By default CentOS 5 allows SSH login by Root. This is necessary for remote installation, but is poor operational practice (anti-pattern).
If your system is in an exposed location it is a good idea to use the SSH network configuration to limit the network locations that can SSH to the server. We will also use the firewall to limit this - security for exposed systems isn't so much 'belt & suspenders' as 'belt, suspenders, wellingtons, 'Nor-wester, PFD, North Atlantic immersion suite, & satellite phone'
Webmin has been compromised in the past. A system we maintain was compromised through the Webmin Usermin Arbitrary File Disclosure Vulnerability (July 2006) that affected versions 1.28 and below. The system that was exploited was not running a current version of Webmin. We were not monitoring Webmin's site- rather using Webmin provided as an RPM from a repository. Unfortunately, between the exploit and the update of the repository we were exploited.
Note: Best security practice is to stay on top of patching your system. In addition to limit packes used to those from responsible maintained repositories subscribe to the Announce List of applications you install.
Before going any create a Configuration baseline and set a regular back-up of Webmin Configuration.
It is always a very good idea to maintain a back-up of your system configuration files. Most applications maintain their configuration files where they belong in /etc.
This provides you with a baseline of /etc and a daily back-up. If you ae making a number of changes we recommend returning to this module and manually taking a back-up before the changes are made. Being able to quickly return to a stable functioning system is the basic requirement of ITIL-based change management best practice.
At this point we have a basic system installed & configured. We have provided minumal security, but must still protect this sytem with basic perimeter security.
The base of our Linux Operational best practices is to dramatically limit the applications installed to the applications that are used.
All of our servers share a common base-build, and diverge only for the additional applications to support their purpose.
We strongly recommend dramatically limiting the source of applications.
There are two repositories we use - CentOS Extras and the Third Party RPMForge (an expansion built upon Dag Wieers's RHEL Repository and Matthias Saou's FreshRPMS). RPMForge's principles support best-practice operations (1. don't replace base libraries or important core packages for repositories that are not EOL. 2. Everything is open. SPEC files are provided. 3. Active Bug-fix - either dedicated fix, implementation of provided bug-fix and most importantly, upstream bug-fix. 4. huge user-base that provide useful feedback)
Enter
rpm -Uhv http://apt.sw.be/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
This section will outline some basic CentOS management and operational practices.
All computer systems lose or gain time. The Network Time Protocol (NTP) is used to synchronize the time of a computer to another server or reference time source. While the NTP can provide millisecond level accuracy we suggest you understand what problem you are trying to solve. Is it more important that your environment be consistent or correct? Most sites need consistency more than correctness.
Webmin provides a simple toolset for synchronizing your system time with a NTP time server.
At the time you specified this cron-job will connect to the time server specified and update the server's clock.
Note: Implementation of a complete NTP server is beyond the scope of this how-to. If you choose to set-up a NTP server we recommend you consider offering your server to the the pool.ntp.org project.
Joining the NTP pool is a long term commitment. Personally, if you can competently run a server, have a static IP and can afford 30 Kbit/s we think you should join the pool - as an open source consumer a question to ask is 'what is your contribution to the open source community'? (Hornford Associates' contribution: In addition to these cookbook how-tos we provide ~200 Kb/s to the Debian & CentOS media bittorrents)
Bittorrent
CentOS 5 CD-ROM #1 - #6 Bittorrent download
CentOS 5 DVD Bittorrent download
This kickstart file matches the How-to's CentOS 5 basic installation.
Kickstart File
![]()
This work (kickstart file) is licensed under a
Creative Commons Attribution 2.5 Canada License.