the perfect server - ubuntu 9.04 [ispconfig 3]

34
The Perfect Server - Ubuntu 9.04 [ISPConfig 3] Version 1.0 Author: Falko Timme <ft [at] falkotimme [dot] com> Last edited 05/03/2009 This tutorial shows how to prepare an Ubuntu 9.04 server for the installation of ISPConfig 3, and how to install ISPConfig 3. ISPConfig 3 is a webhosting control panel that allows you to configure the following services through a web browser: Apache web server, Postfix mail server, MySQL, MyDNS nameserver, PureFTPd, SpamAssassin, ClamAV, and many more. Please note that this setup does not work for ISPConfig 2! It is valid for ISPConfig 3 only! I do not issue any guarantee that this will work for you! 1 Requirements To install such a system you will need the following: the Ubuntu 9.04 server CD, available here: ftp://releases.ubuntu.com/releases/9.04/ubuntu-9.04- server-i386.iso  (i386) or ftp://releases.ubuntu.com/releases/9.04/ubuntu-9.04-server-amd64.iso  (x86_64) a fast Internet connection. 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 The Base System Insert your Ubuntu install CD into your system and boot from it. Select your language: The Perfect Server - Ubuntu 9.04 [ISPConfig 3] Page 1

Upload: wdzg

Post on 16-Nov-2014

1.491 views

Category:

Documents


2 download

DESCRIPTION

Perfect Server Ubuntu 9.04 from www.howtoforge.com

TRANSCRIPT

Page 1: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3]Version 1.0

Author: Falko Timme <ft [at] falkotimme [dot] com> Last edited 05/03/2009

This tutorial shows how to prepare an Ubuntu 9.04 server for the installation of ISPConfig 3, and how to install ISPConfig 3. ISPConfig 3 is a webhosting control panel that allows you to configure the following services through a web browser: Apache web server, Postfix mail server, MySQL, MyDNS nameserver, PureFTPd, SpamAssassin, ClamAV, and many more. 

Please note that this setup does not work for ISPConfig 2! It is valid for ISPConfig 3 only! 

I do not issue any guarantee that this will work for you!

1 RequirementsTo install such a system you will need the following:

• the Ubuntu 9.04 server CD, available here: ftp://releases.ubuntu.com/releases/9.04/ubuntu­9.04­server­i386.iso (i386) or ftp://releases.ubuntu.com/releases/9.04/ubuntu­9.04­server­amd64.iso (x86_64) 

• a fast Internet connection. 

2 Preliminary NoteIn 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 The Base SystemInsert your Ubuntu install CD into your system and boot from it. Select your language:

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 1

Page 2: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

Then select Install Ubuntu Server: 

Choose your language again (?): 

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 2

Page 3: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

Then select your location: 

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 3

Page 4: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

Choose a keyboard layout (you will be asked to press a few keys, and the installer will try to detect your keyboard layout based on the keys you pressed): 

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 4

Page 5: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

The installer checks the installation CD, your hardware, and configures the network with DHCP if there is a DHCP server in the network: 

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 5

Page 6: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

Enter the hostname. In this example, my system is called server1.example.com, so I enter server1: 

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 6

Page 7: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

Now you have to partition your hard disk. For simplicity's sake I select Guided ­ use entire disk and set up LVM ­ this will create one volume group with two logical volumes, one for the / file system and another one for swap (of course, the partitioning is totally up to you ­ if you know what you're doing, you can also set up your partitions manually).

Select the disk that you want to partition:

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 7

Page 8: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

When you're asked Write the changes to disks and configure LVM?, select Yes: 

If you have selected Guided ­ use entire disk and set up LVM, the partitioner will create one big volume group that uses all the disk space. You can now specify how much of that disk space should be used by the logical volumes for / and swap. It makes sense to leave some space unused so that you can later on expand your existing logical volumes or create new ones ­ this gives you more flexibility.

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 8

Page 9: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

When you're finished, hit Yes when you're asked Write the changes to disks?: 

Afterwards, your new partitions are being created and formatted:

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 9

Page 10: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

Now the base system is being installed: 

Create a user, for example the user Administrator with the user name administrator (don't use the user name admin as it is a reserved name on Ubuntu 9.04):

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 10

Page 11: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 11

Page 12: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

I don't need an encrypted private directory, so I choose No here: 

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 12

Page 13: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

Next the package manager apt gets configured. Leave the HTTP proxy line empty unless you're using a proxy server to connect to the Internet:

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 13

Page 14: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

I'm a little bit old­fashioned and like to update my servers manually to have more control, therefore I select No automatic updates. Of course, it's up to you what you select here: 

We need a DNS, mail, and LAMP server, but nevertheless I don't select any of them now because I like to have full control over what gets installed on my system. We will install the needed packages manually later on. The only item I select here is OpenSSH server so that I can immediately connect to the system with an SSH client such as PuTTY after the installation has finished:

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 14

Page 15: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

The installation continues: 

The GRUB boot loader gets installed:

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 15

Page 16: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

The base system installation is now finished. Remove the installation CD from the CD drive and hit Continue to reboot the system:

On to the next step...

4 Get root Privileges After the reboot you can login with your previously created username (e.g. administrator). Because we must run all the steps from this tutorial with root privileges, we can either prepend all commands in this tutorial with the string sudo, or we become root right now by typing

(You can as well enable the root login by running

and giving root a password. You can then directly log in as root, but this is frowned upon by the Ubuntu developers and community for various reasons. See http://ubuntuforums.org/showthread.php?t=765414.)

5 Install The SSH Server (Optional) If you did not install the OpenSSH server during the system installation, you can do it now:

From now on you can use an SSH client such as PuTTY and connect from your workstation to your 

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 16

sudo su 

sudo passwd root

aptitude install ssh openssh­server

Page 17: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

Ubuntu 9.04 server and follow the remaining steps from this tutorial. 

6 Install vim­nox (Optional)I'll use vi as my text editor in this tutorial. The default vi program has some strange behaviour on Ubuntu and Debian; to fix this, we install vim­nox: 

(You don't have to do this if you use a different text editor such as joe or nano.)

7 Configure The NetworkBecause the Ubuntu installer has configured our system to get its network settings via DHCP, we have to change that now because a server should have a static IP address. Edit  /etc/network/interfaces  and adjust it to your needs (in this example setup I will use the IP address 192.168.0.100):

# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).

# The loopback network interfaceauto loiface lo inet loopback

# The primary network interfaceauto eth0iface eth0 inet static

address 192.168.0.100 netmask 255.255.255.0

network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.0.1

Then restart your network:

Then edit /etc/hosts. Make it look like this:

127.0.0.1 localhost.localdomain localhost192.168.0.100 server1.example.com server1

# The following lines are desirable for IPv6 capable hosts::1 localhost ip6-localhost ip6-loopbackfe00::0 ip6-localnetff00::0 ip6-mcastprefixff02::1 ip6-allnodesff02::2 ip6-allroutersff02::3 ip6-allhosts

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 17

aptitude install vim­nox

vi /etc/network/interfaces

/etc/init.d/networking restart

vi /etc/hosts

Page 18: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

Now run

Afterwards, run

Both should show server1.example.com now. 

8 Edit /etc/apt/sources.list And Update Your Linux InstallationEdit /etc/apt/sources.list. Comment out or remove the installation CD from the file and make sure that the universe and multiverse repositories are enabled. It should look like this: 

# deb cdrom:[Ubuntu-Server 9.04 _Jaunty Jackalope_ - Release amd64 (20090421.1)]/ jaunty main restricted

#deb cdrom:[Ubuntu-Server 9.04 _Jaunty Jackalope_ - Release amd64 (20090421.1)]/ jaunty main restricted# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to# newer versions of the distribution.

deb http://de.archive.ubuntu.com/ubuntu/ jaunty main restricteddeb-src http://de.archive.ubuntu.com/ubuntu/ jaunty main restricted

## Major bug fix updates produced after the final release of the## distribution.deb http://de.archive.ubuntu.com/ubuntu/ jaunty-updates main restricteddeb-src http://de.archive.ubuntu.com/ubuntu/ jaunty-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu## team. Also, please note that software in universe WILL NOT receive any## review or updates from the Ubuntu security team.deb http://de.archive.ubuntu.com/ubuntu/ jaunty universedeb-src http://de.archive.ubuntu.com/ubuntu/ jaunty universedeb http://de.archive.ubuntu.com/ubuntu/ jaunty-updates universedeb-src http://de.archive.ubuntu.com/ubuntu/ jaunty-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu## team, and may not be under a free licence. Please satisfy yourself as to## your rights to use the software. Also, please note that software in## multiverse WILL NOT receive any review or updates from the Ubuntu## security team.deb http://de.archive.ubuntu.com/ubuntu/ jaunty multiversedeb-src http://de.archive.ubuntu.com/ubuntu/ jaunty multiversedeb http://de.archive.ubuntu.com/ubuntu/ jaunty-updates multiversedeb-src http://de.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 18

echo server1.example.com > /etc/hostname

e

/etc/init.d/hostname.sh start

hostnamehostname ­f

vi /etc/apt/sources.list

Page 19: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

## Uncomment the following two lines to add software from the 'backports'## repository.## N.B. software from this repository may not have been tested as## extensively as that contained in the main release, although it includes## newer versions of some applications which may provide useful features.## Also, please note that software in backports WILL NOT receive any review## or updates from the Ubuntu security team.# deb http://de.archive.ubuntu.com/ubuntu/ jaunty-backports main restricted universe multiverse# deb-src http://de.archive.ubuntu.com/ubuntu/ jaunty-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's## 'partner' repository.## This software is not part of Ubuntu, but is offered by Canonical and the## respective vendors as a service to Ubuntu users.# deb http://archive.canonical.com/ubuntu jaunty partner# deb-src http://archive.canonical.com/ubuntu jaunty partner

deb http://security.ubuntu.com/ubuntu jaunty-security main restricteddeb-src http://security.ubuntu.com/ubuntu jaunty-security main restricteddeb http://security.ubuntu.com/ubuntu jaunty-security universedeb-src http://security.ubuntu.com/ubuntu jaunty-security universedeb http://security.ubuntu.com/ubuntu jaunty-security multiversedeb-src http://security.ubuntu.com/ubuntu jaunty-security multiverse

Then run

to update the apt package database and

to install the latest updates (if there are any). If you see that a new kernel gets installed as part of the updates, you should reboot the system afterwards:

9 Change The Default Shell/bin/sh is a symlink to /bin/dash, however we need /bin/bash, not /bin/dash. Therefore we do this:

If you don't do this, the ISPConfig installation will fail.

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 19

aptitude update

aptitude safe­upgrade

reboot 

dpkg­reconfigure dashInstall dash as /bin/sh? <­­ No

Page 20: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

10 Disable AppArmorAppArmor is a security extension (similar to SELinux) 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 AppArmor was causing the problem). Therefore I disable it (this is a must if you want to install ISPConfig later on).

We can disable it like this:

11 Synchronize the System ClockIt is a good idea to synchronize the system clock with an NTP (network time protocol) server over the Internet. Simply run 

and your system time will always be in sync. 

12 Install Postfix, Courier, Saslauthd, MySQL, phpMyAdmin, rkhunter, binutilsWe can install Postfix, Courier, Saslauthd, MySQL, phpMyAdmin, rkhunter, and binutils with a single command:

You will be asked the following questions:

We want MySQL to listen on all interfaces, not just localhost, therefore we edit /etc/mysql/my.cnf and comment out the line bind­address = 127.0.0.1:

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 20

/etc/init.d/apparmor stopupdate­rc.d ­f apparmor removeaptitude remove apparmor apparmor­utils

aptitude install ntp ntpdate

aptitude install postfix postfix­mysql postfix­doc mysql­client mysql­server courier­authdaemon courier­authlib­mysql courier­pop courier­pop­ssl courier­imap courier­imap­ssl libsasl2­2 libsasl2­modules libsasl2­modules­sql sasl2­bin libpam­mysql openssl maildrop getmail4 rkhunter binutils 

New password for the MySQL "root" user: <­­ yourrootsqlpasswordRepeat password for the MySQL "root" user: <­­ yourrootsqlpasswordCreate directories for web­based administration? <­­ NoGeneral type of mail configuration: <­­ Internet SiteSystem mail name: <­­ server1.example.comSSL certificate required <­­ Ok 

vi /etc/mysql/my.cnf

Page 21: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

[...]# Instead of skip-networking the default is now to listen only on# localhost which is more compatible and is not less secure.#bind-address = 127.0.0.1[...]

Then we restart MySQL:

Now check that networking is enabled. Run

The output should look like this:

During the installation, the SSL certificates for IMAP­SSL and POP3­SSL are created with the hostname localhost. To change this to the correct hostname (server1.example.com in this tutorial), delete the certificates...

... and modify the following two files; replace CN=localhost with CN=server1.example.com (you can also modify the other values, if necessary):

Then recreate the certificates...

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 21

[...]CN=server1.example.com[...]

[...]CN=server1.example.com[...]

/etc/init.d/mysql restart

netstat ­tap | grep mysql

root@server1:~# netstat ­tap | grep mysqltcp    0   0 *:mysql     *:*      LISTEN      8474/mysqldroot@server1:~#

cd /etc/courierrm ­f /etc/courier/imapd.pemrm ­f /etc/courier/pop3d.pem

vi /etc/courier/imapd.cnf

mkimapdcert mkpop3dcert

vi /etc/courier/pop3d.cnf

Page 22: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

... and restart Courier­IMAP­SSL and Courier­POP3­SSL:

13 Install Amavisd­new, SpamAssassin, And ClamavTo install amavisd­new, SpamAssassin, and ClamAV, we run

14 Install Apache2, PHP5, phpMyAdmin, FCGI, suExec, Pear, And mcrypt Apache2, PHP5, phpMyAdmin, FCGI, suExec, Pear, and mcrypt can be installed as follows: 

 

You will see the following question:

Then run the following command to enable the Apache modules suexec, rewrite, ssl, actions, and include: 

Secure phpMyAdmin by deleting the /etc/phpmyadmin/htpasswd.setup file...

... and remove or comment out the following section in /etc/phpmyadmin/apache.conf:

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 22

/etc/init.d/courier­imap­ssl restart/etc/init.d/courier­pop­ssl restart

aptitude install amavisd­new spamassassin clamav clamav­daemon zoo unzip bzip2 arj nomarch lzop cabextract apt­listchanges libnet­ldap­perl libauthen­sasl­perl clamav­docs daemon libio­string­perl libio­socket­ssl­perl libnet­ident­perl zip libnet­dns­perl 

aptitude install apache2 apache2.2­common apache2­doc apache2­mpm­prefork apache2­utils libexpat1 ssl­cert libapache2­mod­php5 php5 php5­common php5­gd php5­mysql php5­imap phpmyadmin php5­cli php5­cgi libapache2­mod­fcgid apache2­suexec php­pear php­auth php5­mcrypt mcrypt php5­imagick imagemagick libapache2­mod­suphp

a2enmod suexec rewrite ssl actions include

rm ­f /etc/phpmyadmin/htpasswd.setup

vi /etc/phpmyadmin/apache.conf

Web server to reconfigure automatically: <­­ apache2

W

Configure database for phpmyadmin with dbconfig­common? <­­ YesPassword of your database's administrative user: <­­ yourrootsqlpasswordMySQL application password for phpmyadmin: <­­ [blank]

Page 23: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

[...]## Authorize for setup#<Directory /usr/share/phpmyadmin/setup># <IfModule mod_authn_file.c># AuthType Basic# AuthName "phpMyAdmin Setup"# AuthUserFile /etc/phpmyadmin/htpasswd.setup# </IfModule># Require valid-user#</Directory>[...]

Restart Apache afterwards:

15 Install PureFTPd And Quota PureFTPd and quota can be installed with the following command:

Edit the file /etc/default/pure­ftpd­common...

... and make sure that the start mode is set to standalone and set VIRTUALCHROOT=true: 

[...]STANDALONE_OR_INETD=standalone[...]VIRTUALCHROOT=true[...]

Then restart PureFTPd:

Edit /etc/fstab. Mine looks like this (I added ,usrquota,grpquota to the partition with the mount point /): 

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 23

/etc/init.d/apache2 restart

aptitude install pure­ftpd­common pure­ftpd­mysql quota quotatool

vi /etc/default/pure­ftpd­common

/etc/init.d/pure­ftpd­mysql restart

vi /etc/fstab

Page 24: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

# /etc/fstab: static file system information.## Use 'vol_id --uuid' to print the universally unique identifier for a# device; this may be used with UUID= as a more robust way to name devices# that works even if disks are added and removed. See fstab(5).## <file system> <mount point> <type> <options> <dump> <pass>proc /proc proc defaults 0 0# / was on /dev/mapper/server1-root during installationUUID=b8d265bc-5959-404d-a68e-8dc1c76f18d6 / ext3 relatime,errors=remount-ro,usrquota,grpquota 0 1# /boot was on /dev/sda5 during installationUUID=01e9c3c7-2ad0-4f52-a356-18290517b362 /boot ext2 relatime 0 2# swap was on /dev/mapper/server1-swap_1 during installationUUID=c1e0bcbb-5c73-4bd2-a7b2-8beeb7526200 none swap sw 0 0/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0

To enable quota, run these commands:

16 Install MyDNSBefore we install MyDNS, we need to install a few prerequisites:

MyDNS is not available in the Ubuntu 9.04 repositories, therefore we have to build it ourselves as follows:

Next we create the start/stop script for MyDNS: 

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 24

aptitude install g++ libc6 gcc gawk make texinfo libmysqlclient15­dev

vi /etc/init.d/mydns

touch /quota.user /quota.groupchmod 600 /quota.*mount ­o remount /quotacheck ­avugmquotaon ­avug

cd /tmpwget http://heanet.dl.sourceforge.net/sourceforge/mydns­ng/mydns­1.2.8.27.tar.gz

h

tar xvfz mydns­1.2.8.27.tar.gzcd mydns­1.2.8./configuremakemake install

Page 25: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

#! /bin/sh## mydns Start the MyDNS server## Author: Philipp Kern <[email protected]>.# Based upon skeleton 1.9.4 by Miquel van Smoorenburg# <[email protected]> and Ian Murdock <[email protected]>.#

set -e

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/binDAEMON=/usr/local/sbin/mydnsNAME=mydnsDESC="DNS server"

SCRIPTNAME=/etc/init.d/$NAME

# Gracefully exit if the package has been removed.test -x $DAEMON || exit 0

case "$1" in start) echo -n "Starting $DESC: $NAME" start-stop-daemon --start --quiet \ --exec $DAEMON -- -b echo "." ;; stop) echo -n "Stopping $DESC: $NAME" start-stop-daemon --stop --oknodo --quiet \ --exec $DAEMON echo "." ;; reload|force-reload) echo -n "Reloading $DESC configuration..." start-stop-daemon --stop --signal HUP --quiet \ --exec $DAEMON echo "done." ;; restart) echo -n "Restarting $DESC: $NAME" start-stop-daemon --stop --quiet --oknodo \ --exec $DAEMON sleep 1 start-stop-daemon --start --quiet \ --exec $DAEMON -- -b echo "." ;; *) echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 exit 1 ;;esac

exit 0

Then we make the script executable and create the system startup links for it:

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 25

chmod +x /etc/init.d/mydnsupdate­rc.d mydns defaults

Page 26: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

17 Install Vlogger And WebalizerVlogger and webalizer can be installed as follows:

18 Install JailkitJailkit is needed only if you want to chroot SSH users. It can be installed as follows (important: Jailkit must be installed before ISPConfig ­ it cannot be installed afterwards!):

cd /tmpwget http://olivier.sessink.nl/jailkit/jailkit­2.5.tar.gztar xvfz jailkit­2.5.tar.gzcd jailkit­2.5./configuremakemake installcd ..rm ­rf jailkit­2.5*

19 Install fail2banThis is optional but recommended, because the ISPConfig monitor tries to show the fail2ban log:

20 Install SquirrelMailTo install the SquirrelMail webmail client, run

Then create the following symlink...

... and configure SquirrelMail:

We must tell SquirrelMail that we are using Courier­IMAP/­POP3:

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 26

aptitude install vlogger webalizer

aptitude install build­essential autoconf automake1.9 libtool flex bison

aptitude install fail2ban

aptitude install squirrelmail

squirrelmail­configure

ln ­s /usr/share/squirrelmail/ /var/www/webmail

Page 27: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

SquirrelMail Configuration : Read: config.php (1.4.0)­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­Main Menu ­­1.  Organization Preferences2.  Server Settings3.  Folder Defaults4.  General Options5.  Themes6.  Address Books7.  Message of the Day (MOTD)8.  Plugins9.  Database10. Languages

D.  Set pre­defined settings for specific IMAP servers

C   Turn color onS   Save dataQ   Quit

Command >> <­­ D

SquirrelMail Configuration : Read: config.php­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­While we have been building SquirrelMail, we have discovered somepreferences that work better with some servers that don't work sowell with others.  If you select your IMAP server, this option willset some pre­defined settings for that server.

Please note that you will still need to go through and make sureeverything is correct.  This does not change everything.  There areonly a few settings that this will change.

Please select your IMAP server:    bincimap    = Binc IMAP server    courier     = Courier IMAP server    cyrus       = Cyrus IMAP server    dovecot     = Dovecot Secure IMAP server    exchange    = Microsoft Exchange IMAP server    hmailserver = hMailServer    macosx      = Mac OS X Mailserver    mercury32   = Mercury/32    uw          = University of Washington's IMAP server

    quit        = Do not change anythingCommand >> <­­ courier

SquirrelMail Configuration : Read: config.php­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­While we have been building SquirrelMail, we have discovered somepreferences that work better with some servers that don't work sowell with others.  If you select your IMAP server, this option willset some pre­defined settings for that server.

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 27

Page 28: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

Please note that you will still need to go through and make sureeverything is correct.  This does not change everything.  There areonly a few settings that this will change.

Please select your IMAP server:    bincimap    = Binc IMAP server    courier     = Courier IMAP server    cyrus       = Cyrus IMAP server    dovecot     = Dovecot Secure IMAP server    exchange    = Microsoft Exchange IMAP server    hmailserver = hMailServer    macosx      = Mac OS X Mailserver    mercury32   = Mercury/32    uw          = University of Washington's IMAP server

    quit        = Do not change anythingCommand >> courier

              imap_server_type = courier         default_folder_prefix = INBOX.                  trash_folder = Trash                   sent_folder = Sent                  draft_folder = Drafts            show_prefix_option = false          default_sub_of_inbox = falseshow_contain_subfolders_option = false            optional_delimiter = .                 delete_folder = true

Press any key to continue... <­­ ENTER

SquirrelMail Configuration : Read: config.php (1.4.0)­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­Main Menu ­­1.  Organization Preferences2.  Server Settings3.  Folder Defaults4.  General Options5.  Themes6.  Address Books7.  Message of the Day (MOTD)8.  Plugins9.  Database10. Languages

D.  Set pre­defined settings for specific IMAP servers

C   Turn color onS   Save dataQ   Quit

Command >> <­­ S

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 28

Page 29: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

SquirrelMail Configuration : Read: config.php (1.4.0)­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­Main Menu ­­1.  Organization Preferences2.  Server Settings3.  Folder Defaults4.  General Options5.  Themes6.  Address Books7.  Message of the Day (MOTD)8.  Plugins9.  Database10. Languages

D.  Set pre­defined settings for specific IMAP servers

C   Turn color onS   Save dataQ   Quit

Command >> S

Data saved in config.phpPress enter to continue... <­­ ENTER

SquirrelMail Configuration : Read: config.php (1.4.0)­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­Main Menu ­­1.  Organization Preferences2.  Server Settings3.  Folder Defaults4.  General Options5.  Themes6.  Address Books7.  Message of the Day (MOTD)8.  Plugins9.  Database10. Languages

D.  Set pre­defined settings for specific IMAP servers

C   Turn color onS   Save dataQ   Quit

Command >> <­­ Q

Afterwards you can access SquirrelMail under http://server1.example.com/webmail or http://192.168.0.100/webmail:

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 29

Page 30: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

21 Install ISPConfig 3To install ISPConfig 3 from the latest released version, do this:

(Replace ISPConfig­3.0.1.1.tar.gz with the latest version.) 

The next step is to run

 

This will start the ISPConfig 3 installer:

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 30

php ­q install.php

cd /tmpwget http://downloads.sourceforge.net/ispconfig/ISPConfig­3.0.1.1.tar.gz?use_mirror=

=

tar xvfz ISPConfig­3.0.1.1.tar.gzcd ispconfig3_install/install/

root@server1:/tmp/ispconfig3_install/install# php ­q install.php

Page 31: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ _____ ___________   _____              __ _|_   _/  ___| ___ \ /  __ \            / _(_)  | | \ `­­.| |_/ / | /  \/ ___  _ __ | |_ _  __ _  | |  `­­. \  __/  | |    / _ \| '_ \|  _| |/ _` | _| |_/\__/ / |     | \__/\ (_) | | | | | | | (_| | \___/\____/\_|      \____/\___/|_| |_|_| |_|\__, |                                              __/ |                                             |___/­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­

>> Initial configuration

Operating System: Debian Lenny/Sid or compatible

    Following will be a few questions for primary configuration so be careful.    Default values are in [brackets] and can be accepted with <ENTER>.    Tap in "quit" (without the quotes) to stop the installer.

Select language (en,de) [en]: <­­ ENTER

Installation mode (standard,expert) [standard]: <­­ ENTER

Full qualified hostname (FQDN) of the server, eg server1.domain.tld  [server1.example.com]: <­­ ENTER

MySQL server hostname [localhost]: <­­ ENTER

MySQL root username [root]: <­­ ENTER

MySQL root password []: <­­ yourrootsqlpassword

MySQL database to create [dbispconfig]: <­­ ENTER

MySQL charset [utf8]: <­­ ENTER

Generating a 2048 bit RSA private key..............................................................+++..............+++writing new private key to 'smtpd.key'­­­­­You are about to be asked to enter information that will be incorporatedinto your certificate request.What you are about to enter is what is called a Distinguished Name or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value,If you enter '.', the field will be left blank.­­­­­Country Name (2 letter code) [AU]: <­­ ENTERState or Province Name (full name) [Some­State]: <­­ ENTERLocality Name (eg, city) []: <­­ ENTEROrganization Name (eg, company) [Internet Widgits Pty Ltd]: <­­ ENTEROrganizational Unit Name (eg, section) []: <­­ ENTER

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 31

Page 32: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

Common Name (eg, YOUR name) []: <­­ ENTEREmail Address []: <­­ ENTERConfiguring JailkitConfiguring SASLConfiguring PAMConfiguring CourierConfiguring SpamassassinConfiguring AmavisdConfiguring GetmailConfiguring PureftpdConfiguring MyDNSConfiguring ApacheConfiguring FirewallInstalling ISPConfigISPConfig Port [8080]: <­­ ENTER

Configuring DBServerInstalling Crontabno crontab for rootno crontab for getmailRestarting services ... * Stopping MySQL database server mysqld   ...done. * Starting MySQL database server mysqld   ...done. * Checking for corrupt, not cleanly closed and upgrade needing tables. * Stopping Postfix Mail Transport Agent postfix   ...done. * Starting Postfix Mail Transport Agent postfix   ...done. * Stopping SASL Authentication Daemon saslauthd   ...done. * Starting SASL Authentication Daemon saslauthd   ...done.Stopping amavisd: amavisd­new.Starting amavisd: amavisd­new. * Stopping ClamAV daemon clamd   ...done. * Starting ClamAV daemon clamd   ...done. * Stopping Courier authentication services authdaemond   ...done. * Starting Courier authentication services authdaemond   ...done. * Stopping Courier IMAP server...   ...done. * Starting Courier IMAP server...   ...done. * Stopping Courier IMAP­SSL server...   ...done. * Starting Courier IMAP­SSL server...   ...done. * Stopping Courier POP3 server...   ...done.

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 32

Page 33: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

 * Starting Courier POP3 server...   ...done. * Stopping Courier POP3­SSL server...   ...done. * Starting Courier POP3­SSL server...   ...done. * Restarting web server apache2 ... waiting    ...done.Restarting ftp server: Running: /usr/sbin/pure­ftpd­mysql­virtualchroot ­l mysql:/etc/pure­ftpd/db/mysql.conf ­l pam ­A ­E ­b ­u 1000 ­O clf:/var/log/pure­ftpd/transfer.log ­BInstallation completed.

root@server1:/tmp/ispconfig3_install/install#

The installer automatically configures all underlying services, so no manual configuration is needed. 

Afterwards you can access ISPConfig 3 under http://server1.example.com:8080/ or http://192.168.0.100:8080/. Log in with the username admin and the password admin (you should change the default password after your first login):

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 33

Page 34: The Perfect Server - Ubuntu 9.04 [ISPConfig 3]

The system is now ready to be used. 

22 Links

• Ubuntu: http://www.ubuntu.com/ • ISPConfig: http://www.ispconfig.org/ 

The Perfect Server ­ Ubuntu 9.04 [ISPConfig 3] Page 34