The Perfect Server - Debian 10 (Buster) with Apache, BIND, Dovecot, PureFTPD and ISPConfig 3.1

This tutorial shows how to prepare a Debian 10 server (with Apache2, BIND, Dovecot) for the installation of ISPConfig 3.1, and how to install ISPConfig. The web hosting control panel ISPConfig 3 allows you to configure the following services through a web browser: Apache or nginx web server, Postfix mail server, Courier or Dovecot IMAP/POP3 server, MySQL, BIND or MyDNS nameserver, PureFTPd, SpamAssassin, ClamAV, and many more. This setup covers Apache (instead of nginx), BIND, and Dovecot.

1 Preliminary Note

In this tutorial, I will 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. Before proceeding further you need to have a minimal installation of Debian 10. This might be a Debian minimal image from your Hosting provider or you use the Minimal Debian Server tutorial to set up the base system.

All commands below are run as root user. Either log in as root user directly or log in as your normal user and then use the command

su -

to become root user on your server before you proceed. IMPORTANT: You must use 'su -' and not just 'su', otherwise your PATH variable is set wrong by Debian.

2 Install the SSH server (Optional)

If you did not install the OpenSSH server during the system installation, you can do it now:

apt-get install ssh openssh-server

From now on you can use an SSH client such as PuTTY and connect from your workstation to your Debian 9 server and follow the remaining steps from this tutorial.

3 Install a shell text editor (Optional)

We will use nano text editor in this tutorial. Some users prefer the classic vi editor, therefore we will install both editors here. The default vi program has some strange behavior on Debian and Ubuntu; to fix this, we install vim-nox:

apt-get install nano vim-nox

If vi is your favorite editor, then replace nano with vi in the following commands to edit files.

4 Configure the Hostname

The hostname of your server should be a subdomain like "server1.example.com". Do not use a domain name without subdomain part like "example.com" as hostname as this will cause problems later with your mail setup. First, you should check the hostname in /etc/hosts and change it when necessary. The line should be: "IP Address - space - full hostname incl. domain - space - subdomain part". For our hostname server1.example.com, the file shall look like this:

nano /etc/hosts
127.0.0.1       localhost.localdomain   localhost
192.168.0.100   server1.example.com     server1

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Then edit the /etc/hostname file:

nano /etc/hostname

It shall contain only the subdomain part, in our case:

server1

Finally, reboot the server to apply the change:

systemctl reboot

Log in again and check if the hostname is correct now with these commands:

hostname
hostname -f

The output shall be like this:

[email protected]:/tmp# hostname
server1
[email protected]:/tmp# hostname -f
server1.example.com

5 Update your Debian Installation

First, make sure that your /etc/apt/sources.list contains the buster/updates repository (this makes sure you always get the newest security updates), and that the contrib and non-free repositories are enabled as some required packages are not in the main repository.

nano /etc/apt/sources.list
deb http://deb.debian.org/debian/ buster main contrib non-free
deb-src http://deb.debian.org/debian/ buster main contrib non-free

deb http://security.debian.org/debian-security buster/updates main contrib non-free
deb-src http://security.debian.org/debian-security buster/updates main contrib non-free

Run:

apt-get update

To update the apt package database

apt-get upgrade

and to install the latest updates (if there are any).

6. Change the Default Shell

/bin/sh is a symlink to /bin/dash, however we need /bin/bash, not /bin/dash. Therefore, we do this:

dpkg-reconfigure dash

Use dash as the default system shell (/bin/sh)? <-- No

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

7 Synchronize the System Clock

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

apt-get -y install ntp

and your system time will always be in sync.

8 Install Postfix, Dovecot, MariaDB, rkhunter, and Binutils

We can install Postfix, Dovecot, MariaDB as MySQL alternative, rkhunter, and Binutils with a single command:

apt-get -y install postfix postfix-mysql postfix-doc mariadb-client mariadb-server openssl getmail4 rkhunter binutils dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve dovecot-lmtpd sudo

You will be asked the following questions:

General type of mail configuration: <-- Internet Site
System mail name: <-- server1.example.com

To secure the MariaDB installation and to disable the test database, run this command:

mysql_secure_installation

Answer the questions as follows:

Change the root password? [Y/n] <-- y
New password: <-- Enter a new MariaDB root password
Re-enter new password: <-- Repeat the MariaDB root password
Remove anonymous users? [Y/n] <-- y
Disallow root login remotely? [Y/n] <-- y
Remove test database and access to it? [Y/n] <-- y
Reload privilege tables now? [Y/n] <-- y

Next, open the TLS/SSL and submission ports in Postfix:

nano /etc/postfix/master.cf

Uncomment the submission and smtps sections as follows and add lines where necessary so that this section of the master.cf file looks exactly like the one below. IMPORTANT: Remove the # in front of the lines that start with smtps and submission too and not just from the -o lines after these lines!

[...]
submission inet n - - - - 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 - - - - 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 [...]

Restart Postfix afterwards:

systemctl restart postfix

We want MySQL to listen on all interfaces, not just localhost. Therefore, we edit /etc/mysql/mariadb.conf.d/50-server.cnf and comment out the line bind-address = 127.0.0.1 by adding a # in front of it.

nano /etc/mysql/mariadb.conf.d/50-server.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

[...]

Set the password authentication method in MariaDB to native so we can use PHPMyAdmin later to connect as root user:

echo "update mysql.user set plugin = 'mysql_native_password' where user='root';" | mysql -u root

Edit the file /etc/mysql/debian.cnf and set the MYSQL / MariaDB root password there twice in the rows that start with the word password.

nano /etc/mysql/debian.cnf

The MySQL root password that needs to be added is shown in red. In this example, the password is "howtoforge".

# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host = localhost
user = root
password = howtoforge
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = root
password = howtoforge
socket = /var/run/mysqld/mysqld.sock
basedir = /usr

To prevent the error 'Error in accept: Too many open files' we will set higher open file limits for MariaDB now.

Open the file /etc/security/limits.conf with an editor:

nano /etc/security/limits.conf

and add these lines at the end of the file.

mysql soft nofile 65535
mysql hard nofile 65535

Next, create a new directory /etc/systemd/system/mysql.service.d/ with the mkdir command.

mkdir -p /etc/systemd/system/mysql.service.d/

and add a new file inside:

nano /etc/systemd/system/mysql.service.d/limits.conf

paste the following lines into that file:

[Service]
LimitNOFILE=infinity

Save the file and close the nano editor.

Then we reload systemd and restart MariaDB:

systemctl daemon-reload
systemctl restart mariadb

Now check that networking is enabled. Run

netstat -tap | grep mysql

The output should look like this:

[email protected]:/home/administrator# netstat -tap | grep mysql
tcp6 0 0 [::]:mysql [::]:* LISTEN 16623/mysqld

9 Install Amavisd-new, SpamAssassin, and ClamAV

To install amavisd-new, SpamAssassin and ClamAV, we run

apt-get install amavisd-new spamassassin clamav clamav-daemon unzip bzip2 arj nomarch lzop cabextract p7zip p7zip-full unrar lrzip 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 libdbd-mysql-perl postgrey

The ISPConfig 3 setup uses amavisd which loads the SpamAssassin filter library internally, so we can stop SpamAssassin to free up some RAM:

systemctl stop spamassassin
systemctl disable spamassassin

10 Install Apache Web Server and PHP

Apache2, PHP, FCGI, suExec, Pear, and mcrypt can be installed as follows:

apt-get -y install apache2 apache2-doc apache2-utils libapache2-mod-php php7.3 php7.3-common php7.3-gd php7.3-mysql php7.3-imap php7.3-cli php7.3-cgi libapache2-mod-fcgid apache2-suexec-pristine php-pear mcrypt  imagemagick libruby libapache2-mod-python php7.3-curl php7.3-intl php7.3-pspell php7.3-recode php7.3-sqlite3 php7.3-tidy php7.3-xmlrpc php7.3-xsl memcached php-memcache php-imagick php-gettext php7.3-zip php7.3-mbstring memcached libapache2-mod-passenger php7.3-soap php7.3-fpm php7.3-opcache php-apcu

Then run the following command to enable the Apache modules suexec, rewrite, ssl, actions, and include (plus dav, dav_fs, and auth_digest if you want to use WebDAV):

a2enmod suexec rewrite ssl actions include dav_fs dav auth_digest cgi headers actions proxy_fcgi alias

To ensure that the server cannot be attacked through the HTTPOXY vulnerability, we will disable the HTTP_PROXY header in apache globally by adding the configuration file /etc/apache2/conf-available/httpoxy.conf.

Note: The vulnerability is named httpoxy (without 'r') and therefore the file where we add the config to prevent it is named httpoxy.conf and not httproxy.conf, so there is no 'r' missing in the filename.

nano /etc/apache2/conf-available/httpoxy.conf

Paste the following content to the file:

<IfModule mod_headers.c>
    RequestHeader unset Proxy early
</IfModule>

And enable the module by running:

a2enconf httpoxy
systemctl restart apache2

11 Install Let's Encrypt

ISPConfig 3.1 has support for the free SSL Certificate authority Let's encrypt. The Let's Encrypt function allows you to create free SSL certificates for your website from within ISPConfig.

Now we will add support for Let's encrypt.

cd /usr/local/bin
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
./certbot-auto --install-only

There are no further steps required than installing LE. The website SSL certificates are created by ISPConfig when you add the web sites.

12 Install Mailman

ISPConfig allows you to manage (create/modify/delete) Mailman mailing lists. If you want to make use of this feature, install Mailman as follows:

apt-get install mailman

Select at least one language, e.g.:

Languages to support: <-- en (English)
Missing site list <-- Ok

Before we can start Mailman, a first mailing list called mailman must be created:

newlist mailman
[email protected]:~# newlist mailman
Enter the email of the person running the list: <-- admin email address, e.g. [email protected]
Initial mailman password: <-- admin password for the mailman list
To finish creating your mailing list, you must edit your /etc/aliases (or
equivalent) file by adding the following lines, and possibly running the
`newaliases' program:

## mailman mailing list
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"

Hit enter to notify mailman owner... <-- ENTER

[email protected]:~#

Open /etc/aliases afterwards...

nano /etc/aliases

... and add the following lines:

[...]
## mailman mailing list
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"

Run:

newaliases

and restart Postfix:

systemctl restart postfix

Finally, we must enable the Mailman Apache configuration:

ln -s /etc/mailman/apache.conf /etc/apache2/conf-enabled/mailman.conf

This defines the alias /cgi-bin/mailman/ for all Apache vhosts, which means you can access the Mailman admin interface for a list at http://server1.example.com/cgi-bin/mailman/admin/, and the web page for users of a mailing list can be found at http://server1.example.com/cgi-bin/mailman/listinfo/.

Under http://server1.example.com/pipermail you can find the mailing list archives.

Restart Apache afterwards:

systemctl restart apache2

Then start the Mailman daemon:

systemctl restart mailman

13 Install PureFTPd and Quota

PureFTPd and quota can be installed with the following command:

apt-get install pure-ftpd-common pure-ftpd-mysql quota quotatool

Create the dhparam file for pure-ftpd:

openssl dhparam -out /etc/ssl/private/pure-ftpd-dhparams.pem 2048

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

nano /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
[...]

Now we configure PureFTPd to allow FTP and TLS sessions. FTP is a very insecure protocol because all passwords and all data are transferred in clear text. By using TLS, the whole communication can be encrypted, thus making FTP much more secure.

If you want to allow FTP and TLS sessions, run

echo 1 > /etc/pure-ftpd/conf/TLS

In order to use TLS, we must create an SSL certificate. I create it in /etc/ssl/private/, therefore I create that directory first:

mkdir -p /etc/ssl/private/

Afterwards, we can generate the SSL certificate as follows:

openssl req -x509 -nodes -days 7300 -newkey rsa:2048 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem
Country Name (2 letter code) [AU]: <-- Enter your Country Name (e.g., "DE").
State or Province Name (full name) [Some-State]: <-- Enter your State or Province Name.
Locality Name (eg, city) []: <-- Enter your City.
Organization Name (eg, company) [Internet Widgits Pty Ltd]: <-- Enter your Organization Name (e.g., the name of your company).
Organizational Unit Name (eg, section) []: <-- Enter your Organizational Unit Name (e.g. "IT Department").
Common Name (eg, YOUR name) []: <-- Enter the Fully Qualified Domain Name of the system (e.g. "server1.example.com").
Email Address []: <-- Enter your Email Address.

Change the permissions of the SSL certificate:

chmod 600 /etc/ssl/private/pure-ftpd.pem

Then restart PureFTPd:

systemctl restart pure-ftpd-mysql

Edit /etc/fstab. Mine looks like this (I added ,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0 to the partition with the mount point /):

nano /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' 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>
# / was on /dev/sda1 during installation
UUID=45576b38-39e8-4994-b8c1-ea4870e2e614 / ext4 errors=remount-ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0 0 1
# swap was on /dev/sda5 during installation
UUID=8bea0d1e-ec37-4b20-9976-4b7daaa3eb69 none swap sw 0 0
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0

To enable quota, run these commands:

mount -o remount /
quotacheck -avugm
quotaon -avug

14 Install BIND DNS Server

BIND can be installed as follows:

apt-get install bind9 dnsutils

 If your server is a virtual machine, then it is highly recommended to install the haveged daemon to get a higher entropy for DNSSEC signing. You can install haveged on nonvirtual servers as well, it should not hurt.

apt-get install haveged

An explanation on that topic can be found here.

15 Install Webalizer and AWStats

Webalizer and AWStats can be installed as follows:

apt-get install webalizer awstats geoip-database libclass-dbi-mysql-perl libtimedate-perl

Open /etc/cron.d/awstats afterwards...

nano /etc/cron.d/awstats

... and comment out everything in that file:

#MAILTO=root

#*/10 * * * * www-data [ -x /usr/share/awstats/tools/update.sh ] && /usr/share/awstats/tools/update.sh

# Generate static reports:
#10 03 * * * www-data [ -x /usr/share/awstats/tools/buildstatic.sh ] && /usr/share/awstats/tools/buildstatic.sh

16 Install Jailkit

Jailkit is needed only if you want to chroot SSH users. It can be installed as follows:

apt-get install build-essential autoconf automake libtool flex bison debhelper binutils
cd /tmp
wget http://olivier.sessink.nl/jailkit/jailkit-2.20.tar.gz
tar xvfz jailkit-2.20.tar.gz
cd jailkit-2.20
echo 5 > debian/compat
./debian/rules binary

You can now install the Jailkit .deb package as follows:

cd ..
dpkg -i jailkit_2.20-1_*.deb
rm -rf jailkit-2.20*

17 Install fail2ban and UFW Firewall

This is optional but recommended, because the ISPConfig monitor tries to show the log:

apt-get install fail2ban

To make fail2ban monitor PureFTPd and Dovecot, create the file /etc/fail2ban/jail.local:

nano /etc/fail2ban/jail.local

And add the following configuration to it.

[pure-ftpd]
enabled = true
port = ftp
filter = pure-ftpd
logpath = /var/log/syslog
maxretry = 3

[dovecot]
enabled = true
filter = dovecot
logpath = /var/log/mail.log
maxretry = 5

[postfix-sasl]
enabled = true
port = smtp
filter = postfix[mode=auth]
logpath = /var/log/mail.log
maxretry = 3

Restart fail2ban afterwards:

systemctl restart fail2ban

To install the UFW firewall, run this apt command:

apt-get install ufw

18 Install PHPMyAdmin Database Administration Tool

Since Debian 10, PHPMyAdmin is not available as .deb package anymore. Therefore we will install it from source.

Create folders for PHPMyadmin:

mkdir /usr/share/phpmyadmin
mkdir /etc/phpmyadmin
mkdir -p /var/lib/phpmyadmin/tmp
chown -R www-data:www-data /var/lib/phpmyadmin
touch /etc/phpmyadmin/htpasswd.setup

Go to the /tmp directory and download the PHPMyAdmin sources:

cd /tmp
wget https://files.phpmyadmin.net/phpMyAdmin/4.9.0.1/phpMyAdmin-4.9.0.1-all-languages.tar.gz

Unpack the downloaded archive file and move the files to the /usr/share/phpmyadmin folder and clean up the /tmp directory.

tar xfz phpMyAdmin-4.9.0.1-all-languages.tar.gz
mv phpMyAdmin-4.9.0.1-all-languages/* /usr/share/phpmyadmin/
rm phpMyAdmin-4.9.0.1-all-languages.tar.gz
rm -rf phpMyAdmin-4.9.0.1-all-languages

Create a new config file for PHPMyaAdmin based on the provided sample file:

cp /usr/share/phpmyadmin/config.sample.inc.php  /usr/share/phpmyadmin/config.inc.php

Open the config file with nano editor:

nano /usr/share/phpmyadmin/config.inc.php

Set a secure password (blowfish secret) which must be 32 chars long:

$cfg['blowfish_secret'] = 'bD3e6wva9fnd93jVsb7SDgeiBCd452Dh'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

Don't use my example blowfish secret, set your own one!

Then add a line to set the directory which PHPMyAdmin shall use to store temporary files:

$cfg['TempDir'] = '/var/lib/phpmyadmin/tmp';

Next, we create the Apache configuration file for PHPMyAdmin by opening a new file in nano editor:

nano /etc/apache2/conf-available/phpmyadmin.conf

Paste the following config into the file and save it.

# phpMyAdmin default Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
Options FollowSymLinks
DirectoryIndex index.php

<IfModule mod_php7.c>
AddType application/x-httpd-php .php

php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
php_value include_path .
</IfModule>

</Directory>

# 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>

# Disallow web access to directories that don't need it
<Directory /usr/share/phpmyadmin/libraries>
Order Deny,Allow
Deny from All
</Directory>
<Directory /usr/share/phpmyadmin/setup/lib>
Order Deny,Allow
Deny from All
</Directory>

Activate the configuration and restart Apache.

a2enconf phpmyadmin
systemctl restart apache2

In the next step, we will configure the phpMyadmin configuration store (database).

Log into MariaDB as root user:

mysql -u root -p

In the MariaDB shell, create a new database for PHPMyAdmin:

MariaDB [(none)]> CREATE DATABASE phpmyadmin;

Then create a new user:

MariaDB [(none)]> CREATE USER 'pma'@'localhost' IDENTIFIED BY 'mypassword';

Replace the word mypassword with a secure password of your choice in the commands above and below, use the same password both times. Then grant the user access to this database and reload database permissions.

MariaDB [(none)]> GRANT ALL PRIVILEGES ON phpmyadmin.* TO 'pma'@'localhost' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Finally, load the SQL tables into the database:

mysql -u root -p phpmyadmin < /usr/share/phpmyadmin/sql/create_tables.sql

Enter the MariaDB root password on request.

All we have to do now is to set the phpmyadmin user details in the configuration file. Open the file in nano editor again:

nano /usr/share/phpmyadmin/config.inc.php

Scroll down until you see the lines below and edit them:

/* User used to manipulate with storage */
$cfg['Servers'][$i]['controlhost'] = 'localhost';
$cfg['Servers'][$i]['controlport'] = '';
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'mypassword';

/* Storage database and tables */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';

I've marked the lines in red which I've edited. Replace mypassword with the password that you've chosen for the phpmyadmin user. Note that the // in front of the lines have been removed as well!

19 Install RoundCube Webmail (optional)

In this chapter, we will install the RoundCube webmail client. First, we have to create the database for Roundcube manually as there is currently an issue in the RoundCube Debian installer which causes it to fail to create the database automatically. Run this command to create the database:

echo "CREATE DATABASE roundcube;" | mysql --defaults-file=/etc/mysql/debian.cnf

Then install RoundCube with this command:

apt-get install roundcube roundcube-core roundcube-mysql roundcube-plugins

The installer will ask the following questions:

Configure database for roundcube with dbconfig.common? <-- yes
MySQL application password for roundcube: <-- press enter

Then edit the RoundCube /etc/roundcube/config.inc.php file and adjust a few settings:

nano /etc/roundcube/config.inc.php

Set the default_host and smtp_server to localhost.

$config['default_host'] = 'localhost';
$config['smtp_server'] = 'localhost';

Then edit the Apache roundcube configuration file /etc/apache2/conf-enabled/roundcube.conf:

nano /etc/apache2/conf-enabled/roundcube.conf

And add an alias line for the apache /webmail alias and one for /roundcube, you can add the line right at the beginning of the file. NOTE: Do not use /mail as alias or the ispconfig email module will stop working!

Alias /roundcube /var/lib/roundcube
Alias /webmail /var/lib/roundcube

Then reload Apache:

systemctl reload apache2

Now you can access RoundCube as follows:

http://192.168.0.100/webmail
http://www.example.com/webmail
http://server1.example.com:8080/webmail
(after you have installed ISPConfig, see the next chapter)

20 Download ISPConfig 3

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

cd /tmp
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
tar xfz ISPConfig-3-stable.tar.gz
cd ispconfig3_install/install/

20.2 Download a pre-release version of the next 3.1 release

If you like to try out the pre-release of an upcoming 3.1 stable version, download it with this command. This stable branch versions are the last stable release plus the changes for the next stable version:

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

21 Install ISPConfig

The next step is to run the ISPConfig installer.

php -q install.php

This will start the ISPConfig 3 installer. The installer will configure all services like Postfix, Dovecot, etc. for you. A manual setup as required for ISPConfig 2 (perfect setup guides) is not necessary.

# php -q install.php

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

>> Initial configuration
Operating System: Debian 10.0 (Buster) 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]: <-- Hit Enter
Installation mode (standard,expert) [standard]: <-- Hit Enter
Full qualified hostname (FQDN) of the server, eg server1.domain.tld [server1.example.com]: <-- Hit Enter
MySQL server hostname [localhost]: <-- Hit Enter
MySQL server port [3306]: <-- Hit Enter
MySQL root username [root]: <-- Hit Enter
MySQL root password []: <-- Enter your MySQL root password
MySQL database to create [dbispconfig]: <-- Hit Enter
MySQL charset [utf8]: <-- Hit Enter
Configuring Postgrey
Configuring Postfix
Generating a 4096 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 2 letter country code
State or Province Name (full name) [Some-State]: <-- Enter the name of the  state
Locality Name (eg, city) []: <-- Enter your city
Organization Name (eg, company) [Internet Widgits Pty Ltd]: <-- Enter company name or press enter
Organizational Unit Name (eg, section) []: <-- Hit Enter
Common Name (e.g. server FQDN or YOUR name) []: <-- Enter the server hostname, in my case: server1.example.com
Email Address []: <-- Hit Enter
Configuring Mailman
Configuring Dovecot
Configuring Spamassassin
Configuring Amavisd
Configuring Getmail
Configuring BIND
Configuring Jailkit
Configuring Pureftpd
Configuring Apache
Configuring vlogger
[INFO] service Metronome XMPP Server not detected
Configuring Ubuntu Firewall
Configuring Fail2ban
[INFO] service OpenVZ not detected
Configuring Apps vhost
Installing ISPConfig
ISPConfig Port [8080]:
Admin password [admin]:
Do you want a secure (SSL) connection to the ISPConfig web interface (y,n) [y]: <-- Hit Enter
Generating RSA private key, 4096 bit long modulus
.......................++
................................................................................................................................++
e is 65537 (0x10001)
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 2 letter country code
State or Province Name (full name) [Some-State]: <-- Enter the name of the  state
Locality Name (eg, city) []: <-- Enter your city
Organization Name (eg, company) [Internet Widgits Pty Ltd]: <-- Enter company name or press enter
Organizational Unit Name (eg, section) []: <-- Hit Enter
Common Name (e.g. server FQDN or YOUR name) []: <-- Enter the server hostname, in my case: server1.example.com
Email Address []: <-- Hit Enter
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []: <-- Hit Enter
An optional company name []: <-- Hit Enter
writing RSA key

Configuring DBServer
Installing ISPConfig crontab
no crontab for root
no crontab for getmail
Detect IP addresses
Restarting services ...
Installation completed.

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

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

ISPConfig Login on Debian 10

ISPConfig Dashboard on Debian 10

The system is now ready to be used.

22 Virtual Machine Image Download of this Tutorial

This tutorial is available as ready to use virtual machine image in ovf/ova format that is compatible with VMWare and Virtualbox. The virtual machine image uses the following login details:

SSH / Shell Login

Username: administrator
Password: howtoforge

Username: root
Password: howtoforge

ISPConfig Login

Username: admin
Password: admin

MySQL Login

Username: root
Password: howtoforge

The IP of the VM is 192.168.0.100, it can be changed in the file /etc/network/interfaces. Please change all the above passwords to secure the virtual machine. 

Share this page:

Suggested articles

92 Comment(s)

Add comment

Comments

By: Nestor at: 2019-07-09 00:16:12

Hi. I tried to install according to the guide and I get two errors. 1 / I can not install roundcube, since I miss error when creating the bd and it does not let me continue. 2 / I can not install ISPConfig, since it marks me the following error:  The patch command is missing. Install patch command and start installation again... Will it be that ISPConfig does not accept php 7.3.4? or will it be necessary to configure AppAmor? Every idea is well-received. Thank you.

By: till at: 2019-07-09 06:52:13

Just follow the tutorial from beginning to end, there are no additional steps required. If you get an error that the patch command is missing, then you left out a part of the guide, in this case probably the jailkit installation. Redo all steps and do not leave something out to get a fully working system. You can also install patch manually with apt, but as other things are probably missing as well, it's better to go through all steps again and ensure that you did not left out a single command. Regarding RoundCuce, this error happens when you did not configure MariaDB in the way that is described in the tutorial. Redo all steps from MariaDB installation chapter and ensure that you modified all the config files in the exact way that's described in the tutorial.

By: Mat at: 2019-07-09 07:26:10

Hi Till,

thanks for the tutorial update for Debian 10 - do plan also an update for the nginx perfect server for Debian 10 ? ;))

 

One little question - at postfix master.cf

is there submission inet n - - - - smtpd & smtps inet n - - - - smtp

correct - had there something changed from Debian 9 to Debian 10 ?

It was in the old tutorials always submission inet n - y - - smtpd & smtps inet n - y - - smtpd

 

Thanks in advance,

 

Mat

By: till at: 2019-07-09 07:34:04

I've used the new defaults that postfix on Debian 10 ships with and just uncommented the required lines. The mail system works fine in my tests, so I guess the new postfix defaults should be ok. Regarding nginx tutorial, yes, that's next on my ISPConfig tutorial todo list.

By: Mat at: 2019-07-09 08:11:31

Ahh ok interessting - i have done also a fresh install of debian 10 (now more times because i test different new features, if it works together) with a new image from my hoster, last one is from last friday - there is still the old setting inside at postfix.I will give also the new one a try.

your tutorials always work without any issue - perfect thanks so much for your great work here!

By: Neptun at: 2019-07-09 19:54:47

is it possible with your perfect server debian 10 tutorial to use maria db 10.4 which is since June stable too - instead of maria db 10.3 ?or would be there any issue ?

https://mariadb.com/kb/en/library/mariadb-1046-release-notes/

maybe you could kindly add it to the nginx perfect server tutorial for debian 10, if possible - just an idea/request

By: till at: 2019-07-09 19:57:56

I will use the packages that ship with Debian 10, and that's 10.3 at the moment. I can't say if 10.4 will work as I have not tested it.

By: Matt at: 2019-07-09 15:23:59

Very thorough. Looking forward to the nginx version

By: 18TommyBoy at: 2019-07-10 10:24:26

ISP login error:

SSL_ERROR_RX_RECORD_TOO_LONG

Why?

 

(at end I click NO secure connection)

By: till at: 2019-07-10 10:30:38

And that's the reason for the problem, you should have chosen yes there as shown in the tutorial above. Run the uninstall.php script which is in the same folder which contains install.php to uninstall ISPConfig, then reinstall it and use the options shown in the tutorial.

By: DARK9Y8 at: 2019-07-10 18:57:41

I think we can change this portion

cd /usr/local/binwget https://dl.eff.org/certbot-auto chmod a+x certbot-auto ./certbot-auto --install-only

to

apt install certbot

easy :D

By: till at: 2019-07-10 19:41:48

It is intended to not install certbot with apt as I want to install the latest certbot version and not the one from Debian repositories. Using the one from Debian has proven to cause problems in the past because it will probably become outdated soon again.

By: sapro at: 2019-07-12 05:56:26

Short change at jail.local for #17: Install fail2ban:

In section "[postfix-sasl]" the filter has canged to "filter = postfix[mode=auth]"

By: till at: 2019-07-16 08:30:18

Thanks! I fixed that in the tutorial.

By: sapro at: 2019-07-12 06:03:16

At step #8: (Install Dovecot) I add in /etc/dovecot/dovecot.conf the line:

"ssl_dh = </etc/dovecot/dh.pem" after "ssl_protocols" and create the dh.pem-File in /etc/dovecot with

openssl dhparam -out /etc/dovecot/dh.pem 4096

Now dovecot work's fine for me :-)

By: Jose at: 2019-07-12 17:41:57

Hi, Please, could you explain the correct way to get wildcard certificates, for example as for a server with wordpress (domain) and nexcloud (cloud.domain), the way I do it works but it's confusing. 

By: till at: 2019-07-13 07:07:49

You can enter your wildcard SSL cert on the ssl tab of the website, there is no difference to a non-wildcard cert. But that's not related to the topic of this installation tutorial. If you have questions on how to use ISPConfig, then please ask in the ISPConfig support forum here: https://www.howtoforge.com/community/forums/general.25/

By: Peter at: 2019-07-13 09:25:47

Hi. 

When i go to PHP My Admin , user cant create new databases.

No privileges.

By: till at: 2019-07-13 10:18:09

You have to login as MySQL root user to create new databases, only the root user has the privileges for this. Normally you would create databases from within ISPConfig and not phpmyadmin.

By: Maurizio Marini at: 2019-07-13 13:28:17

I did:

systemctl daemon-reload; systemctl restart mariadb

But stil I get

Warning: The unit file, source configuration file or drop-ins of mariadb.service changed on disk. Run 'systemctl daemon-reload' to reload units.

nevertheless I redo

systemctl daemon-reload

more and more

By: till at: 2019-07-13 13:30:42

You can probably ignore that and proceed with the installation.

By: max123kl at: 2019-07-14 07:35:32

PHPMyAdmin is included in Debian-SID as a package again. A few weeks ago I already tested a server with Debian-10 (with debian-buster-DI-rc1-amd64-netinst.iso), unfortunately without the help of the new, great tutorial. As a workaround for the missing buster package I installed the version from SID. As far as I can see this works fine. In order to get future updates I have adapted the files /etc/apt/sources.list and /etc/apt/preferences as needed.

By: Kai at: 2019-07-15 12:07:43

reboot and shutdown commands are now handled by systemctl, so you have to use "systemctl reboot" or "systemctl shutdown", opposed to the commands shown in this guide. But: thank you for being that fast in providing this guide!

By: till at: 2019-07-15 12:14:13

Thank you for the notice. I've changed it in the base install guide but forgot to alter it in the perfect server guide.

By: radim_h at: 2019-07-15 12:53:37

With this way of instalaltion  ./certbot-auto --install-only Will certbot get updated in future ?

By: till at: 2019-07-15 12:58:48

Yes, just run the command 'certbot-auto' and it will update certbot to the latest version.

By: roffe at: 2019-07-15 17:49:56

  mysql said: ERROR 1049 (42000): Unknown database 'roundcube'

problems instaling what to do

 

By: till at: 2019-07-15 17:58:37

Possible reasons: you answered with 'no' instead of 'yes' to the question 'Configure database for roundcube with dbconfig.common?' during roundcube installation or you made a mistake during mysql installation in chapter 8 by e.g. setting a wrong password in /etc/mysql/debian.cnf file.

By: F4lcon at: 2019-07-15 19:31:19

The same issue here, I set up correct root password in debian.cnf, tried 'yes' to the question you mentioned, dpkg-reconfigure roundcube-core, dpkg-reconfigure phpmyadmin/unstable and the dbconfig-common always ends with:

mysql said: ERROR 1049 (42000): Unknown database 'roundcube' (or 'phpmyadmin' etc...)

Tried to create db and user from shell, it is working fine as long as I run dpkg-reconfigure. Here is the output:

---

Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.

dbconfig-common: writing config to /etc/dbconfig-common/roundcube.conf

Replacing config file /etc/dbconfig-common/roundcube.conf with new version

roundcube already exists and has privileges on roundcube.

dbconfig-common: dumping mysql database roundcube to /var/tmp/roundcube.roundcube.2019-07-15-21.06.mysql.GABffs.

dbconfig-common: dropping old mysql database roundcube.

dropping database roundcube: success.

verifying database roundcube was dropped: success.

creating database roundcube: failed.

error encountered creating database:

mysql said: ERROR 1049 (42000): Unknown database 'roundcube'

---

Any idea? Thanks

By: till at: 2019-07-16 05:42:09

I cannot reproduce that here, might be a problem with the MariaDB password in the debian.cnf file, this can be a bit tricky when you use special chars in the password. Please make a post here to get further help: https://www.howtoforge.com/community/forums/general.25/

By: F4lcon at: 2019-07-16 07:03:52

Unfortunately it's the same with a simple password, I will make a new post soon.

By: MaT at: 2019-07-16 07:10:45

Hi,

i can also confirm same issue - everything 100% correct insert in the config files - but not possible to install roundcube without manual creating of the user & databases at mariadb/mqsql - after this - correct install without error (i had always debian 10 nginx install)

i have tried it in different ways - sometimes it works with only database - but 100% success is with both created

By: till at: 2019-07-16 07:15:26

I'll set up a new server here today to test it again. We should continue to investigate this in the forum as it would clutter the tutorial comments otherwise.

By: till at: 2019-07-16 08:31:42

This seems to be an issue in the Debian Roundcube installer as it does not even try to create the database, it created the database user through which implies that the root login works. I've added a command to the tutorial to create the database manually before RoundCube is installed.

By: SamTzu at: 2019-08-11 18:24:21

On my LXC container I had to set the MySQL root password first before I could run any MySQL related command on this tutorial.

mysql -u root

mysql> use mysql;mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD("newpass");mysql> flush privileges;mysql> quit

By: Sergey at: 2019-07-16 13:15:07

Debian 10 with Nginx + php-fpm please :)

By: Roffe at: 2019-07-18 06:43:59

Hi I have installed debian buster and roundcube but how do i get plugins to work have look at this ISPConfig 3 Roundcube Plugin on Debian 9 (Stretch) but don't know if it works with debian 10 (Buster)

By: till at: 2019-07-18 06:48:41

Install them and then you know if they work with PHP 7.3. I have not tested them. Or contact their author and ask him.

By: ffab at: 2019-07-20 12:58:01

this is great. works perfectly !

could you consider explain using a valid let's encrypt cert for ispconfig admin interface

regards,

By: Jose at: 2019-07-21 04:52:32

I used this https://github.com/ahrasis/LE4ISPC works like a charm

By: Michal at: 2019-07-20 18:55:20

Hi,

Do anyone have issue with "Update Packagelist"?

I'm getting information: "No packages to read in"

I run this update on 3 servers and i have this same issue.

By: thctlo at: 2019-07-20 22:47:58

Hai, Thanks for this update again, great! 

Is it an option to replace phpmyadmin with adminer or phpliteadmin from debian itself, i preffer to have minimal source packages and same for certbot. 

Or are there then things going wrong with ispconfig? 

I want that because of the security updates. 

 

By: till at: 2019-07-21 08:53:20

PHPMyadmin is not required for ISPConfig, so feel free to replace it or leave it out. Regarding certbot, you can use the certbot package from Debian but Debian will not keep it up to date and this will cause you issues in a few months or years. We have seen these problems in Debian 9. That's why we recommend to not use the Debian package for Certbot, better get the latest Certbot version and keep it up to date with certbot-auto.

By: thctlo at: 2019-07-22 15:16:47

Hai Till, thank you for you reply, most welkom. 

I did a few runs for the install and I have some corrections/additions to the above setup. 

7) ntp, not needed to install see : timedatectl  is save a bit space and packages to install/maintain. 

8) Dovecot :  # https://bugs.debian.org/903161 fix is very simple:   

adduser dovecot dovecot

That was all i did and the error is gone in my logs. 

Extra Add dovecot DH params. 

openssl dhparam -out /etc/ssl/private/dovecot-dhparams.pem 2048

chown root:dovecot /etc/ssl/private/dovecot-dhparams.pem

chmod 640 /etc/ssl/private/dovecot-dhparams.pem

# and add the DH parameter to the config. 

sed -i '/ssl_key = <\/etc\/postfix\/smtpd.key/a ssl_dh\ =\ <\/etc\/ssl\/private\/dovecot-dhparams.pem' /etc/dovecot/dovecot.conf

systemctl restart dovecot

Mysql limits : nano /etc/security/limits.d/mariadb.conf 

Try not to touch the system defaults.

# creating systemd overrides. ( incl a few buster fixes.) 

# useing edit.. systemctl daemon-reload is automaticly done for you.

systemctl edit mysql.service

Add:

[Service]LimitNOFILE=infinity

 

# The Fixes for buster. systemctl edit fail2ban.serviceAdd: 

[Service]PIDFile=/run/fail2ban/fail2ban.pid

# and a wrong path in the  /usr/lib/tmpfiles.d/fail2ban-tmpfiles.conf

Run : sed -i 's/\/var\/run\/fail2ban/\/run\/fail2ban/g' /usr/lib/tmpfiles.d/fail2ban-tmpfiles.conf

 

systemctl edit dovecot.serviceAdd:[Service]PIDFile=/run/dovecot/master.pid

 

systemctl edit memcached.service[Service]PIDFile=/run/memcached/memcached.pid

If you install jailkit build software with : apt-get install -y --autoremove build-essential autoconf automake libtool flex bison debhelper binutils  

And everything installed, is always removed with : apt-get remove -y --autoremove build-essential autoconf automake libtool flex bison debhelper binutils 

9) Missing a few packages, the corrected needed list. 

apt-get install -y amavisd-new spamassassin clamav clamav-daemon unzip bzip2 arj nomarch lzop cabextract p7zip p7zip-full lrzip 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 libdbd-mysql-perl postgrey unrar-free unp lz4 liblz4-tool unp

Add step 11) I did use the debian certbot version, that works fine for now, when buster-backports are up, certbot will be available there with the lastest version. 

Then im switching to the backported version. 

And after the install, Thanks @Jose  for the link. above for LE4ISP.sh 

I made a few changes for that and a modfied version can be found here: 

https://github.com/thctlo/ISPConfig-Let-s-Encrypt-Securing/blob/master/setup.sh 

This assums you use mail.domain.tld for all mail related services. 

You need to setup 2 ! vhost for this to make it work. 

 

By: Neptun at: 2019-07-24 14:34:01

Hi Till,

do you have maybe any news for the Perfect Server Debian 10 / NGINX tutorial together with IspConfig ?

Would be great - thanks 

By: melaku at: 2019-07-25 17:10:28

 This is an amazing tutorial. thanks for sharing your knowledge. 

let me ask you, i have a free domain name "melakuspark.tk" from freenom. but i am confused how to link my domain name in the above tutorial. shall i use my dhcp assigned ip address as a static ip or where is the corresponding ip address for my domain? please help  

By: Alexander at: 2019-07-27 06:53:29

When entering a command:echo "CREATE DATABASE roundcube;" | mysql --defaults-file=/etc/mysql/debian.cnf shows an error ...ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)Log into MariaDB as root user:mysql -u root -pIn the MariaDB shell, create a new database fo roundcube.MariaDB [(none)]> CREATE DATABASE roundcube;

By: till at: 2019-07-27 07:11:17

This means you did not set the correct root password in the file /etc/mysql/debian.cnf.

By: Annahri at: 2019-07-28 09:21:22

Hi. What a great guide. Can I rewrite this to another language and post it to my blog?

Thanks in advance!

By: till at: 2019-07-28 10:48:04

No, I'm sorry. Republishing and translation of HowtoForge tutorials is not permitted.

By: ganewbie at: 2019-08-05 12:38:32

 Hi Till, Great tutorial as usual.

In case somebody sees the same error.In our setup, we got the following error in "Step # 9"

E: Package 'unrar' has no installation candidate

We swapped unrar with unrar-free and continued the installation.

Thanks for the great efforts,

By: ganewbie at: 2019-08-05 15:52:49

 Hi Till, Great tutorial as usual.

In case somebody sees the same error.In our setup, we got the following error in "Step # 9"

E: Package 'unrar' has no installation candidate

We swapped unrar with unrar-free and continued the installation.

Thanks for the great efforts,

By: Dee at: 2019-08-10 02:56:51

I am getting an error at:

 

dpkg-reconfigure dash

 

The result is:

 

dpkg-reconfigure: command not found

 

So I change the command to (added space after dpkg:

 

dpkg -reconfigure dash

 

The result is as follows:

 

dpkg: error: conflicting actions -e (--control) and -r (--remove)

Type dpkg --help for help about installing and deinstalling packages [*]; Use 'apt' or 'aptitude' for user-friendly package management; Type dpkg -Dhelp for a list of dpkg debug flag values; Type dpkg --force-help for a list of forcing options; Type dpkg-deb --help for help about manipulating *.deb files;

 

 

By: till at: 2019-08-10 07:55:01

The command is "dpkg-reconfigure dash" as mentioned in the tutorial and this command should be available on any Debian 10 system by default. Ensure that you logged in as root user or that you used 'su -' to become root.

By: philip at: 2019-08-11 09:56:50

First thanks for the tutorial!

This doesn't enable http2 which is I think pretty worthwhile on any website. http2 doesn't work with mpm_prefork. I needed to finish with:

a2dismod php7.3

a2dismod mpm_prefork

a2enmod mpm_event

a2enmod http2

 

I'm not sure what to change but I guess removing libapache2-mod-php from the install and then adding

a2dismod mpm_prefork

a2enmod mpm_event http2

By: till at: 2019-08-11 14:32:30

You can either have mod_php support (which is used by this guide) or http/2. If you enable http/2, mod_php will not be available anymore. So don't try to switch a site in ISPConfig to mod_php on your setup.

By: SamTzu at: 2019-08-11 18:07:21

MariaDB/MySQL: Could not access mysql console with password "mysql -u root -p". Only without password. "mysql -u root".LXC container: Had to enable "nesting=1" Proxmox/LXC/Options/Features to get MariaDB/MySQL to run on Debian 10 (Buster).

By: SamTzu at: 2019-08-11 18:08:08

Thanx Till.

By: Fabrice at: 2019-08-24 08:23:49

Thank you for this tuto.

I didn't find the way to use Postfix with the server, do you know a good tutorial for that?

Thanks

Fabrice

By: till at: 2019-08-24 11:24:16

Postfix is fully installed and configured ready to be used when you followed this tutorial, there is no further tutorial needed. Just add an email domain and mailbox in ispconfig, that's all. If you need further help, please post in the ISPConfig forum here at howtoforge.

By: Mark at: 2019-09-08 09:54:13

Hi Till,

I have followed every step of this great tutorial, but I have problems sending and receiving emails. 

When ispconfig was just installed, the first thing I did was to create a website. I have registered the same domain that the server, so the server has the domain (hostname) server1.myweb.com and I created the website myweb.com in ispconfig. Then I went to the "Emails" section of ispconfig and added the domain, and then added the mailbox [email protected]

Then I went to webmail from the button next to the mailbox and entered roundcube. I have tried to send an email to my personal gmail and within a few seconds I receive an error email.

This is the mail system at host server1.traffickersworld.com.I'm sorry to have to inform you that your message could notbe delivered to one or more recipients. It's attached below.For further assistance, please send mail to postmaster.If you do so, please include this problem report. You candelete your own text from the attached returned message.                   The mail system<[email protected]>: host    gmail-smtp-in.l.google.com[2a00:1450:400c:c00::1a] said: 550-5.7.1    [2a01:4f8:c2c:ba4f::1] Our system has detected that this message does    550-5.7.1 not meet IPv6 sending guidelines regarding PTR records and    550-5.7.1 authentication. Please review 550-5.7.1    https://support.google.com/mail/?p=IPv6AuthError for more information 550    5.7.1 . a14si8675561wmg.44 - gsmtp (in reply to end of DATA command) Reporting-MTA: dns; server1.myweb.comX-Postfix-Queue-ID: 1CF1121249X-Postfix-Sender: rfc822; [email protected]: Sun,  8 Sep 2019 11:29:57 +0200 (CEST)Final-Recipient: rfc822; [email protected]: rfc822;[email protected]: failedStatus: 5.7.1Remote-MTA: dns; gmail-smtp-in.l.google.comDiagnostic-Code: smtp; 550-5.7.1 [2a01:4f8:c2c:ba4f::1] Our system has detected    that this message does 550-5.7.1 not meet IPv6 sending guidelines regarding    PTR records and 550-5.7.1 authentication. Please review 550-5.7.1    https://support.google.com/mail/?p=IPv6AuthError for more information 550    5.7.1 . a14si8675561wmg.44 - gsmtp

In the error message I have pasted here before, obviously I replaced my real domain for "myweb" and my personal gmail email for "mypersonalemail" for privacy.

Could you help me? I bought the ispconfig manual, but I don't know the best way to set up an email for a domain.

I have to tell you that as the use of ispconfig, it will be personal, I have not created any client, or any reseller.

Thank you Till!

By: till at: 2019-09-09 05:57:15

Hi Mark, please post your support question in the iSPConfig forum so we can help you figure out what the problem with your mail server setup is: https://www.howtoforge.com/community/#ispconfig-3.23

By: Bakha at: 2019-08-28 17:50:34

I have a problem with pureftpd when create users ftp not working (can not connect)

fix it please or please double-check the commands

By: till at: 2019-08-28 18:00:00

Tested it today, the tutorial is working öperfectly, nothing to be changed.  Your problem is not related to an issue in this tutorial. When you can't connect to FTP then you either did not follow the tutorial closely or you have closed the FTP ports in an external firewall or used a wrong IP or hostname to connect or something similar. Please post in the ISPConfig forum here at howtoforge if you need further help to find out what's wrong with your server.

By: Fenna at: 2019-08-29 10:52:36

Thx for another update on this concept of seting up a server system. Been using these tutorials for years and always happy with the result. This incarnation is no different :)

By: Fabrice at: 2019-08-30 20:09:47

Hi All,

After the installation on Debian10, I can't send an email thru php (Wordpress).

Command mail doesn't exist.

I put SMTP information in ISPConfig for roundcube (works for roundcube)

Thanks

 

Fabrice

By: Eric at: 2019-09-01 02:23:53

Hi,I tried the install, great work.  However, I did skip some steps and modified a few.

 

tks.

By: Nick at: 2019-09-09 12:11:44

Hi Till

Perfect servers through perfect tutorials. However I have a big stone in my shoe and its called Amavis crap. I have 4 separate hardware HP servers all running beautifully however amavis crashes on all 4 of them at irregular intervals and has to be restarted every now and then even at boot. This piece of crap software would keep all the emails hostage to its wellbeing and have to keep an eye on it every hour to make sure it doesnt crash. Please advise work-around pls.

By: Nick at: 2019-09-10 08:39:02

I have upgraded from stretch to Buster and have faced a lot of ssl dovecot problems which I uninstalled and reinstalled however ISPConfig does not seem to be able to update user mail and other records. Do I need to reinstall ISPConfig or follow any of the above steps again?

By: till at: 2019-09-10 09:21:26

Do not uninstall ispconfig as you would not be able to install it again without loosing all config. Follow the above guide to ensure all packages are installed and then run an ispconfig update with reconfigure services = yes. If you need further help, post in the ISPConfig support forum here at howtoforge.

By: Eric at: 2019-09-13 22:53:52

That is 'pma' ?  Is this a user name you created?

By: Leighton Walters at: 2019-09-16 03:00:30

This tutorial is quite straightforward and error-free. I was able to complete it without any errors in one attempt. Five stars!

By: Anahata at: 2019-09-17 09:38:14

I completed the installation, but when I visit the control panel, Firefox refuses to connect because it doesn't trust a self-signed certificate, and won't allow an exception because of HSTS. Chrome does the same.

The only thing I did different was to set the password to something more secure than 'admin' during the install, but I don't expect that to be a problem.

I uninstalled and re-installed ispconfig, with the same result.

By: till at: 2019-09-17 09:59:46

The warning that you see is caused by the self-signed SSL certificate, that#s ok and not an installation issue, you can simply accept the warning in the browser to proceed. Or you install another SSL cert for ISPConfig if you have already one for the hostname of the server or you install one from Let's encrypt: https://www.howtoforge.com/tutorial/securing-ispconfig-3-with-a-free-lets-encrypt-ssl-certificate/

By: Anahata at: 2019-09-17 12:15:53

No, the browser won't let me "accept the warning" and continue because of HSTS. Even if I tell Firefox to 'forget' the site (which should clear the HSTS setting) it's the same. I've commented out the apache2 ispconfig.vhost settings relating to Strict Tranport Security and Content Security Policy and that hasn't helped either.

The instructions you linked to, for LetsEncrypt, seem to assume I have a working ISPConfig panel, which I don't. I'll try the shell commands to symlink the Letscrypt certificate data to /usr/local/ispconfig/interface/ssl, but I've already tried that once and it didn't work.

 

By: till at: 2019-09-17 13:19:58

Accepting the error message usually works, I install this setup several times a week using self-signed certificates and I'm always able to accept the self signed cert in all major browsers, so your problem is not this setup and not the settings of the ispconfig vhost. Your problem is probably the domain that you use for the server hostname, if you used that domain or subdomain before and used it with hsts, then your browser will block it if you reuse it with another cert now, no matter of the settings in ispconfig vhost. If you can't login by ssl, disable ssl in the vhost, login by http, create the LE based vhost and follow the guide that I posted the link to and then enable ssl in the vhost again.

By: Anahata at: 2019-09-17 15:52:38

Thank you - you are absolutely right, the browser has visited the main domain and other subdomains with HSTS and after I cleared all its memory of them, I was able to reach the ISPconfig panel.

By: Bertrand at: 2019-09-18 04:32:09

Great tutorial ! thank you, it just misses the package patch to launch the install of ISPConfig

By: till at: 2019-09-18 05:23:21

The patch package is installed if you followed all steps. You probably left a step out (most likely jailkit) if patch was missing on your system.

By: Jawad at: 2019-09-19 00:25:30

Hello, thank you for support

I can send email using roundcube, but i cant recive it from external.

i sent it only from internal sending from [email protected] to [email protected] for example.

thank you 

By: Jeff BRyner at: 2019-09-25 02:30:47

Good install, all went well. One "Feature" Id like to control is that if you go to the IP address of the server it bypasses any available site on the ISPConfig system and dumps to a default page served by Apache. Is there any way to control this or eliminate it?

By: till at: 2019-09-25 08:21:33

That's the way an apache web server is working, so that's not ISPConfig specific. You have to use either * or the Ip for all sites that use the same IP in DNS, don't mix it. If you don't want to use IP addresses in apache, delete the IP under System > Server IP.

By: Paolo at: 2019-09-25 09:25:26

Reading the howto it seems that Mailman 2.x is used.. Is it possible to upgrade to Mailman 3.x or Ispconfig needs some module rewriting before using the latest version?

By: Jawad at: 2019-09-30 00:51:44

Hi

Please, I install ISPConfig according this guide, All is ok, but i have 2 Address IP, I add the 2nd IP in  /etc/network/interfaces before installation, and the ISPConfig has detect the both IP. but i want to make all website work with 2 ip. for my principal domain I make dns as :

NS1 : ns1.domain.com with IPv4(1)

NS2 : ns2.domain.com with IPv4(2)

NS3 : ns3.domain.com with IPv6

by default whene i put (in the browser) the 1st IPv4, i get my domain.com website, but if i put 2nd IPv4 i get Apache2 Debian Default Page.

Please, how to make the 2nd IPv4 as secondary IP for all website.

Thank you

By: till at: 2019-09-30 05:28:31

Choose * in the IPv4 field for all sites instead of the first or second IP address.

By: Jawad at: 2019-09-30 19:20:04

Thank you Mr TILL

I change it, but allways show default apache page for the 2nd IP

By: Mike Conom at: 2019-10-01 11:17:23

Hi,Can you tell me what is better for hostnameI have a vps server as vpsXXXXXX.ovh.net

nano /etc/hosts

 

127.0.0.1 localhost.localdomain localhost 51.xx.xx.xx server1.example.com server1or 51.xx.xx.xx server1.vpsXXXXXX.ovh.net server1

 

Then edit the /etc/hostname file:

 

nano /etc/hostname

 

It shall contain only the subdomain part, in our case:

 

server1orvpsXXXXXX

Thanks in advance

 

 

By: till at: 2019-10-01 11:26:54

Don't add vpsxxxx to the name, it might lead other mail servers to treat your server differently. If you run just one server, you can even just use "server.yourdomain.tld" as server name. of if its mainly a mail server "mail.yourdomain.tld" or something similar. I would avoid words like vps or too many numbers in the name, besides that, you are free to choose whatever subdomain you want. Just take care to use the name consistantly and that it really exists in dns and points to your server IP.

By: Mike Conom at: 2019-10-01 11:48:54

As i understand the best way is

nano /etc/hosts

127.0.0.1 localhost.localdomain localhost

51.xx.xx.xx server.example.com server

 

nano /etc/hostname

server

By: Jawad at: 2019-10-03 00:14:54

Hi

Please How can i configure mariadb to use ssl connection?

THank you

By: Dan at: 2019-10-06 07:34:10

So i did exactly everything noted here (doing this on my pi4) and it refuses to connect via the IP or hostname? ideas?

By: schmidtchen_ at: 2019-10-14 14:32:47

Great work.

Maybe "Require all denied" is better then

Order Deny,Allow Deny from All