The Perfect Setup - CentOS 5.0 (32-bit)

Version 1.0
Author: Falko Timme
Last edited 04/14/2007

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

I will use the following software:

  • Web Server: Apache 2.2 with PHP 5.1.6
  • Database Server: MySQL 5.0
  • Mail Server: Postfix
  • 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, and if you like you can install the free webhosting control panel ISPConfig (i.e., ISPConfig runs on it out of the box).

I want to say first that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!

 

1 Requirements

To install such a system you will need the following:

 

2 Preliminary Note

In this tutorial I use the hostname server1.example.com with the IP address 192.168.0.100 and the gateway 192.168.0.1. These settings might differ for you, so you have to replace them where appropriate.

 

3 Install The Base System

Boot from your first CentOS 5.0 CD (CD 1). Press <ENTER> at the boot prompt:

It can take a long time to test the installation media so we skip this test here:

The welcome screen of the CentOS installer appears. Click on Next:

Choose your language next:

Select your keyboard layout:

I'm installing CentOS 5.0 on a fresh system, so I answer Yes to the question Would you like to initialize this drive, erasing ALL DATA?

Now we must select a partitioning scheme for our installation. For simplicity's sake I select Remove linux partitions on selected drives and create default layout. This will result in a small /boot and a large / partition as well as a swap partition. Of course, you're free to partition your hard drive however you like it. Then I hit Next:

Answer the following question (Are you sure you want to do this?) with Yes:

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 Use dynamic IP configuration (DHCP) and Enable IPv6 support 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) and a suitable netmask (e.g. 255.255.255.0; if you are not sure about the right values, http://www.subnetmask.info might help you):

Set the hostname manually, e.g. server1.example.com, and enter a gateway (e.g. 192.168.0.1) and up to two DNS servers (e.g. 145.253.2.75 and 193.174.32.18):

Choose your time zone:

Give root a password:

Share this page:

8 Comment(s)

Add comment

Comments

From: TechSpotting at: 2011-08-02 16:29:36

I have written a guide here on how to install CentOS 6 for server or desktops.

 It's for x86_64 some users might find it useful!

From: Mickey Knox at: 2011-12-20 03:25:14

for those who speak spanish (the translation to english is pending), I developed my own bash script to configure CentOS (or Redhat). is my version of the perfect server (post installation).

You can test it here: www.theperfectserver.com.ar

From: Jason Barnett at: 2009-02-08 10:14:43

Hi,

In order to install ncftp I had to add the centos.karan.org using the following commands:

cd /etc/yum.repos.d/

wget http://centos.karan.org/kbsingh-CentOS-Extras.repo

vi kbsingh-CentOS-Extras.repo

change enabled=0 to enabled=1 as follows:

[kbs-CentOS-Testing]
name=CentOS.Karan.Org-EL$releasever - Testing
gpgcheck=1
gpgkey=http://centos.karan.org/RPM-GPG-KEY-karan.org.txt
enabled=1

rpm --import http://centos.karan.org/RPM-GPG-KEY-karan.org.txt

and finally yum install ncftp

From: at: 2007-06-22 16:03:47

If you want to use the chmod in ISPConfig you have to change the lines in "/etc/proftpd.conf":

<Limit SITE_CHMOD>
       DenyAll
</Limit>

into:

 <Limit SITE_CHMOD>
       AllowAll
</Limit>

Yours sincerely mawi 

From: Anonymous at: 2010-10-28 01:14:36

First of all NEVER DO ANYTHING TO THE /TMP DIRECTORY!!!!! I cannot stress this enough. Doing so could damage your install. The OS uses this directory as its workspace.

Second, CentOS now has proftpd on yum, I believe it is on the RPMForge repo.
View how to add this repo HERE.

For those who are security minded and do no click links here you go:

http://wiki.centos.org/AdditionalResources/Repositories/RPMForge

Or just Google for centos RPMForge.

From: koka at: 2009-02-10 21:14:21

thanks :)

it really helpes me configure server

 

regards

From: Anonymous at: 2011-10-05 11:26:34

Thank you

From: John at: 2009-02-23 11:00:08

thanks for the tutorial i have isconfig running now on vmware server - centos 5.0 with webmin to easy manage server.

if you have problem installing message flex run this:

yum install flex

transferring ISPConfig*.tar.gz tru proftpd follow this steps:

http://ubuntuforums.org/showthread.php?t=79588