FreeBSD: Install Roundcube Web Mail Client on FreeBSD 10

by Kliment Andreev
0 comment
Reading Time: 4 minutes

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;
quit

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.

Capture

…and this.

cap2

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.

cap3

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

cap4

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

cap5

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.

4

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.

cap6

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.

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

Log in to Roundcube and you’ll see this.

cap7

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.

cap9

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.

cap10

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

cap12

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.

cap2

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

cap3

You’ll have to accept the change again.

cap4

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

cap5

Log back in and you’ll see the calendar.

cap6

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