The setup is for i386 systems. Do it at your own risk.
Source :
http://www.howtoforge.com/perfect-server-centos-5.2-ispconfig-3-p6
http://www.howtoforge.com/perfect-server-centos-5.4-x86_64-ispconfig-3-p6
1) Requirements
"Download the CentOS 5.x. The list of mirrors can be found here: http://isoredirect.centos.org/centos/5/isos/i386/
"a fast Internet connection.
2) Preliminary Note
In this tutorial I use the hostname server01.nextgvoip.net with a local IP address 192.168.1.228 and the gateway 192.168.1.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.2 CD (CD 1) or the CentOS 5.2 DVD. Press <ENTER> at the boot prompt:

Follow the instructions and 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)
4) Edit /etc/hosts
nano /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.1.228 server01.nextgvoip.net server01
::1 localhost6.localdomain6 localhost6
5) Configure Additional IP Addresses
nano /etc/sysconfig/network-scripts/ifcfg-eth0
[...]
# Intel Corporation 82801CAM (ICH3) PRO/100 VE (LOM) Ethernet Controller
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.1.255
IPADDR=192.168.1.230
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes
[...]
>> Network Restart
/etc/init.d/network restart
6) Disable The Firewall And SELinux
system-config-securitylevel
reboot
7) Install Some Software
rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY*
yum update
yum groupinstall ‘Development Tools’
yum groupinstall ‘Development Libraries’
8) Quota
yum install quota
nano /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
[...]
touch /aquota.user /aquota.group
chmod 600 /aquota.*
mount -o remount /
quotacheck -avugm
quotaon -avug
9) Install Apache, MySQL, phpMyAdmin
rpm –import http://www.nextgvoip.com/perfect-server/RPM-GPG-KEY.dag.txt
cd /tmp
wget http://www.nextgvoip.com/perfect-server/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm -ivh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
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
10) Install Courier-IMAP, Courier-Authlib, And Maildrop
useradd -m -s /bin/bash compileuser
passwd compileuser
visudo
[...]
root ALL=(ALL) ALL
compileuser ALL=(ALL) ALL
[...]
su compileuser
mkdir $HOME/rpm
mkdir $HOME/rpm/SOURCES
mkdir $HOME/rpm/SPECS
mkdir $HOME/rpm/BUILD
mkdir $HOME/rpm/SRPMS
mkdir $HOME/rpm/RPMS
mkdir $HOME/rpm/RPMS/i386
echo “%_topdir $HOME/rpm” >> $HOME/.rpmmacros
cd /tmp
wget http://www.nextgvoip.com/perfect-server/courier-authlib-0.62.1.tar.bz2
wget http://www.nextgvoip.com/perfect-server/courier-imap-4.4.1.tar.bz2
wget http://www.nextgvoip.com/perfect-server/maildrop-2.0.4.tar.bz2
sudo rpmbuild -ta courier-authlib-0.62.1.tar.bz2
cd $HOME/rpm/RPMS/i386
ls -l
>> shows you the available rpm packages:
[compileuser@server1 i386]$ ls -l
total 584
-rw-r–r– 1 root root 140978 Feb 26 03:00 courier-authlib-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 309196 Feb 26 03:00 courier-authlib-debuginfo-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 34672 Feb 26 03:00 courier-authlib-devel-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 17855 Feb 26 03:00 courier-authlib-ldap-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 14048 Feb 26 03:00 courier-authlib-mysql-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 13214 Feb 26 03:00 courier-authlib-pgsql-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 8175 Feb 26 03:00 courier-authlib-pipe-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 35927 Feb 26 03:00 courier-authlib-userdb-0.62.1-1.i386.rpm
[compileuser@server1 i386]$
sudo rpm -ivh courier-authlib-0.62.1-1.i386.rpm courier-authlib-mysql-0.62.1-1.i386.rpm courier-authlib-devel-0.62.1-1.i386.rpm
cd /tmp
rpmbuild -ta courier-imap-4.4.1.tar.bz2
cd $HOME/rpm/RPMS/i386
ls -l
>> shows you the available rpm packages:
[compileuser@server1 i386]$ ls -l
total 1868
-rw-r–r– 1 root root 140978 Feb 26 03:00 courier-authlib-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 309196 Feb 26 03:00 courier-authlib-debuginfo-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 34672 Feb 26 03:00 courier-authlib-devel-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 17855 Feb 26 03:00 courier-authlib-ldap-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 14048 Feb 26 03:00 courier-authlib-mysql-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 13214 Feb 26 03:00 courier-authlib-pgsql-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 8175 Feb 26 03:00 courier-authlib-pipe-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 35927 Feb 26 03:00 courier-authlib-userdb-0.62.1-1.i386.rpm
-rw-rw-r– 1 compileuser compileuser 395137 Feb 26 03:13 courier-imap-4.4.1-1.i386.rpm
-rw-rw-r– 1 compileuser compileuser 906775 Feb 26 03:13 courier-imap-debuginfo-4.4.1-1.i386.rpm
[compileuser@server1 i386]$
sudo rpm -ivh courier-imap-4.4.1-1.i386.rpm
cd /tmp
sudo rpmbuild -ta maildrop-2.0.4.tar.bz2
cd $HOME/rpm/RPMS/i386
ls -l
>> shows you the available rpm packages:
[compileuser@server1 i386]$ ls -l
total 3096
-rw-r–r– 1 root root 140978 Feb 26 03:00 courier-authlib-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 309196 Feb 26 03:00 courier-authlib-debuginfo-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 34672 Feb 26 03:00 courier-authlib-devel-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 17855 Feb 26 03:00 courier-authlib-ldap-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 14048 Feb 26 03:00 courier-authlib-mysql-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 13214 Feb 26 03:00 courier-authlib-pgsql-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 8175 Feb 26 03:00 courier-authlib-pipe-0.62.1-1.i386.rpm
-rw-r–r– 1 root root 35927 Feb 26 03:00 courier-authlib-userdb-0.62.1-1.i386.rpm
-rw-rw-r– 1 compileuser compileuser 395137 Feb 26 03:13 courier-imap-4.4.1-1.i386.rpm
-rw-rw-r– 1 compileuser compileuser 906775 Feb 26 03:13 courier-imap-debuginfo-4.4.1-1.i386.rpm
-rw-r–r– 1 root root 303104 Feb 26 03:25 maildrop-2.0.4-1.i386.rpm
-rw-r–r– 1 root root 739326 Feb 26 03:25 maildrop-debuginfo-2.0.4-1.i386.rpm
-rw-r–r– 1 root root 134387 Feb 26 03:25 maildrop-devel-2.0.4-1.i386.rpm
-rw-r–r– 1 root root 58837 Feb 26 03:25 maildrop-man-2.0.4-1.i386.rpm
[compileuser@server1 i386]$
sudo rpm -ivh maildrop-2.0.4-1.i386.rpm
exit
11) Apply Quota Patch To Postfix
cd /usr/src
wget http://www.nextgvoip.com/perfect-server/postfix-2.3.3-2.src.rpm
rpm -ivh postfix-2.3.3-2.src.rpm
>> The last command will show some warnings that you can ignore:
warning: user mockbuild does not exist – using root
warning: group mockbuild does not exist – using root
cd /usr/src/redhat/SOURCES
wget http://www.nextgvoip.com/perfect-server/postfix-2.3.3-vda.patch.gz
gunzip postfix-2.3.3-vda.patch.gz
cd /usr/src/redhat/SPECS/
nano postfix.spec
[...]
%define MYSQL 1
[...]
# Patches
Patch0: postfix-2.3.3-vda.patch
Patch1: postfix-2.1.1-config.patch
Patch3: postfix-alternatives.patch
Patch6: postfix-2.1.1-obsolete.patch
Patch7: postfix-2.1.5-aliases.patch
Patch8: postfix-large-fs.patch
Patch9: postfix-2.2.5-cyrus.patch
[...]
%setup -q
# Apply obligatory patches
%patch0 -p1 -b .vda
%patch1 -p1 -b .config
%patch3 -p1 -b .alternatives
%patch6 -p1 -b .obsolete
%patch7 -p1 -b .aliases
%patch8 -p1 -b .large-fs
%patch9 -p1 -b .cyrus
[...]
rpmbuild -ba postfix.spec
cd /usr/src/redhat/RPMS/i386
ls -l
>> shows you the available packages:
[root@server1 i386]# ls -l
total 11292
-rw-r–r– 1 root root 3820393 Feb 27 18:16 postfix-2.3.3-2.i386.rpm
-rw-r–r– 1 root root 7666204 Feb 27 18:16 postfix-debuginfo-2.3.3-2.i386.rpm
-rw-r–r– 1 root root 50539 Feb 27 18:16 postfix-pflogsumm-2.3.3-2.i386.rpm
[root@server1 i386]#
rpm -ivh postfix-2.3.3-2.i386.rpm
chkconfig –levels 235 courier-authlib on
/etc/init.d/courier-authlib start
chkconfig –levels 235 sendmail off
chkconfig –levels 235 postfix on
chkconfig –levels 235 saslauthd on
/etc/init.d/sendmail stop
/etc/init.d/postfix start
/etc/init.d/saslauthd start
12) Configure Courier
chkconfig –levels 235 courier-imap on
/etc/init.d/courier-authlib restart
/etc/init.d/courier-imap restart
cd /usr/lib/courier-imap/share/
rm -f imapd.pem
rm -f pop3d.pem
nano /usr/lib/courier-imap/etc/imapd.cnf
[...]
CN=server1.example.com
[...]
nano /usr/lib/courier-imap/etc/pop3d.cnf
[...]
CN=server1.example.com
[...]
./mkimapdcert
./mkpop3dcert
/etc/init.d/courier-authlib restart
/etc/init.d/courier-imap restart
13) Install Getmail
yum install getmail
14) Set MySQL Passwords And Configure phpMyAdmin
chkconfig –levels 235 mysqld on
/etc/init.d/mysqld start
mysqladmin -u root password yourrootsqlpassword
mysqladmin -h server01.nextgvoip.net -u root password yourrootsqlpassword
nano /etc/httpd/conf.d/phpmyadmin.conf
[...]
#
# Web application to manage MySQL
#
#<Directory “/usr/share/phpmyadmin”>
# Order Deny,Allow
# Deny from all
# Allow from 127.0.0.1
#</Directory>
Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin
[...]
nano /usr/share/phpmyadmin/config.inc.php
[...]
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = ‘http’;
[...]
chkconfig –levels 235 httpd on
/etc/init.d/httpd start
>> http://192.168.1.228/phpmyadmin/
15) Install Amavisd-new, SpamAssassin And ClamAV
yum install amavisd-new spamassassin clamav clamd unzip bzip2 unrar perl-DBD-mysql
chkconfig –levels 235 amavisd on
chkconfig –levels 235 clamd on
/usr/bin/freshclam
/etc/init.d/amavisd start
/etc/init.d/clamd start
mkdir /var/run/amavisd /var/spool/amavisd /var/spool/amavisd/tmp /var/spool/amavisd/db
chown amavis /var/run/amavisd /var/spool/amavisd /var/spool/amavisd/tmp /var/spool/amavisd/db
16) Installing Apache2 With mod_php, mod_fcgi/PHP5, And suPHP
cd /etc/yum.repos.d/
wget http://centos.karan.org/kbsingh-CentOS-Extras.repo
nano /etc/yum.repos.d/kbsingh-CentOS-Extras.repo
[...]
[kbs-CentOS-Testing]
name=CentOS.Karan.Org-EL$releasever – Testing
gpgcheck=0
gpgkey=http://centos.karan.org/RPM-GPG-KEY-karan.org.txt
enabled=1
baseurl=http://centos.karan.org/el$releasever/extras/testing/$basearch/RPMS/
[...]
yum install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-eaccelerator php-mbstring php-mcrypt php-mhash php-mssql php-snmp php-soap php-tidy curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel mod_fcgid php-cli httpd-devel
nano /etc/php.ini
[...]
;error_reporting = E_ALL
error_reporting = E_ALL & ~E_NOTICE
[...]
cgi.fix_pathinfo = 1
cd /tmp
wget http://www.nextgvoip.com/perfect-server/suphp-0.7.0.tar.gz
tar xvfz suphp-0.7.0.tar.gz
cd suphp-0.7.0/
./configure –prefix=/usr –sysconfdir=/etc –with-apr=/usr/bin/apr-1-config –with-apxs=/usr/sbin/apxs –with-apache-user=apache –with-setid-mode=owner –with-php=/usr/bin/php-cgi –with-logfile=/var/log/httpd/suphp_log –enable-SUPHP_USE_USERGROUP=yes
make
make install
nano /etc/httpd/conf.d/suphp.conf
[...]
LoadModule suphp_module modules/mod_suphp.so
[...]
nano /etc/suphp.conf
[...]
[global]
;Path to logfile
logfile=/var/log/httpd/suphp.log
;Loglevel
loglevel=info
;User Apache is running as
webserver_user=apache
;Path all scripts have to be in
docroot=/
;Path to chroot() to before executing script
;chroot=/mychroot
; Security options
allow_file_group_writeable=true
allow_file_others_writeable=false
allow_directory_group_writeable=true
allow_directory_others_writeable=false
;Check wheter script is within DOCUMENT_ROOT
check_vhost_docroot=true
;Send minor error messages to browser
errors_to_browser=false
;PATH environment variable
env_path=/bin:/usr/bin
;Umask to set, specify in octal notation
umask=0077
; Minimum UID
min_uid=100
; Minimum GID
min_gid=100
[handlers]
;Handler for php-scripts
x-httpd-suphp=”php:/usr/bin/php-cgi”
;Handler for CGI-scripts
x-suphp-cgi=”execute:!self”
[...]
/etc/init.d/httpd restart
17) Install PureFTPd
rpm -ivh http://www.nextgvoip.com/perfect-server/pure-ftpd-1.0.21-15.el5.kb.i386.rpm
ln -s /usr/local/sbin/proftpd /usr/sbin/pr
18) Install MyDNS
wget http://www.nextgvoip.com/perfect-server/mydns-mysql-1.1.0-1.i386.rpm
rpm -ivh mydns-mysql-1.1.0-1.i386.rpm
nano /etc/init.d/mydns
[...]
# chkconfig: 345 65 50
[...]
chkconfig –levels 235 mydns on
19) Install Vlogger And Webalizer
yum install webalizer perl-DateTime-Format-HTTP perl-DateTime-Format-Builder
cd /tmp
wget http://www.nextgvoip.com/perfect-server/vlogger-1.3.tar.gz
tar xvfz vlogger-1.3.tar.gz
mv vlogger-1.3/vlogger /usr/sbin/
rm -rf vlogger*
20) Install Jailkit
cd /tmp
wget http://www.nextgvoip.com/perfect-server/jailkit-2.5.tar.gz
tar xvfz jailkit-2.5.tar.gz
cd jailkit-2.5
./configure
make
make install
rm -rf jailkit-2.5*
21) Install fail2ban
yum install fail2ban
chkconfig –levels 235 fail2ban on
/etc/init.d/fail2ban start
22) Install rkhunter
yum install rkhunter
23) Install SquirrelMail
yum install squirrelmail
/etc/init.d/httpd restart
/usr/share/squirrelmail/config/conf.pl
>> IMAP Command >> <– courier
nano /etc/squirrelmail/config_local.php
[...]
//$default_folder_prefix = ”;
[...]
>> test Squirrelmail https://192.168.1.228/webmail/src/configtest.php
>> login Squirrelmail https://192.168.1.228/webmail
24) Install ISPConfig 3
yum remove bind dovecot
cd /tmp
wget http://www.nextgvoip.com/perfect-server/ISPConfig-3-stable.tar.gz
tar xfz ISPConfig-3-stable.tar.gz
cd ispconfig3_install/install/
php -q install.php
php -q update.php
>> login ISPCONFIG http://192.168.1.228:8080
25) Port Forward