How to install ISPConfig 3 on Ubuntu 16.04

 

ISPConfig is an open source hosting control panel which is very fast, secure and stable. It is used by many system admins to manage their servers via a web-based interface instead of using the command line. It comes with support for many services including Apache, Nginx, MySQL, Bind, Postfix, Dovecot, Courier, PureFTPD etc. and it is used for easy website administration, creating email accounts and FTP users, creating MySQL databases, setting up cron jobs, DNS administration and more. In this tutorial, we will show you how to install ISPConfig 3 on a Linux VPS running Ubuntu 16.04 as an operating system.

First of all, connect to your server via SSH and upgrade the system software to the latest version. You can use the following commands for that purpose:

sudo apt-get update
sudo apt-get upgrade

Also, make sure that Apparmor is not running on your server. You can disable it and remove it completely from your server by using the commands below:

sudo systemctl stop apparmor.service
sudo apt-get remove apparmor apparmor-utils

Next, we need to install some required packages. Go ahead and install the following packages:

sudo apt-get install openssl apache2 apache2-utils apache2-doc libapache2-mod-php php7.0 php7.0-common php7.0-cli php7.0-mysql php7.0-sqlite3 php7.0-imap php7.0-gd php7.0-cgi php7.0-zip php7.0-mbstring php7.0-opcache php7.0-curl php7.0-intl php7.0-pspell php7.0-recode php7.0-tidy php7.0-xmlrpc php7.0-xsl libapache2-mod-fcgid php-auth apache2-suexec-pristine php-pear php7.0-mcrypt mcrypt imagemagick libruby memcached php-memcache php-imagick libapache2-mod-python php-gettext php-apcu mariadb-server mariadb-client phpmyadmin postfix postfix-mysql postfix-doc dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve dovecot-lmtpd postgrey amavisd-new spamassassin clamav clamav-daemon clamav-docs mailman roundcube roundcube-core roundcube-mysql roundcube-plugins roundcube-plugins-extra php-net-sieve tinymce getmail4 javascript-common libjs-jquery-mousewheel rkhunter binutils zoo zip unzip bzip2 vlogger webalizer awstats geoip-database libclass-dbi-mysql-perl bind9 dnsutils haveged daemon libio-string-perl libio-socket-ssl-perl libnet-ident-perl quota quotatool libnet-dns-perl pure-ftpd-common pure-ftpd-mysql cabextract apt-listchanges libnet-ldap-perl libauthen-sasl-perl arj nomarch lzop

Some of these packages may be required for special configurations, but we will install them in any case.

During the installation, you will need to answer some basic questions. When installing the Postfix service you will be asked to select configuration. Select Internet Site. Next, as system mail name enter your server hostname. If you are asked to select a web server, select Apache2.
Also, you will be asked to enter MySQL application password for phpMyadmin and MySQL application password for Roundcube. You can enter a strong password of your choice.

Once the installation of the required packages is completed, it is time to configure the software. Let’s start with Apache. Enable the following Apache and PHP modules:

sudo a2enmod rewrite ssl cgi include actions suexec dav_fs dav auth_digest alias
sudo phpenmod mcrypt

Then, restart the Apache service for the changes to take effect:

sudo systemctl restart apache2.service

Another service that needs to be configured is pure-ftpd. Since you will have to provide the users with FTP access to your Ubuntu VPS so they can upload and download files, you need to configure chroot environment. That way, the users will not have access to the rest of the system. Edit the /etc/default/pure-ftpd-common file and change the value for VIRTUALCHROOT from false to true.

sudo nano /etc/default/pure-ftpd-common

VIRTUALCHROOT=true

You can also set up an SSL certificate in order to secure your FTP service.

Restart the service for the changes to take effect:

sudo systemctl restart pure-ftpd-mysql.service

Next we can configure Posfix and Mailman. Edit the Postfix master configuration file:

sudo nano /etc/postfix/master.cf

Basically, we will need to uncomment a few lines in the configuration file and append -o smtpd_client_restrictions=permit_sasl_authenticated,reject under the submission and smtps sections. The file should look like the following:

submission inet n       -       y       -       -       smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=
#  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING

smtps     inet  n       -       y       -       -       smtpd
  -o syslog_name=postfix/smtps
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=
#  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING

Save and close the file. Then we can create a new list for Mailman.

sudo newlist mailman

You will be asked to enter an email of the person that runs the list as well as a password. The script will provide you with output of aliases which should be added to the /etc/aliases file.

sudo nano /etc/aliases

The file should be similar like the following:

# Required aliases
postmaster:     root
MAILER-DAEMON:  postmaster

# Common aliases
abuse:          postmaster
spam:           postmaster

# Other aliases
clamav: root

mailman:              "|/var/lib/mailman/mail/mailman post mailman"
mailman-admin:        "|/var/lib/mailman/mail/mailman admin mailman"
mailman-bounces:      "|/var/lib/mailman/mail/mailman bounces mailman"
mailman-confirm:      "|/var/lib/mailman/mail/mailman confirm mailman"
mailman-join:         "|/var/lib/mailman/mail/mailman join mailman"
mailman-leave:        "|/var/lib/mailman/mail/mailman leave mailman"
mailman-owner:        "|/var/lib/mailman/mail/mailman owner mailman"
mailman-request:      "|/var/lib/mailman/mail/mailman request mailman"
mailman-subscribe:    "|/var/lib/mailman/mail/mailman subscribe mailman"
mailman-unsubscribe:  "|/var/lib/mailman/mail/mailman unsubscribe mailman"

Save and close the file. Initialize the alias database and restart the services.

sudo newaliases
sudo systemctl restart mailman.service
sudo systemctl restart postfix.service

Additionally, you need to stop and disable SpamAssassin.

sudo systemctl stop spamassassin.service
sudo systemctl disable spamassassin.service

Next, remove the /etc/cron.d/awstats file:

sudo rm -f /etc/cron.d/awstats

Finally, lets install ISPConfig. Download the latest release and install it by using the following commands:

cd /tmp 
sudo wget -O ispconfig.tar.gz https://git.ispconfig.org/ispconfig/ispconfig3/repository/archive.tar.gz?ref=stable-3.1
sudo tar xfz ispconfig.tar.gz
cd ispconfig3*/install/
sudo php -q install.php

Answer the questions to complete the installation and then access the ISPConfig hosting control panel at:

https://IP-ADDRESS:8080

You need to replace IP-ADDRESS with your server IP address. Alternatively, you can use a domain name that points to your server IP address. To log in you need to use admin as username and the password you set up during the installation process. Once you log in you should see something like the following.

 

Source