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