Getting started with the CentOS 4.4 Single Server CD

Centos

Recently I needed to set up a server with all the usual server components — Web, mail, and file sharing. It needed to be rock-solid and reliable. I didn’t want to download 4GB of software from the Net, so I turned to CentOS’ Single Server CD.

CentOS, which stands for Community ENTerprise Operating System, is an enterprise-focused Linux distribution built from the freely available sources (under the GPL and similar licenses) from Red Hat. CentOS 4 is based on Red Hat Enterprise Linux 4 and supports the x86 (i586 and i686), x86_64 (AMD64 and Intel EMT64), IA64, Alpha, and S390 and S390x architectures.

The Single Server CD contains most of the items required for a basic server set up, but without a GUI. It’s great for those who want a functional install quickly. Also, since there is no memory-hungry GUI, you can run a basic server with just 128MB of RAM, though of course you will need more if you need to deploy large databases.

Centos Server Installation

Installing Single Server CD is straightforward, especially if you have installed other Linux distributions. You need to download the Single Server CD from a local mirror, burn it to a disc, and boot your server from that CD.

Even though the Single Server CD doesn’t contain a GUI, the installation process uses a graphical interface, which means it’s easy to install. Follow the on-screen instructions and the install should be effortless. Tip: If your server doesn’t contain any other data and you are happy to have all the disks reformatted, use the “automatically partition” option when it comes to the Disk Partitioning Setup, as this will save you lots of time.

I suggest disabling SELinux and turning off the firewall, especially if your server is secure inside your local LAN. You can change the firewall settings later if you like with the system-config-securitylevel command.

You can safely choose to install the default software packages. This will give you a basic CentOS system with Web, mail, and FTP servers, DNS, and Windows file sharing via Samba. On a modern machine you should be able to have the server installed in less than 20 minutes.

Not all the packages on the CD are installed. For instance, if you require PostgreSQL, you’ll have to install it later from the disc. To install PostgreSQL, mount the CD-ROM (mount /media/cdrom) and use yum to install the client libraries and the server:

yum localinstall /media/cdrom/CentOS/RPMS/postgresql-7*
yum localinstall /media/cdrom/CentOS/RPMS/postgresql-server-7*

PHP 5 and MySQL 5

The strength of CentOS is its reliability and stability. It is built around proven packages and doesn’t rely on bleeding-edge software. However, there is a disadvantage to this, namely that some of the newest software isn’t installed. The most critical omissions, in my opinion, are PHP 5 and MySQL 5, but these packages are available through the CentOS Plus Repository.

By default CentOS 4.4 comes with PHP 4.3.9. To upgrade to PHP 5, make sure your server is connected to the Internet and run the command:

yum –enablerepo=centosplus upgrade php*

The same goes for MySQL. The default in CentOS 4.4 is MySQL 4.1.20. To upgrade to 5, use the following commands:

yum –enablerepo=centosplus upgrade mysql*
yum –enablerepo=centosplus install mysql-server-5*

Simple administration

Since CentOS 4.4 Single Server CD doesn’t come with a GUI, you need to do all your configuration via the command line. Here are few keys commands and files to help you configure your server.

To start and stop a service use:

service XYZ start
service XYZ stop

Where XYZ is the service name, e.g. postgresql.

To configure the networking run:

netconfig

To configure a printer run:

system-config-printer

By default there are several system services that are not started at boot time, including the Web server and the MySQL server. To ensure that the essential services are started at boot time, run the following commands:

chkconfig –levels 235 httpd on
chkconfig –levels 235 mysql on
chkconfig –levels 235 smb on
chkconfig –levels 235 vsftpd on

If you need POP3 and IMAP services, you need to configure the dovecot daemon. By default, the dovecot daemon provides only IMAP services. If you also want POP3 you must edit /etc/dovecot.conf and put in the line:

protocols = imap imaps pop3 pop3s

Dovecot isn’t started by default either (but is installed as one of the standard packages). To make sure it is started at boot time, type:

chkconfig –levels 235 dovecot on

Once you have everything configured correctly, reboot, not because Linux needs it, but just to be sure that everything comes up and runs as expected.

Conclusion
CentOS is a reliable and robust Linux distribution, and the Single Server CD version is close to perfect for anyone looking for a simple but yet functional server distribution without having to download four or five CDs from the net.

How to set up Centos a 4.4 (4.x) Server

This is a detailed description about how to set up a CentOS 4.4 based server that offers all services needed by ISPs and hosters (web server (SSL-capable), mail server (with SMTP-AUTH and TLS!), DNS server, FTP server, MySQL server, POP3/IMAP, Quota, Firewall, etc.). This tutorial is written for the 32-bit version of CentOS 4.4, but should apply to the 64-bit version with very little modifications as well.

It will use the following software:
Web Server: Apache 2.0.x
Database Server: MySQL 4.1
Mail Server: Postfix (easier to configure than sendmail; has a shorter history of security holes than sendmail)
DNS Server: BIND9 (chrooted!)
FTP Server: proftpd
POP3/IMAP server: dovecot
Webalizer for web site statistics
In the end you should have a system that works reliably.

This is not the only way of setting up such a system. There are many ways of achieving this goal but this is a common way. Requirements

To install such a system you will need the following: Download the 4 CentOS 4.4 CD iso images from a mirror near you (the list of mirrors can be found here: http://www.centos.org/modules/tinycontent/index.php?id=13). You can also find it and other Centos versions at Download Spot You will need a internet connection.

 

 
1 Install Centos Boot from your CentOS 4.4 CD
(CD 1).
Centos
It can take a long time to test the installation media so we skip this
test here: Centos
The welcome screen of the CentOS installer appears. Click on Next: Centos
Choose your language next: Centos
Select your keyboard layout:Centos
We want to install a server so we choose Server here:Centos
Next we do the partitioning. Select Automatically partition unless you
are a advanced user. This will give you a small /boot partition and a
large / partition which is fine for our purposes (I use 1 gig for / 1
gig for /temp 8 gigs for /usr 8 gigs for /var 2 gigs for SWAP and split
the rest with /home and /backup:Centos
I’m installing CentOS 4.4 on a fresh system, so I answer Yes
to the question Would you like to initialize this drive, erasing ALL DATA.Centos
Select Remove all partitions on this system.Centos
We want to remove all Linux partitions, so we answer Yes to the following
question:Centos
The installer presents you an overview of our new partitions. Click
on Next:Centos
Now the boot loader GRUB will be installed. You can leave the default
settings unchanged and click on Next:Centos
On to the network settings. The default setting here is to configure
the network interfaces with DHCP, but we are installing a server, so static
IP addresses are not a bad idea… Click on the Edit button at the top
right. In the window that pops up uncheck Configure using DHCP and give
your network card a static IP address (in this tutorial I’m using the
IP address 192.168.0.100 for demonstration purposes):CentosCentos
Set the hostname manually, e.g. dwhs500.dwhs.net, and enter a gateway
(e.g. 192.168.0.1) and up to three DNS servers (e.g. 145.253.2.75, 193.174.32.18,
and 194.25.0.60) Contact your data center, isp, or set up dns servers
for this:Centos
The default firewall does more harm then good. I would disable it completely
and bypass the warning. There is much better after market firewalls like
csf for free.Centos
Click on Proceed:Centos
Select the default language for the system and add further languages,
if necessary:Centos
Choose your time zone:Centos
Give root a password (do not lose this VERY IMPORTANT):Centos
Now we are to select the package groups we want to install. Select Editors,
Text Based Internet, Server Configuration Tools, Web Server, Mail Server,
DNS Name Server, FTP Server, MySQL Database, Development Tools, Administration
Tools and System Tools and click on Next:Centos
The installer tells you which CDs it will need to install the selected
packagesCentosCentos
The installation begins. This will take a few minutes:Centos
Finally, the installation is complete, and you can remove your CD from
the computer and reboot it:Centos