CentOS 5.1 Server Setup: LAMP, Email, DNS, FTP, ISPConfig (a.k.a. The Perfect Server) - Page 2

Now we select the software we want to install. Select nothing but Server (uncheck everything else). Also don't check Packages from CentOS Extras. Then check Customize now, and click on Next:

Now we must select the package groups we want to install. Select Editors, Text-based Internet, Development Libraries, Development Tools, DNS Name Server, FTP Server, Mail Server, MySQL Database, Server Configuration Tools, Web Server, Administration Tools, Base, and System Tools (unselect all other package groups) and click on Next:

The installer checks the dependencies of the selected packages:

Click on Next to start the installation:

The hard drive is being formatted:

The installation begins. This will take a few minutes:

Finally, the installation is complete, and you can remove your CD or DVD from the computer and reboot it:

After the reboot, you will see this screen. Select Firewall configuration and hit Run Tool:

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). Hit OK afterwards:

Then leave the Setup Agent by selecting Exit:

Then log in as root and reboot the system so that your changes can be applied:

shutdown -r now

Now, on to the configuration...

Share this page:

16 Comment(s)

Add comment


From: Richard at: 2009-02-01 10:26:37

Thanks, just moved over to Centos from Windows Server 2003 (I KNOW) and you made it a hell of a lot easier. Thanks man! Now I can start hosting my free online store service :D

From: Nanda at: 2011-01-29 16:00:32

Nice tutorial

From: teddy at: 2009-02-07 18:34:21

[root@teddy ~]# /etc/init.d/proftpd start
Starting proftpd:  - warning: unable to determine IP address of 'teddy'
 - error: no valid servers configured
 - Fatal: error processing configuration file '/etc/proftpd.conf'

what's wrong with my configuration ???

please help me ....

send to my email t.eddy.mi04@gmail.com


From: Anonymous at: 2009-02-12 19:23:54

Seems that you haven't asigned an ip to you network interface, and tries to get an ip trought DHCP with no luck.  You asign ip's in the first page of this tutorial ( http://images.howtoforge.com/images/perfect_server_centos_5.1/10.png ).

From: shytex.com at: 2010-10-13 07:26:08
From: at: 2008-08-04 13:06:11

With CentOS 5.2 the new Bind version is 9.3.4 so the commands to configure it should be modified as:

chmod 755 /var/named/
chmod 775 /var/named/chroot/
chmod 775 /var/named/chroot/var/
chmod 775 /var/named/chroot/var/named/
chmod 775 /var/named/chroot/var/run/
chmod 777 /var/named/chroot/var/run/named/
cd /var/named/chroot/var/named/
ln -s ../../ chroot
cp /usr/share/doc/bind-9.3.4/sample/var/named/named.local /var/named/chroot/var/named/named.local
cp /usr/share/doc/bind-9.3.4/sample/var/named/named.root /var/named/chroot/var/named/named.root
touch /var/named/chroot/etc/named.conf
chkconfig --levels 235 named on
/etc/init.d/named start


From: Jon Pastore at: 2008-11-14 20:53:31

I'm trying to set this up in a VE under open vz.

The /etc/fstab file only contains:

# cat /etc/fstab
none    /dev/pts        devpts  rw      0 0

How do I enable quotas?



From: Anonymous at: 2010-03-04 13:15:10

Dont worry, that package version keeps changing.

While we have CentOS 5.3  the package is 9.3.6 and so on.

From: David at: 2008-12-06 22:10:58

I had to install php-mysql also. Being a newbie to Linux this took a little searching around to find. Might want to add that to the list of things to do for other newbies... Thanks

From: EnKK at: 2008-12-25 10:12:47

On CentOS, there are three root accounts for MySQL:

root@localhost - pass set by the first command

root@server1.example.com - pass set by the second command

root@ - the password for this should be set like

# mysqladmin -h -u root password xxxxxx

Check your accounts:

# mysql -p -u root
mysql> select host,user,password from mysql.user;

From: Anonymous at: 2011-10-12 20:22:37

Far better (IF your doing this for production) is to use the provided command:


Asks you to set a root password / Disable root remote access / Remove test DB / Remove annonymous user

A lot more secure :)



From: Anonymous at: 2009-04-23 05:20:02

What if it does not start?

 trying ::1 ...

connect to address ::1 Connection Refused


From: at: 2008-01-30 13:51:12

Since you are running dovecot, you can eliminate saslauthd all together and run postfix with dovecot sasl. The you run less services and eliminate a service that runs as root (saslauthd).

From: at: 2008-04-20 14:43:38

If you receive the following dovecot error:

dovecot: imap-login: imap-login: error while loading shared libraries: libsepol.so.1: failed to map segment from shared object: Cannot allocate memory

See this link for details: 


It saved me a lot of time!

Thanks, Falko, for the excellent ISPConfig and the how-to!

From: Martin at: 2011-06-07 09:23:57

How To import cert in windows outlook express ?

From: Ton Poppe at: 2010-09-25 07:42:45

Beste falko,

 Ik zag in het script /etc/init.d/proftpd het volgende staan
config: /etc/proftp.conf
moet dit niet zijn??
config: /etc/proftpd.conf

Mvg, Ton