How To Install RoundCube 0.7 For ISPConfig 3 On Debian Squeeze

Want to support HowtoForge? Become a subscriber!
 
Submitted by SwOsHiE (Contact Author) (Forums) on Wed, 2011-12-21 17:14. :: Debian | ISPConfig | Linux | Apache | Email

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 solutions http://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)


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Alex (not registered) on Sat, 2013-06-22 09:08.
Hi,
I installed my RC and using it without much trouble in sending and receiving mails but i have this problem of sending attachments. My attachments keep showing attaching but does not finish. I checked & found out that only attachments exceeding 100kb are not being attached. I have verified the upload, post and memory parameters in php.ini are all perfect. (50M,50M and 128M) respectively.
I have no clue why this is happening?
Thankx, 
 

 

Submitted by Alex (not registered) on Mon, 2013-06-24 07:28.

Hi,

  I reinstalled with the above confi and the installation is working perfect but now i am not able to see my mailbox's and settings etc from my ispconfig "Email" module..

 Some one help.

 Thankx.

Submitted by feby (not registered) on Wed, 2012-12-19 14:00.

Had a few problems with apt-get install roundcube but after removing every little piece of that install and followed this tutorial, it worked like a charm.

Thanks, tested it on Ubuntu Server 12.10 configured from the tutorial the perfect Ubuntu server 12.10 from this site.

E'mails went and got reply from them in a gif'

Submitted by Crackerjack (not registered) on Mon, 2012-02-13 17:43.

Thx for sharing.

I had to do a :

chown vmail:mail /var/vmail

For Roundcube to work ...

Submitted by butun gazeteler (not registered) on Mon, 2012-01-09 15:47.
Very nice sharing thank you very much
Submitted by xxs (not registered) on Fri, 2012-01-06 20:07.

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

must be

# 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

        <IfModule mod_php5.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>
# 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>

to make sure it is working if the customer webspace doesn't use mod_php

Submitted by Nick (not registered) on Mon, 2013-09-23 15:03.
Thanks this worked great for my server :)
Submitted by Bogdan (not registered) on Tue, 2013-05-28 21:39.
Thanks XXS for your solution, i've also had a few pages with ERROR 500
Submitted by Switchup (not registered) on Sun, 2013-02-10 11:12.

Big Big Thanks !

it's working great !
Submitted by mrekko (not registered) on Sun, 2012-09-09 23:46.
Thanks! ;)
Submitted by R Costa (not registered) on Sat, 2012-03-10 12:31.

thanks xxs

my one was not working in some domains (error 500) and i was trying guess why!