There is a new version of this tutorial available for Debian 10 (Buster).

The Perfect Server - Debian 9 (Nginx, BIND, Dovecot, ISPConfig 3.1) - Page 3

18 Install RoundCube

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
Password of the databases administrative user: <-- enter the MySQL root password here.

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';

ISPConfig has some configuration in the nginx apps vhost for squirrelmail which works for roundcube as well. We activate it with:

ln -s /usr/share/roundcube /usr/share/squirrelmail

Now you can access RoundCube as follows:

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

Roundcube on Nginx

 

19 Install ISPConfig 3

Before you start the ISPConfig installation, make sure that Apache is stopped (if it is installed - it is possible that some of your installed packages have installed Apache as a dependency without you knowing). If Apache2 is already installed on the system, stop it now...

service apache2 stop

... and remove Apache's system startup links:

update-rc.d -f apache2 remove

Make sure that nginx is running:

service nginx restart

(If you have both Apache and nginx installed, the installer asks you which one you want to use: Apache and nginx detected. Select server to use for ISPConfig: (apache,nginx) [apache]:

Type nginx. If only Apache or nginx are installed, this is automatically detected by the installer, and no question is asked.)

To install ISPConfig 3.1 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/

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, Niginx, Dovecot, etc. for you.

# php -q install.php

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

>> Initial configuration
Operating System: Debian 9.0 (Stretch) 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.canomi.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
Apache and nginx detected. Select server to use for ISPConfig: (apache,nginx) [apache]: <-- nginx

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 Nginx
Configuring vlogger
Configuring Metronome XMPP Server
writing new private key to 'localhost.key'
-----
Country Name (2 letter code) [AU]: <-- Enter 2 letter country code
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) [server1.canomi.com]: <-- Enter the server hostname, in my case: server1.example.com
Email Address []: <-- Hit Enter
Configuring UFW Firewall
Configuring Fail2ban
[INFO] service OpenVZ not detected
Configuring Apps vhost
Installing ISPConfig
ISPConfig Port [8080]:
Admin password [admin]: <-- Enter desired ISPConfig admin user password here
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.

Afterward you can access ISPConfig 3 under http(s)://server1.example.com:8080/ or http(s)://192.168.1.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

ISPConfig Dashboard

The system is now ready to be used.

21 Additional Notes

21.1 OpenVZ

If the Debian server that you've just set up in this tutorial is an OpenVZ container (virtual machine), you should do this on the host system (I'm assuming that the ID of the OpenVZ container is 101 - replace it with the correct VPSID on your system):

VPSID=101
for CAP in CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_ADMIN SYS_CHROOT SYS_NICE CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_ADMIN SYS_CHROOT SYS_NICE
do
  vzctl set $VPSID --capability ${CAP}:on --save
done

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: howtoforge

MySQL Login

Username: root
Password: howtoforge

The IP of the VM is 192.168.1.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

10 Comment(s)

Add comment

Comments

By: peri0603

And also here i didn't get asked for the Password of the databases administrative user: <-- enter the MySQL root password here.

[email protected]:/tmp# apt-get install roundcube roundcube-core roundcube-mysql roundcube-pluginsReading package lists... DoneBuilding dependency treeReading state information... DoneThe following additional packages will be installed:  php-auth-sasl php-mail-mime php-net-smtp php-net-socketSuggested packages:  php-net-ldap2 php-crypt-gpg php-net-ldap3 php-net-sieveThe following NEW packages will be installed:  php-auth-sasl php-mail-mime php-net-smtp php-net-socket roundcube  roundcube-core roundcube-mysql roundcube-plugins0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.Need to get 2,928 kB of archives.After this operation, 17.7 MB of additional disk space will be used.Do you want to continue? [Y/n] yGet:1 http://ftp.de.debian.org/debian stretch/main amd64 roundcube-mysql all 1.2.3+dfsg.1-4+deb9u1 [70.9 kB]Get:2 http://ftp.de.debian.org/debian stretch/main amd64 php-net-socket all 1.0.14-2 [10.3 kB]Get:3 http://ftp.de.debian.org/debian stretch/main amd64 php-auth-sasl all 1.0.6-3 [13.4 kB]Get:4 http://ftp.de.debian.org/debian stretch/main amd64 php-mail-mime all 1.10.0-2 [38.0 kB]Get:5 http://ftp.de.debian.org/debian stretch/main amd64 php-net-smtp all 1.7.1-2 [20.1 kB]Get:6 http://ftp.de.debian.org/debian stretch/main amd64 roundcube-core all 1.2.3+dfsg.1-4+deb9u1 [2,113 kB]Get:7 http://ftp.de.debian.org/debian stretch/main amd64 roundcube all 1.2.3+dfsg.1-4+deb9u1 [1,380 B]Get:8 http://ftp.de.debian.org/debian stretch/main amd64 roundcube-plugins all 1.2.3+dfsg.1-4+deb9u1 [661 kB]Fetched 2,928 kB in 0s (5,534 kB/s)Preconfiguring packages ...Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.Selecting previously unselected package roundcube-mysql.(Reading database ... 54691 files and directories currently installed.)Preparing to unpack .../0-roundcube-mysql_1.2.3+dfsg.1-4+deb9u1_all.deb ...Unpacking roundcube-mysql (1.2.3+dfsg.1-4+deb9u1) ...Selecting previously unselected package php-net-socket.Preparing to unpack .../1-php-net-socket_1.0.14-2_all.deb ...Unpacking php-net-socket (1.0.14-2) ...Selecting previously unselected package php-auth-sasl.Preparing to unpack .../2-php-auth-sasl_1.0.6-3_all.deb ...Unpacking php-auth-sasl (1.0.6-3) ...Selecting previously unselected package php-mail-mime.Preparing to unpack .../3-php-mail-mime_1.10.0-2_all.deb ...Unpacking php-mail-mime (1.10.0-2) ...Selecting previously unselected package php-net-smtp.Preparing to unpack .../4-php-net-smtp_1.7.1-2_all.deb ...Unpacking php-net-smtp (1.7.1-2) ...Selecting previously unselected package roundcube-core.Preparing to unpack .../5-roundcube-core_1.2.3+dfsg.1-4+deb9u1_all.deb ...Unpacking roundcube-core (1.2.3+dfsg.1-4+deb9u1) ...Selecting previously unselected package roundcube.Preparing to unpack .../6-roundcube_1.2.3+dfsg.1-4+deb9u1_all.deb ...Unpacking roundcube (1.2.3+dfsg.1-4+deb9u1) ...Selecting previously unselected package roundcube-plugins.Preparing to unpack .../7-roundcube-plugins_1.2.3+dfsg.1-4+deb9u1_all.deb ...Unpacking roundcube-plugins (1.2.3+dfsg.1-4+deb9u1) ...Setting up php-auth-sasl (1.0.6-3) ...Setting up php-mail-mime (1.10.0-2) ...Setting up roundcube-mysql (1.2.3+dfsg.1-4+deb9u1) ...Setting up php-net-socket (1.0.14-2) ...Setting up php-net-smtp (1.7.1-2) ...Setting up roundcube-core (1.2.3+dfsg.1-4+deb9u1) ...Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.dbconfig-common: writing config to /etc/dbconfig-common/roundcube.confCreating config file /etc/dbconfig-common/roundcube.conf with new versionCreating config file /etc/roundcube/debian-db.php with new versionchecking privileges on database roundcube for [email protected]: user creation needed.granting access to database roundcube for [email protected]: success.verifying access for [email protected]: success.creating database roundcube: success.verifying database roundcube exists: success.populating database via sql...  done.dbconfig-common: flushing administrative passwordSetting up roundcube-plugins (1.2.3+dfsg.1-4+deb9u1) ...Setting up roundcube (1.2.3+dfsg.1-4+deb9u1) [email protected]:/tmp#

By: till

Your base system uses non-standard apt settings which suppress the dialog. The tutorial here is based on a standard Debian system and on such systems, you will see the questions as shown in the tutorial.

By: pfaf

For new installations, since Debian v9.8 which was released on 16 February 2019, when all installations are complete with ISPConfig v3.1.13, nobody can login into the ISPConfig interface because of a 502 Bad Gateway message.

I think is has something to do with the php version not detected correctly, it is recognized as php v5.5 I think.

We have another installationn done as Debian v9.7 which is working without any problems with ISPConfig v3.1.13.

On the erroneus installation, we tried to upgrade to ISPConfig 3.1.13p1 but this did not resolve the problem.

Has anyone found a solution, or workaround?

Kind regards to all,

Panos.

 

By: till

The problem has been addressed some time ago, seems as if you don't use the current ISPConfig version 3.1.13p1. I've just installed ISPConfig successfully on Debian 9.8.

By: pfaf

I think the problem is with file  install/lib/install.lib.php In specific the following line                 } elseif(strstr(trim(file_get_contents('/etc/debian_version')), '8') || substr(trim(file_get_contents('/etc/debian_version')),0,1) == '8') {

should be

                } elseif(strstr(trim(file_get_contents('/etc/debian_version')), '8.0') || substr(trim(file_get_contents('/etc/debian_version')),0,1) == '8') {

The problem is that Debian 9.8 is recognized as Debian 8 without the change we proposed above.

Likewise, the following line                } elseif(strstr(trim(file_get_contents('/etc/debian_version')), '9') || substr(trim(file_get_contents('/etc/debian_version')),0,1) == '9') { should change to                 } elseif(strstr(trim(file_get_contents('/etc/debian_version')), '9.0') || substr(trim(file_get_contents('/etc/debian_version')),0,1) == '9') {I will test and revert.

Kind regards to all,

Panos.

 

By: till

The code you posted does not exist in current ISPConfig version 3.1.13p1, it exists in old releases though. Please install the latest version as shown in the tutorial and not an older one.

By: pfaf

OK, even after updating the ispconfig.lib.php by hand or even upgrading to the latest ISPConfig v3.1.13p1 which seems to be corrected, I could not open the ISPConfig interface. The solution was to change permissions of the folder /var/lib/php7.0-fpm from drwx------ to drwxr-xr-x.

i.e.

cd /var/lib

chmod go+rx php7.0-fpm

That did the trick!

Many thanks to cbj4074 who posted the solution to the following thread.https://www.howtoforge.com/community/threads/perfect-server-for-ubuntu-16-but-with-nginx-instead-of-apache-socket-permission-issues.72883/

Kind regards to all,

Panos.

 

By: tal56

The Roundcube installation instructions no longer work.  You get an error of "config.inc.php not found".

I had to follow the instructions on the link below to fix it.  I know Debian 10 is out, but perhaps this should be fixed for people still installing on Debian 9.

 

https://www.faqforge.com/linux/controlpanels/ispconfig3/roundcube-error-config-inc-php-was-not-found/

By: FredZ

Where is the link to the VM?

By: till

In the menu on the right side, near the top, big red download icon. Below that Icon, you can find the download link.