centos下手动安装ispconfig

英文的官方文档,别告诉我你看不懂英语,centos最新版是没有办法安装的 所以用5.5是个不错的选择.

Installation

It is recommended to use a clean (fresh) CentOS 5.4 install. Then follow the steps below to setup your server with ISPConfig 3: Installation of some basic requirements:

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

enable the contrib and centosplus repositories.

1
vi /etc/yum.repos.d/CentOS-Base.repo

Edit the file /etc/yum.repos.d/CentOS-Base.repo and edit the lines below.

1
2
3
4
5
6
7
8
9
10
11
[base]
exclude=postfix
[update]
exclude=postfix
[centosplus]
enabled=1
includepkgs=postfix
[contrib]
enabled=1

rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt cd /tmp wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm rpm -i rpmforge-release-0.5.1-1.el5.rf.i386.rpm yum update

You should disable selinux now, as some programs will not start when selinux is enabled:

1
system-config-securitylevel-tui

then reboot the server. Then remove the postfix without mysql support.

1
yum remove postfix
  1. Install Postfix fron centosplus with mysql support, Dovecot, MySQL, phpMyAdmin with the following command line (on one line!)
1
yum install ntp httpd mysql-server php php-mysql php-mbstring phpMyAdmin postfix getmail

For 32Bit systems:

1
2
rpm -i http://dl.atrpms.net/all/dovecot-1.2.11-3_108.el5.i386.rpm
rpm -i http://dl.atrpms.net/all/dovecot-sieve-0.1.15-4.el5.i386.rpm

For 64Bit Systems:

1
2
3
4
5
6
7
8
9
10
11
12
13
rpm -ivh http://dl.atrpms.net/all/dovecot-1.2.11-3_108.el5.x86_64.rpm
rpm -ivh http://dl.atrpms.net/all/dovecot-sieve-0.1.15-4.el5.x86_64.rpm

chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start
chkconfig --levels 235 httpd on
/etc/init.d/httpd start
chkconfig --levels 235 dovecot on
/etc/init.d/dovecot start
chkconfig --levels 235 sendmail off
chkconfig --levels 235 postfix on
/etc/init.d/sendmail stop
/etc/init.d/postfix start

Set the mysql database password:

1
/usr/bin/mysql_secure_installation
  1. Install Amavisd-new, Spamassassin and Clamav (1 line!)
1
2
3
4
5
6
7
8
yum install amavisd-new spamassassin clamav clamd unzip bzip2 unrar

sa-update
chkconfig --levels 235 amavisd on
chkconfig --levels 235 clamd on
/usr/bin/freshclam
/etc/init.d/amavisd start
/etc/init.d/clamd start

If you use the amavisd from rpmforge (as we do in this guide) and not the one from centos, you will have to do these additional steps:

add the following line in /etc/sysconfig/amavisd:

1
CONFIG_FILE="/etc/amavisd/amavisd.conf

run:

1
2
3
4
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
ln -s /var/run/clamav/clamd.sock /var/spool/amavisd/clamd.sock
yum install perl-DBD-mysql
  1. Install apache, PHP5 and phpmyadmin (1 line!)
1
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 phpmyadmin
  1. Install pure-ftpd and quota
1
2
3
yum install pure-ftpd quota
chkconfig --levels 235 pure-ftpd on
/etc/init.d/pure-ftpd start
  1. Install bind dns server
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
yum install bind-chroot

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.6/sample/var/named/named.local /var/named/chroot/var/named/named.local
cp /usr/share/doc/bind-9.3.6/sample/var/named/named.root /var/named/chroot/var/named/named.root
touch /var/named/chroot/etc/named.conf
touch /var/named/chroot/etc/named.conf.local

vi /var/named/chroot/etc/named.conf

//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
listen-on port 53 { 127.0.0.1; };
listen-on-v6 port 53 { ::1; };
directory "/var/named/chroot/var/named";
dump-file "/var/named/chroot/var/named/data/cache_dump.db";
statistics-file "/var/named/chroot/var/named/data/named_stats.txt";
memstatistics-file "/var/named/chroot/var/named/data/named_mem_stats.txt";
allow-query { localhost; };
recursion yes;
};

logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};

zone "." IN {
type hint;
file "named.root";
};

include "/var/named/chroot/etc/named.conf.local";

chkconfig --levels 235 named on
/etc/init.d/named start
  1. Install vlogger dependencies and webalizer
1
yum install webalizer perl-DateTime-Format-HTTP perl-DateTime-Format-Builder

Installing Jailkit:

1
2
3
4
5
6
7
8
9
10
yum install gcc

cd /tmp
wget http://olivier.sessink.nl/jailkit/jailkit-2.11.tar.gz
tar xvfz jailkit-2.11.tar.gz
cd jailkit-2.11
./configure
make
make install
rm -rf jailkit-2.11*

Edit the file /etc/sudoers:

1
2
3
4
5
6
vi /etc/sudoers

and change the line:
Defaults??? requiretty
to:
# Defaults??? requiretty
  1. Install ISPConfig 3
1
2
3
4
cd /tmp
wget http://www.ispconfig.org/downloads/ISPConfig-3.0.2.tar.gz
tar xvfz ISPConfig-3.0.2.tar.gz
cd ispconfig3_install/install/

Now start the installation process by executing:

1
php -q install.php

The installer will configure all services like postfix, sasl, courier, etc. for you. A manual setup as required for ISPConfig 2 (perfect setup guides) is not necessary. To login to the ISPConfig controlpanel, open the following URL in your browser (replace the IP to match your settings!):

1
http://192.168.0.100:8080/

the default login is:

1
2
user: admin
password: admin

In case you get a permission denied error from apache, please restart the apache webserver process.

Optional: Install a webbased Email Client yum install squirrelmail.