There is a new version of this tutorial available for Ubuntu 20.04 (Focal Fossa).

The Perfect Server - Ubuntu 16.04 (Xenial Xerus) with Apache, PHP, MySQL, PureFTPD, BIND, Postfix, Dovecot and ISPConfig 3.1 - Page 3

16. Install Roundcube Webmail

To install Roundcube Webmail, run:

apt-get install roundcube roundcube-core roundcube-mysql roundcube-plugins roundcube-plugins-extra javascript-common libjs-jquery-mousewheel php-net-sieve tinymce

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 apache configuration file.

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

and remove the # in front of the first 2 alias lines, add the two other "Alias" statements and add the line "AddType application/x-httpd-php .php" right after the "<Directory /var/lib/roundcube>" line:

# Those aliases do not work properly with several hosts on your apache server
# Uncomment them to use it or adapt them to your configuration
Alias /roundcube /var/lib/roundcube [...] <Directory /var/lib/roundcube> AddType application/x-httpd-php .php [...]

And restart apache

service apache2 restart

Then edit the RoundCube config.inc.php configuration file:

nano /etc/roundcube/config.inc.php

and change the default host to localhost:

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

This prevents that Roundcube will show server name input field in the login form.

17. Install ISPConfig 3

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

cd /tmp 
wget -O ispconfig.tar.gz https://git.ispconfig.org/ispconfig/ispconfig3/repository/archive.tar.gz?ref=stable-3.1
tar xfz ispconfig.tar.gz
cd ispconfig3*/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, 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 8.0 (Jessie) 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
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
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 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 there is no manual configuration 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.

18. Additional Notes

18.1 Fix MySQL Login for RoundCube

MariaDB enables a plugin called "unix_socket" for the root user by default, this plugin prevents that the root user can log in to PHPMyAdmin and that TCP connections to MySQL are working for the root user. Therefore, I'll deactivate that plugin with the following command:

echo "update user set plugin='' where User='root';" | mysql -root -p mysql

Enter the MySQL / MariaDB root password when requested.

18.2 OpenVZ

If the Ubuntu 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

18.3 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

This user has sudo rights.

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.

19. Links

Share this page:

Suggested articles

22 Comment(s)

Add comment

Comments

By: Tuumke

Ooeeeh! New ISP Config web interface! So shiny :D

By: Emir

I have follow all this steps one by one and I have finish my installation. But now when I try to access to http://myip:8080 page is loading for long time and ar the end i get message that page can not be loaded. Any suggestions?

 

By: till

This can be caused by a firewall or a router that blocks IP 8080 or apache is not running. Please use the forum to get support.

By: levien

Everthing was going well untill:

With filling in the last fields as required like the tutorial in installing of ispconfig3.1 itself, i get errors in the ssl with "too short"

It seems that the fields like 'organization' and 'email adress' has to be filled in....after that it has no errors.

But now i like to insert the roundcube plugins and tried the tutorial:

https://www.howtoforge.com/tutorial/roundcube-installation-on-debian-8-jessie/

After some changing paths from /opt to /var/lib everthing was ok.

Only the well known no connection soap error pops up after testing the plugins. (and yes, i used https in config.inc.php and made the rem. user in ispconfig and installed the ssl from the debian8 roundcube section tutorial)

Will there be an tutorial for roundcube ispconfig3.1 plugins in the near future?

By: Muhammad Musa

Excellent clear tutorial.

I went throught it without a little modification.

Thanks Till.

By: gab4mad

Everything works perfect, but I had the "problem" when I use the link for phpmyadmin from the ispconfig 3.1 panel, text was shown.

Maybe I did a mistake, I really don't know, but believe I didn't.

I fixed that by adding :

AddType application/x-httpd-php .php

right after <Directory /usr/share/phpmyadmin>

in the phpmyadmin.config, located at /etc/apache2/conf-enabled

Then save and restart apache and everything works fine for me!

This code snipet is also after <IfModule mod_php.c> - I guess that this ist only working when using mod_php ...

It is basicly the same procedure as for roundcube in /etc/apache2/conf-enabled/roundcube.conf

Maybe this helps someone.

 

Cheers

By: gab4mad

Everything works perfect, but I had the "problem" when I use the link for phpmyadmin from the ispconfig 3.1 panel, text was shown.

Maybe I did a mistake, I really don't know, but believe I didn't.

I fixed that by adding :

AddType application/x-httpd-php .php

right after <Directory /usr/share/phpmyadmin>

in the phpmyadmin.config, located at /etc/apache2/conf-enabled

Then save and restart apache and everything works fine for me!

This code snipet is also after <IfModule mod_php.c> - I guess that this ist only working when using mod_php ...

It is basicly the same procedure as for roundcube in /etc/apache2/conf-enabled/roundcube.conf

Maybe this helps someone.

 

Cheers

By: jamby

Solution for Amavis-new intall error. Amavis-new need correct server name on etc/hostname. Write full qualified server name eg. xx.yyy.com and install error solved on my ubuntu 16.04 lts.

By: Mutaz Hmaeed

 Virtual machine image download of this tutorial

?!!

where.. where?? O_O .. im looking all around

By: till

Big red download icon in the upper right menu.

By: Mario Díez Lorido

Hello, sorry for my English so basic. The tutorial is perfect and everything works perfectly. The problem is that when creating SSL links, does not generate the certificates BUNDLE. In the server links and links customers. Therefore https connections are not secure in relation to browsers. Thanks for your help and congratulations for this great help, a warm greeting.

By: emrahbil

Hello,

Thank you for this toturial this is perfect and clear.

By: KurtSt

I setup a server following the instructions above. Everything worked perfect, ISPconfig runs as expected. I upgrded it to ISPConfig 3.1.1p1.

Two problems I can't solve:

1. phpmyadmin

Error #1698 - Access denied for user 'root'@'localhost'

Is this the new security of MariaDB that prevents root login? In the database is a user phpmyadmin, but I never set a password for that one.

2. Roundcube

I can't access roundcube in the way www.mydomain.tld/Webmail or www.mydomain.tld/webmail. (ERROR 404 - Not Found!)

At least www.mydomain.tld/roundcube delivers an empty page. Do I have to install other things like ISPconfig Remote User or Modules?

By: KurtSt

 @KurtSt: The password for phpmyadmin can be found in /etc/dbconfig-common/roundcube.conf .

Access to phpmyadmin is http://<yourIP>/phpmyadmin .

By: ZagoDj

is it possible forward all spam to one spam-mail address (ex. [email protected]) whitout I also have a copy in the destination mail?

Now i've the same email, marked ***SPAM***, in both spam-mailbox and original destination-mailbox 

By: Denver Prophit Jr.

I want to know why Apache2 was used? NGINX supports http/2 and Apache is experimental still. I feel I get better performance out of NGINX. php fastcgi shared memory issues on shared hosting environments.

howtoforge supporter

Denver Prophit Jr.

By: till

As the title of this tutorial says, this guide is for Apache servers and that's why Apache is used and this tutorial supports the PHP mode mod_php, cgi_php and PHP-FPM beside the PHP-FCGI mode that you mentioned. Use the Nginx version of this tutorial if you like to use Nginx: https://www.howtoforge.com/tutorial/perfect-server-ubuntu-16-04-nginx-bind-dovecot-and-ispconfig-3/

By: C0rt3x

Hello,

thanks for good tutorial

By: andresgt2000

Hi I followed this full tutorial for Ubuntu server 16.04.3 LTS but when tried acces to the panel I get this error: 500 Internal  Server Error When I see  error log from apache I get this warning and error[Tue Aug 22 12:19:46.013840 2017] [fcgid:warn] [pid 5068] (104)Connection reset by peer: [client 192.0.1.26:41388] mod_fcgid: error reading data from FastCGI server[Tue Aug 22 12:19:46.014001 2017] [core:error] [pid 5068] [client 192.0.1.26:41388] End of script output before headers: index.phpI tried find a solution in the comments and in the forum but I not get a solution yet. Some one have got this error too?

By: jcmoinel

hi

i have download the .ova file, but le login password for ispconfig doesn't work :

ISPConfig Login

Username: adminPassword: howtoforge

Thank you

JC

By: till

Try user and password 'admin'.

By: Trebbor38

Hi,

Nice tutorila that even a NOOB like me can follow and use. (And after follwing the steps everything works great).

Now I have the possibility to use sevral and different Servers to run different services on (Mail-server, Owncloud-server, Webserver/Webblogger) but what I would like to have is one tutorial with all these standard services in for one server.

So users/administrators/sysops can use one tutorial with all the services and installations on 1 server.

Is it possilble to create/write something like this?

Mabye a nice suggestion for the new Ubuntu 18?

 

Greetz, Rob.