29 mars 2024
roundcube mail

Installer RoundCube sur ISPConfig 3

How To Install RoundCube 0.7 For ISPConfig 3 On Debian Squeeze

Version 1.0
Author: Mattias Nurmi
Last edited: 19/12/2011

This will guide you thru the installation of the latest stable version of RoundCube (currently version 0.7) and get it to work together with ISPConfig 3.

I made this guide with the help of several different guides on the internet, including some from the Howtoforge site, I hope this will make the installation easier and up to date.

This guide should work for most Linux distributions but may differ on some parts.

I do not issue any guarantee that this will work for you!

 

1 Remove Squirrelmail (optional)

If you have squirrelmail installed and want to remove it, use the following command to uninstall:

apt-get remove squirrelmail

And also delete the configuration file in apache2 directory:

rm /etc/apache2/conf.d/squirrelmail.conf

 

2 Download and extract RoundCube

First we make a folder for the webmail and change directory:

mkdir /var/www/webmail/
cd /var/www/

Then we download the latest stable version of RoundCube from http://www.roundcube.net/download and extract it:

wget http://sourceforge.net/projects/roundcubemail/files/roundcubemail/0.7/roundcubemail-0.7.tar.gz
tar xfz roundcubemail-0.7.tar.gz
mv roundcubemail-0.7/* webmail
rm roundcubemail-0.7.tar.gz
rm -rf roundcubemail-0.7

Then we change directory and give some permissions to the /logs and /temp directories:

cd webmail
chown -R www-data:www-data temp/ logs/

 

3 Prepare the database

Now we want to add a user and database for our RoundCube installation. With MySQL you can set up the database by issuing the following commands:

CREATE DATABASE roundcubemail;
GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcubeuser@localhost IDENTIFIED BY ‘password’;

(Of course, you have to replace the database, username and password accordingly.)

Then we want to flush the users privileges or you will get a database connection error:

FLUSH PRIVILEGES;

 

4 Configuring RoundCube

Now point your browser to http://url-to-roundcube/installer/ and follow the instructions to start the installation of RoundCube. The first page shows the requirements, if everything is okay click « START INSTALLATION ». The installer checks if everything is there. In case you see some red NOT OK messages, you need to install or enable something. Follow the links to see what has to be done.

If everything checks out fine you are ready to create the configuration files, click « NEXT » to get there. Get through the form and change the settings according to your needs. Do not forget to enter the database setting that we made earlier within the « Database Setup » section.

When you are finished hit the « CREATE CONFIG » button and you will get two text boxes with the information for main.inc.php and db.inc.php that you must create in your /config directory.

Finally click « CONTINUE » and get to the last step of the installation process. Your configuration will now be verified and tested against your webserver. Click « Initialize database » to create the necessary tables in your database.

If there are no red NOT OK messages, you can also try to send a mail in order to test the SMTP settings.

Last but not least you have to remove the whole installer directory from the webserver. If this remains active it can expose the configuration including passwords. We do this with the following command:

rm -rf /var/www/webmail/installer

 

5 Adding aliases

For everyone to be able to access his webmail (under his domain name) you have to create or edit the file /etc/apache2/conf.d/roundcube.conf and add the alias « /webmail » and some more information about the directories:

In my case, I have only made this with a redirect to the default domain of the ISPConfig 3 installation with SSL for security and valid verifications

vi /etc/apache2/conf.d/roundcube.conf

# RoundCube alias and redirect functions
Alias /webmail /var/www/webmail
<Directory /var/www/webmail>
  Options +FollowSymLinks
  # This is needed to parse /var/www/webmail/.htaccess. See its
  # content before setting AllowOverride to None.
  AllowOverride All
  order allow,deny
  allow from all
</Directory>
# Protecting basic directories:
<Directory /var/www/webmail/config>
        Options -FollowSymLinks
        AllowOverride None
</Directory>
<Directory /var/www/webmail/temp>
        Options -FollowSymLinks
        AllowOverride None
        Order allow,deny
        Deny from all
</Directory>
<Directory /var/www/webmail/logs>
        Options -FollowSymLinks
        AllowOverride None
        Order allow,deny
        Deny from all
</Directory>
<IfModule mod_rewrite.c>
  <IfModule mod_ssl.c>
    <Location /webmail>
      RewriteEngine on
      RewriteCond %{HTTPS} !^on$ [NC]
      RewriteRule . https://www.yourdomain.com:8080/webmail/  [L]
    </Location>
  </IfModule>
</IfModule>

If you want to access the webmail with every domain without SSL you can just remove/comment out the mod_rewrite section. This might give you some errors, please look the following page (troubleshooting) for possible solutionshttp://trac.roundcube.net/wiki/Howto_Install

 

6 Final tweaks

We want to make some final tweeks in RoundCube by changing the following lines in main.inc.php:

vi /var/www/webmail/config/main.inc.php

[...]
$rcmail_config['message_cache_lifetime'] = '10d';
[...]
$rcmail_config['default_host'] = '';
[...]
$rcmail_config['smtp_server'] = '';
[...]
$rcmail_config['session_lifetime'] = 10;
[...]
$rcmail_config['create_default_folders'] = FALSE;
[...]

to:

[...]
$rcmail_config['message_cache_lifetime'] = '30m'; 
[...]
$rcmail_config['default_host'] = 'localhost';
[...]
$rcmail_config['smtp_server'] = '%h'; 
[...]
$rcmail_config['session_lifetime'] = 30; 
[...]
$rcmail_config['create_default_folders'] = TRUE;
[...]

Now go to http://www.yourdomain.com/webmail to access the newly created webmail interface.

 

Information

-More information about RoundCube: http://www.roundcube.net/
-Falko´s Howto The Perfect Server – Debian Squeeze (Debian 6.0) [ISPConfig 3]

 

Special Thanks to:

– Falko and Till. You make the world a better place!
– The HowtoForge team
– All people that contributed in some way in the making of this guide (external guides)

Laisser un commentaire