How to upgrade Roundcube 0.3 to 0.7 on Ubuntu 10.04 LTS

Discussion in 'Tips/Tricks/Mods' started by cbj4074, Jan 12, 2012.

  1. cbj4074

    cbj4074 Member

    For those who wish to use the Roundcube webmail plug-in for ISPConfig3 ( http://bugs.web-wack.at/projects/isp3-roundcube ) on Ubuntu 10.04, you will have to upgrade Roundcube from 0.3.x (the latest stable version available via the Ubuntu repositories) to 0.7.x (the latest stable version available from the authors).

    One method is to remove the Roundcube package altogether and install manually ( e.g., http://www.howtoforge.com/how-to-install-roundcube-0.7-for-ispconfig-3-on-debian-squeeze ).

    However, for those who prefer to use packages whenever possible, here's the alternative.

    1.)

    Download the required packages for the new version of Roundcube from the Debian repositories.

    Each file can be downloaded using the wget command:

    Code:
    # wget [URL of file]
    
    The files will be stored in your current working directory.

    Roundcube 0.7 requires:

    libjs-jquery
    libjs-jquery-ui
    php-net-smtp (>= 1.4.2)
    php-mail-mime (>= 1.8.0)
    libjs-jquery (>= 1.6.4)
    libjs-jquery-ui (>= 1.8)

    2.)

    Remove the currently-installed version of Roundcube. These steps can be combined into a single step, but each is presented separately for the sake of clarity.

    Code:
    # apt-get remove --purge roundcube
    
    Code:
    # apt-get remove --purge roundcube-core
    
    You should be prompted to remove the underlying database; choose "Yes" and provide the appropriate MySQL password (usually the MySQL root user's password).

    Code:
    # apt-get remove --purge roundcube-mysql
    
    Code:
    # apt-get remove --purge roundcube-sqlite
    
    The next two packages may not be installed, but it doesn't hurt to execute these commands, just in case.

    Code:
    # apt-get remove --purge libjs-jquery
    
    Code:
    # apt-get remove --purge libjs-jquery-ui
    
    3.)

    Install the new version of Roundcube from the packages that you downloaded. The order matters, due to package dependencies.

    Use the dpkg application to install each package, e.g.:

    Code:
    # dpkg -i ./package-name.deb
    
    in the following order:

    libjs-jquery
    libjs-jquery-ui
    php-mail-mime
    php-net-smtp
    roundcube-sqlite
    roundcube-mysql
    roundcube-core

    If at this point you receive dependency errors regarding the php5-intl and/or the libicu42 package, execute the following command:

    Code:
    # apt-get -f install
    
    and the dependencies should be resolved automatically, and the roundcube-core package will be installed immediately thereafter.

    You will be prompted to configure the database for Roundcube. Most likely, you will want to choose the "mysql" option. Again, enter the appropriate MySQL password (usually the root user's password).

    On the next screen, enter a password for the Roundcube database, or leave the field blank to have the system generate a strong password for you.

    roundcube

    That's the last package! Now to configure Roundcube.

    4.)

    There are four Roundcube directories that are created:

    Code:
    /usr/share/roundcube (do not make changes here)
    /var/lib/roundcube (DO make changes/customizations here)
    /var/log/roundcube
    /etc/roundcube (do not make changes here)
    
    The /var/lib/roundcube directory contains symbolic links (symlinks) to various locations throughout the other three directories, so be sure to make your changes here and not in the target directories (otherwise, you may end-up with a botched installation in the future).

    The Roundcube package for Debian has Arabic as the default language, so change that first:

    Code:
    # vi /var/lib/roundcube/config/main.inc.php
    
    and change line 380 to suit your language preference, e.g.:

    Code:
    $rcmail_config['language'] = 'en_US';
    
    If you wish to customize or "brand" the Roundcube interface, change line 292 accordingly, e.g.:

    Code:
    $rcmail_config['product_name'] = 'My Company\'s Webmail';
    
    If you are not using multiple mail servers, and your only mail server is running on the same network interface (i.e., the same server) as the Web server, you can spare your users the trouble of having to enter a mail server at login by specifying the default value on line 72, e.g.:

    Code:
    $rcmail_config['default_host'] = 'localhost';
    
    Assuming you have a functioning SMTP service (e.g., Postfix) on this server, you should direct Roundcube to send mail via SMTP on line 138 (otherwise Roundcube will use PHP's mail functions, which are much slower):

    Code:
    $rcmail_config['smtp_server'] = '%h';
    
    If your Web server is SSL-enabled (you should enable SSL, even if with a self-signed certificate), modify line 189 to force Roundcube to take advantage of this (we'll configure Apache accordingly in a subsequent step):

    Code:
    $rcmail_config['force_https'] = true;
    
    There are a few other worthwhile tips in the article cited at the top of this post:

    The final configuration step is to create an alias in your Apache configuration. This can be done in any of several different places, but the most logical place to make the change is in /etc/apache2/conf.d/roundcube.conf, as this file is included in Apache's configuration automatically.

    Code:
    # Add this line at the top of the file.
    Alias /webmail /var/lib/roundcube
    
    # Add these lines just after the "allow from all" within
    # the <Directory /var/lib/roundcube/> block.
    # Lines below this (within this Directory block) are custom.
      <IfModule mod_rewrite.c>
        <IfModule mod_ssl.c>
          RewriteCond %{HTTPS} !=on
          RewriteRule ^.*$ https://%{SERVER_NAME}:%{SERVER_PORT}%{REQUEST_URI} [R,L]
        </IfModule>
      </IfModule>
      <IfModule suphp_module>
        suPHP_Engine Off
        AddHandler php5-script	.php
      </IfModule>
      php_admin_value open_basedir "/usr/share/php:/etc/roundcube/:/usr/share/roundcube:/var/log/roundcube:/var/lib/roundcube"
    
    Note: The above configuration is slightly more dynamic than that used in the "official How To" in that the mod_rewrite rule does not require the server name, port, or webmail URI to be hard-coded. Better still, I have added directives to ensure that Roundcube works even if suPHP is enabled (e.g., when using Fast-CGI PHP mode with Apache's su_php module).

    Reload the Apache configuration:

    Code:
    # service apache2 reload
    
    5.)

    Install the Roundcube webmail plug-in for ISPConfig3 by following the instructions on the plug-in's website:

    http://bugs.web-wack.at/documents/1

    The directory to be in before executing the SVN checkout command is /var/lib/roundcube/plugins:

    Code:
    # cd /var/lib/roundcube/plugins
    
    Any questions or problems are most likely addressed in the official FAQ on the plug-in's website, which has a forum if not.

    Good luck!
     
    Last edited: Jan 12, 2012
  2. cbj4074

    cbj4074 Member

    One small correction: the path to the Apache configuration file that is included with most Roundcube packages is

    Code:
    /etc/apache2/conf.d/roundcube
    
    and not

    Code:
    /etc/apache2/conf.d/roundcube.conf
    
    as stated in my initial post.
     

Share This Page