Install The SSH Server (Optional)
Install The SSH Server (Optional)
Install The SSH Server (Optional)
If you did not install the OpenSSH server during the system installation, you can do it now: aptitude install ssh openssh-server
Then restart your network: /etc/init.d/networking restart Then edit /etc/hosts. Make it look like this: vi /etc/hosts
127.0.0.1 192.168.0.100 localhost.localdomain server1.example.com localhost server1
# The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters
Now run echo server1.example.com > /etc/hostname /etc/init.d/hostname restart Afterwards, run hostname hostname - f
Then run aptitude update to update the apt package database and aptitude safe- upgrade 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: reboot
Disable AppArmor
AppArmor 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: /etc/init.d/apparmor stop update-rc.d -f apparmor remove aptitude remove apparmor apparmor- utils
We can install Postfix, Courier, Saslauthd, MySQL, rkhunter, and binutils with a single command: 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 getmail4 rkhunter binutils maildrop You will be asked the following questions: New password for the MySQL "root" user: <-- yourrootsqlpassword Repeat password for the MySQL "root" user: <-- yourrootsqlpassword Create directories for web-based administration? <-- No General type of mail configuration: <-- Internet Site System mail name: <-- server1.example.com SSL certificate required <-- Ok 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: vi /etc/mysql/my.cnf
[...] # 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: /etc/init.d/mysql restart Now check that networking is enabled. Run netstat -tap | grep mysql The output should look like this:
LISTEN
9732/mysqld
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... cd /etc/courier rm -f /etc/courier/imapd.pem rm -f /etc/courier/pop3d.pem ... and modify the following two files; replace CN=localhost with CN=server1.example.com (you can also modify the other values, if necessary): vi /etc/courier/imapd.cnf
[...] CN=server1.example.com [...]
vi /etc/courier/pop3d.cnf
[...] CN=server1.example.com [...]
Then recreate the certificates... mkimapdcert mkpop3dcert ... and restart Courier-IMAP-SSL and Courier-POP3-SSL: /etc/init.d/courier-imap-ssl restart /etc/init.d/courier-pop-ssl restart
[...]
Then restart PureFTPd: /etc/init.d/pure-ftpd- mysql restart Edit /etc/fstab. Mine looks like this (I added ,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 to the partition with the mount point /): vi /etc/fstab
# /etc/fstab: static file system information. # # Use 'blkid -o value -s 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 nodev,noexec,nosuid 0 0 /dev/mapper/server1-root / ext4 errors=remountro,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 0 1 # /boot was on /dev/sda1 during installation UUID=9eef7b6b-5688-456c-8fe2-05ae739e3635 /boot ext2 defaults 0 2 /dev/mapper/server1-swap_1 none swap sw 0 0 /dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
To enable quota, run these commands: touch /aquota.user /aquota.group chmod 600 /aquota.* mount -o remount / quotacheck -avugm quotaon -avug
Install Jailkit
Jailkit 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!): aptitude install build-essential autoconf automake1.9 libtool flex bison debhelper cd /tmp wget http://olivier.sessink.nl/jailkit/jailkit-2.11.tar.gz tar xvfz jailkit-2.11.tar.gz cd jailkit-2.11 ./debian/rules binary cd .. dpkg - i jailkit_2.11-1_*.deb rm -rf jailkit-2.11*
Install fail2ban
This is optional but recommended, because the ISPConfig monitor tries to show the fail2ban log: aptitude install fail2ban
Install SquirrelMail
To install the SquirrelMail webmail client, run aptitude install squirrelmail Then create the following symlink...
ln -s /usr/share/squirrelmail/ /var/www/webmail ... and configure SquirrelMail: squirrelmail-configure We must tell SquirrelMail that we are using Courier-IMAP/-POP3: SquirrelMail Configuration : Read: config.php (1.4.0) --------------------------------------------------------Main Menu -1. Organization Preferences 2. Server Settings 3. Folder Defaults 4. General Options 5. Themes 6. Address Books 7. Message of the Day (MOTD) 8. Plugins 9. Database 10. Languages D. Set pre-defined settings for specific IMAP servers C Turn color on S Save data Q Quit Command >> <-- D
SquirrelMail Configuration : Read: config.php --------------------------------------------------------While we have been building SquirrelMail, we have discovered some preferences that work better with some servers that don't work so well with others. If you select your IMAP server, this option will set some pre-defined settings for that server. Please note that you will still need to go through and make sure everything is correct. This does not change everything. There are only 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 gmail = IMAP access to Google mail (Gmail) accounts quit = Do not change anything Command >> <-- courier
SquirrelMail Configuration : Read: config.php --------------------------------------------------------While we have been building SquirrelMail, we have discovered some preferences that work better with some servers that don't work so well with others. If you select your IMAP server, this option will set some pre-defined settings for that server. Please note that you will still need to go through and make sure everything is correct. This does not change everything. There are only 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 anything Command >> 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 = false show_contain_subfolders_option = false optional_delimiter = .
SquirrelMail Configuration : Read: config.php (1.4.0) --------------------------------------------------------Main Menu -1. Organization Preferences 2. Server Settings 3. Folder Defaults 4. General Options 5. Themes 6. Address Books 7. Message of the Day (MOTD) 8. Plugins 9. Database 10. Languages D. Set pre-defined settings for specific IMAP servers C Turn color on S Save data Q Quit Command >> <-- S
SquirrelMail Configuration : Read: config.php (1.4.0) --------------------------------------------------------Main Menu -1. Organization Preferences 2. Server Settings 3. Folder Defaults 4. General Options 5. Themes 6. Address Books 7. Message of the Day (MOTD) 8. Plugins 9. Database 10. Languages D. Set pre-defined settings for specific IMAP servers C Turn color on S Save data
Q Quit Command >> S Data saved in config.php Press enter to continue... <-- ENTER
SquirrelMail Configuration : Read: config.php (1.4.0) --------------------------------------------------------Main Menu -1. Organization Preferences 2. Server Settings 3. Folder Defaults 4. General Options 5. Themes 6. Address Books 7. Message of the Day (MOTD) 8. Plugins 9. Database 10. Languages D. Set pre-defined settings for specific IMAP servers C Turn color on S Save data Q Quit Command >> <-- Q Afterwards you can access SquirrelMail under http://server1.example.com/webmail or http://192.168.0.100/webmail:
Install ISPConfig 3
To install ISPConfig 3 from the latest released version, do this: cd /tmp wget http://downloads.sourceforge.net/ispconfig/ISPConfig-3.0.2.1.tar.gz?use_mirror= tar xvfz ISPConfig-3.0.2.1.tar.gz cd ispconfig3_install/install/ (Replace ISPConfig-3.0.2.1.tar.gz with the latest version.) The next step is to run
php -q install.php This will start the ISPConfig 3 installer. The installer will configure all services like postfix, sas l, courier, etc. for you. A manual setup as required for ISPConfig 2 (perfect setup guides) is not nescessary. root@server1:/tmp/ispconfig3_install/install# php -q install.php PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/imagick.ini o n line 1 in Unknown on line 0 PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/imap.ini on li ne 1 in Unknown on line 0 PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0
-------------------------------------------------------------------------------_____ ___________ _____ __ _ |_ _/ ___| ___ \ / __ \ / _(_) | | \ `--.| |_/ / | / \/ ___ _ __ | |_ _ __ _ | | `--. \ __/ | | / _ \| '_ \| _| |/ _` | _| |_/\__/ / | | \__/\ (_) | | | | | | | (_| | \___/\____/\_| \____/\___/|_| |_|_| |_|\__, | __/ | |___/ --------------------------------------------------------------------------------
>> Initial configuration Operating System: Debian Squeeze/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 incorporated into 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 blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----Country Name (2 letter code) [AU]: <-- ENTER State or Province Name (full name) [Some-State]: <-- ENTER Locality Name (eg, city) []: <-- ENTER Organization Name (eg, company) [Internet Widgits Pty Ltd]: <-- ENTER Organizational Unit Name (eg, section) []: <-- ENTER Common Name (eg, YOUR name) []: <-- ENTER Email Address []: <-- ENTER Configuring Jailkit Configuring SASL Configuring PAM Configuring Courier Configuring Spamassassin Configuring Amavisd Configuring Getmail Configuring Pureftpd Configuring BIND Configuring Apache Configuring vlogger Configuring Apps vhost Configuring Firewall Installing ISPConfig ISPConfig Port [8080]: <-- ENTER Configuring DBServer Installing Crontab no crontab for root no crontab for getmail
Restarting services ... Rather than invoking init scripts through /etc/init.d, use the service(8) utility, e.g. service mysql restart Since the script you are attempting to invoke has been converted to an Upstart job, you may also use the restart(8) utility, e.g. restart mysql mysql start/running, process 24840 * 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. * 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/pureftpd/db/mysql.conf - l pam -H -E -b -O clf:/var/log/pure- ftpd/transfer.log -8 UTF-8 -u 1000 -A -B
Installation 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):
Prepared By :www.ispconfig3manual.blogspot.com