Home FreeBSD FreeBSD: Install Roundcube Web Mail Client on FreeBSD 10

FreeBSD: Install Roundcube Web Mail Client on FreeBSD 10

by Kliment Andreev

In one of my previous posts, I’ve described how to install Roundcube web mail client on a CentOS Linux box. This time, I’ll do the same for FreeBSD.

There are some prerequisites. First, you need a working FAMP stack (FreeBSD, Apache, MySQL and PHP). Read here how to install this. Then, you need a working mail server. You can also read here how to do this. Once you have that completed and tested, we can install Roundcube from the packages.

pkg install roundcube
pkg install php5-fileinfo php5-openssl php5-mcrypt php5-exif php5-gd php5-curl

The install will create a directory /usr/local/www/roundcube. This is your DocumentRoot. You can rename or move the directory somewhere else if you want. Also, change the owner of this folder, so Apache has full access to it. You will also have to restart Apache, because some extra PHP modules are installed.

cd /usr/local/www
chown -R www:www roundcube
apachectl graceful

First, create the database.

mysql -u root -p
create database roundcube;
grant all privileges on roundcube.* to 'roundcube'@'localhost' identified by 'password';
flush privileges;

This will create a database called roundcube and a MySQL user called roundcube with password…well password, so replace the values to suit your needs. Now, browse to the DocumentRoot, the directory where you installed Roundcube, by doing http://yourserver.com/roundcube/installer or http://roundcube.yourserver.com/installer.

You should see something like this.

…and this.

Click Next at the bottom to reach step 2. Create Config. Look for the Database setup and enter the database name and the credentials that you’ve created above in MySQL.

For the IMAP settings, use ssl://localhost and port 993.

For SMTP settings type tls://localhost and port 587. Check “Use the current IMAP username…“.

Scroll all the way at the bottom and click Create Config. Roundcube will create the config file for you. Click Continue.

You will notice that the database is not initialized, so click Initialize database.

In addition edit the defaults.inc.php file in the same config folder and change the line so it looks like this.

$config['mime_types'] = '/usr/local/etc/apache24/mime.types';

If you want, you can test the sending/receiving with the provided test buttons. If you receive an error, you are probably using PHP 5.6+. As of this version, if you have self-signed certificates, this won’t work.

Look at the bottom where it says “After completing the installation and the final tests please remove the whole installer folder from the document root of the webserver or make sure that enable_installer option in config.inc.php is disabled.”

Do that and then browse to the DocumentRoot.

Roundcube plugins

If you want to install the plugin manager, go to this web site and click on “DownloadPlugin Manager Roundcube 1.0.x”. Put the plugins.zip file under the DocumentRoot folder and unzip it.

unzip plugins.zip
chown -R www:www plugins

Then edit DocumentRoot/config/config.inc.php and insert “plugin_manager” as shown below.

// ----------------------------------
// ----------------------------------
// List of active plugins (in plugins/ directory)
$config['plugins'] = array('plugin_manager');

Log in to Roundcube and you’ll see this.

Make sure that you have a good database backup and then click Submit. You’ll be logged off. Log back again and click About in the upper left corner. The installer will tell you to create the following file in the DocumentRoot.

Create the file with:

touch <whateverfilename>
chown -R www:www <wahteverfilename>

Log off, log back on and go to Settings (upper right corner). You’ll see this.

Click on Manage Plugins and then Plugins downloads. You’ll see something like this.

Some of the plugins are not free. We’ll install one free plugin (calendar) just to show how things work. The procedure applies to all free/non-free plugins.

First, click on “Discard incurring costs downloads” and then click Download ZIP-Archive. Save this file and transfer it to the server. Put it under DocumentRoot.
Once extracted with unzip -o, click on Settings, then Manage Plugins | Settings and then Global Plugins as shown below.

Enable the “Database based plugins configuration” and then click Start Adjustments.

You’ll have to accept the change again.

Click on “Calendaring”, enable the plugin and log out.

Log back in and you’ll see the calendar.

Related Articles

Leave a Comment

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More