The Perfect Server - CentOS 5.3 x86_64 [ISPConfig 3] - Page 3

4 Adjust /etc/hosts

Next we edit /etc/hosts. Make it look like this:

vi /etc/hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.               localhost.localdomain localhost  server1
::1             localhost6.localdomain6 localhost6


5 Configure Additional IP Addresses

(This section is totally optional. It just shows how to add additional IP addresses to your network interface eth0 if you need more than one IP address. If you're fine with one IP address, you can skip this section.)

Let's assume our network interface is eth0. Then there is a file /etc/sysconfig/network-scripts/ifcfg-eth0 which contains the settings for eth0. We can use this as a sample for our new virtual network interface eth0:0:

cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0

Now we want to use the IP address on the virtual interface eth0:0. Therefore we open the file /etc/sysconfig/network-scripts/ifcfg-eth0:0 and modify it as follows (we can leave out the HWADDR line as it is the same physical network card):

vi /etc/sysconfig/network-scripts/ifcfg-eth0:0

# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)

Afterwards we have to restart the network:

/etc/init.d/network restart

You might also want to adjust /etc/hosts after you have added new IP addresses, although this is not necessary.

Now run


You should now see your new IP address in the output:

[root@server1 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:C2:29:7E
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::20c:29ff:fec2:297e/64 Scope:Link
          RX packets:281 errors:0 dropped:0 overruns:0 frame:0
          TX packets:311 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:26449 (25.8 KiB)  TX bytes:60343 (58.9 KiB)
          Interrupt:177 Base address:0x1400

eth0:0    Link encap:Ethernet  HWaddr 00:0C:29:C2:29:7E
          inet addr:  Bcast:  Mask:
          Interrupt:177 Base address:0x1400

lo        Link encap:Local Loopback
          inet addr:  Mask:
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)

[root@server1 ~]#


6 Disable The Firewall And SELinux

(You can skip this chapter if you have already disabled the firewall and SELinux at the end of the basic system installation (in the Setup Agent).)

I want to install ISPConfig at the end of this tutorial which comes with its own firewall. That's why I disable the default CentOS firewall now. Of course, you are free to leave it on and configure it to your needs (but then you shouldn't use any other firewall later on as it will most probably interfere with the CentOS firewall).

SELinux is a security extension of CentOS that should provide extended security. In my opinion you don't need it to configure a secure system, and it usually causes more problems than advantages (think of it after you have done a week of trouble-shooting because some service wasn't working as expected, and then you find out that everything was ok, only SELinux was causing the problem). Therefore I disable it, too (this is a must if you want to install ISPConfig later on).



Set both Security Level and SELinux to Disabled and hit OK:

Afterwards we must reboot the system:



7 Install Some Software

First we import the GPG keys for software packages:

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*

Then we update our existing packages on the system:

yum update

Now we install some software packages that are needed later on:

yum groupinstall 'Development Tools'

yum groupinstall 'Development Libraries'


8 Quota

(If you have chosen a different partitioning scheme than I did, you must adjust this chapter so that quota applies to the partitions where you need it.)

To install quota, we run this command:

yum install quota

Edit /etc/fstab and add ,usrquota,grpquota to the / partition (/dev/VolGroup00/LogVol00):

vi /etc/fstab

/dev/VolGroup00/LogVol00 /                       ext3    defaults,usrquota,grpquota        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0

Then run

touch /aquota.user /
chmod 600 /aquota.*
mount -o remount /
quotacheck -avugm
quotaon -avug

to enable quota.


9 Install Apache, MySQL, phpMyAdmin

First we enable the RPMforge repository on our CentOS system as lots of the packages that we are going to install in the course of this tutorial are not available in the official CentOS 5.3 repositories:

rpm --import

cd /tmp
rpm -ivh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

(If the above link doesn't work anymore, you can find the current version of rpmforge-release here:

Afterwards we can install the needed packages with one single command (including the packages we need to build Courier-IMAP):

yum install ntp httpd mysql-server php php-mysql php-mbstring php-mcrypt phpmyadmin rpm-build gcc mysql-devel openssl-devel cyrus-sasl-devel pkgconfig zlib-devel pcre-devel openldap-devel postgresql-devel expect libtool-ltdl-devel openldap-servers libtool gdbm-devel pam-devel gamin-devel

Share this page:

18 Comment(s)

Add comment


From: Morris Hong at: 2009-08-25 02:09:22

I am struggling to install mailman after this installation.

Would you recommend any documment for me ?

Thanks in advance !!!

From: Rafael at: 2009-09-30 21:24:48
From: mazarin at: 2009-10-08 20:46:58

My first time ever with linux, took me a whole day to do number 9. As I understand it there are to faults to the above instructions. 1. The "yum priorities" are not installed, that solved my problems. 2. The proper rpmforge-link is not at all found on the urls above. This is what I did: 

yum install yum-priorities

rpm --import

cd /tmp


 Then the long install command. Why have a GUI when installing the perfect-server...

I guess you get what you pay for...

From: Anonymous at: 2009-07-16 13:10:59

the command: yum install getmail doesnt install getmail. Here is the command result:

[root@xxxxx]# yum install getmail
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base:
 * updates:
 * addons:
 * extras:
Setting up Install Process
Parsing package install arguments
No package getmail available.
Nothing to do


I manualy isntalled Getmail from their website, version 3.x - should we install version 3.x or 4.x ???

Some changes needed to the article...

From: Intelec at: 2009-08-03 20:38:48

I found on the installation intructions of another Control Panel, the that there is a repository with the precompiled Courier. You can use these commands to install:

 # wget
# wget
# wget
# sudo rpm -i courier-authlib-*.rpm
# sudo rpm -i courier-authlib-userdb-*.rpm
# sudo rpm -i courier-imap-*.rpm
# sudo groupadd courier -g 3000
# sudo useradd -u 3000 -c 'Courier Mail Server' -d /dev/null -g courier -s /bin/false courier

From: Anonymous at: 2009-11-03 10:06:04

I strongly disagree with what you are trying to pass here as THE perfect setup.

This configuration might work for some time, but is highly UNMAINTAINABLE!

Half of the core packages here are compiled from source, patched or otherwise modified, this is a security nightmare!
Don't tell me that If you install this mess, you will keep on tracking the security issues in all the custom compiled subsystems to keep them up-to-date.

BAD, BAD advise!

From: rct2dotcom at: 2009-09-02 10:41:29

The URL for the source rpms is no longer available.

At the official postfix website, the postfix.spec file is a different format that the one described, thus these postfix build instructions do not work.

Further, the same version of postfix at the official site will not build because it does not recognise the version of 'redHat'. It is for redHat 4 or below.

[The above comments are also true for the HOWTO for CentOs 5.2]

From: Jose at: 2009-07-04 19:32:41


 You explain here the instllation of MyDNS 1.1.0 ( but the newest version is

 Is good the last one or is better to use 1.1.0 from

 Thank you

From: Anonymous at: 2009-10-21 19:53:19

If you are doing this on your local machine it is imperative that you add -p to the second command:

mysqladmin -u root password yourrootsqlpassword
mysqladmin -h -u root password yourrootsqlpassword -p

as you will be actually connecting from the localhost for which you already set the password above.

From: Anonymous at: 2009-09-10 08:05:08

check your /etc/hosts

From: Simon Barrett at: 2009-09-04 23:56:24

This happened for me and I was searching high and low for answers.

 I eventually found out via the "/var/log/httpd/error_log" output (open it in vi) that access was denied to the following file:


 I browsed to that directory but found that the "vlogger" directory did not exist.

I put in the following command: "mkdir /usr/sbin/vlogger" 

I then retried  starting apache with the "/etc/init.d/httpd start" command and it worked.

 I can now browse to the server via HTTP from my client computers again.

 Hope this was helpful

From: at: 2009-09-06 07:35:05

I have jammed in this step:

  • mysqladmin -u root password yourrootsqlpassword
  • mysqladmin -h -u root password yourrootsqlpassword


The first command has successed, but second one has failed as following message:

  • mysqladmin: connect to server at '' failed
  • error: 'Host '' is not allowed to connect to this MySQL server'


Of course, I have replaced the '' with the server name which has been designated in /etc/hosts setup. And my 'rootsqlpassword' also same as the first command.

 Is there anything I missed? and how can I fix it? May I ignore this error and go forward?

From: Anonymous at: 2009-07-30 01:48:44

Hello all..just a remark..followed directions to the far as i can tell..up to suphp everything was fine..then make and make install errors

followed a thread from another forum to get the suphp install to work ok...

then the squirrelmail pretest  failed..I was assuming perhaps ispconfig needed to be in for some additional config items...

then a nice errorless ispconfig install....unfortunatlely  there are issues with ispconfig as well...

I will see if i can debug the items and return to post: )

From: matthewm at: 2009-08-26 21:08:43

yum install mod_suphp

solved suphp prob there are still some errors I am trying to solve though

From: Andywe at: 2009-08-10 13:56:20

The suPHP installation fails and kicks out with error when you go to make it. Please regress and adjust the step for the proper way to build it.


From: uKrease at: 2009-09-12 19:02:55

I wish all tutorials were this precise and to the point.

 Thank you for providing this material, I had my server installed and running in a very short space of time.

 Brilliant !

From: Paul at: 2009-09-02 20:49:34

Superb article. Thanks very much for the lengths you have gone to in order to put this together

From: geld verdienen at: 2010-11-02 14:59:02

Great tutorial, now im still waiting to see if this is better then directadmin.