Guide On How To Install Roundcube On FreeBSD

A step by step guide on how to install Roundcube on FreeBSD

Roundcube is somehow a popular webmail client. This is probably because of it’s nice user interface. Now Roundcube requires a database to run where as Squirrelmail does not. In this guide we will hook up Roundcube to a MySQL database.

Now for me Roundcube is not an option as a webmail client and I choose Squirrelmail over Roundcube. Thats not because Roundcube is harder to install. It’s quite easy in fact. But Roundcube lacks important things such as mail filtering options, remote pop etc. Calendar is now somewhat supported by a plugin.

But never the less a lot of people like the “Ajax” style interface and that’s fine. So here it is, the guide that is.

Now I know is just told you that Roundcube is easy to install and setup which is perfectly true. But when it comes to running it in another language than English with Courier IMAP it suddenly becomes a bitch.

But regardless what language you will end up using the initial installation and setup remains the same.

I will provide a short guide later on how to fix the language headaches you will run into when running Roundcube with Courier IMAP in other languages than English.

As a FreeBSD user we can install Roundcube from ports.

Note: Before you start if you run the installation below Roundcube will also install Apache, PHP, and MySQL which is not desirable. I strongly suggest you have these installed prior to running the Roundcube installation.

As root

cd /usr/ports/mail/roundcube/ && make install clean

Add the following to your httpd.conf file so we can access Roundcube through a browser.

As root

Alias /roundcube "/usr/local/www/roundcube/"

<Directory "/usr/local/www/roundcube">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

Remember to restart apache.

As root

apachectl restart

As mentioned before Roundcube needs a database in order to run. You can create one yourself or create one very fast by following the few MySQL command line options below (My life is to short for PhpMyadmin)

As root

# mysql -u root -p

Enter the MySQL superuser password when prompted. In the next few line replace “user” with the username you would like to use with the Roundcube database and “password” with the password you would like to use with the Roundcube database

As root

mysql> connect mysql
mysql> create database roundcubemail;
mysql> GRANT ALL PRIVILEGES ON roundcubemail TO 'user'@'localhost' IDENTIFIED BY 'password';
mysql> FLUSH PRIVILEGES;
mysql> GRANT ALL PRIVILEGES ON roundcubemail.* TO 'user'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
mysql> exit

Once the database is created we need to adjust the Roundcube configuration file accordingly.

As root

cd /usr/local/www/roundcube/config
vi db.inc.php

As root find the following line

$rcmail_config['db_dsnw'] = ‘mysql://roundcube:pass@localhost/roundcubemail’;

Replace “roundcube” with the username you entered when you created the MySQL database. Also exchange the “pass” with the password you entered when you created the MySQL database.

The next step is optional. You can setup Roundcube so it doesn’t ask you for the Imap server name every time you login. Or you can leave it blank so that every user must fill this out.

As root optional

cd /usr/local/www/roundcube/config
vi main.inc.php

As root find this line

$rcmail_config['default_host'] = ‘ ‘;

And insert you machines IP number so it will look like below where xxx.xxx.xxx.xxx represents your IP Number.

Result

$rcmail_config['default_host'] = ‘xxx.xxx.xxx.xxx’;

Finally we need to import the standard database structure for Roundcube.

replace user with the username you entered when you created the MySQL database for Roundcube. Also type in the username you entered when you created the MySQL database for Roundcube when prompted. And replace the database with the name of the database you created in MySQL i.e. roundcubemail

As root

cd /usr/local/www/roundcube/SQL
mysql -u user -p database < mysql.initial.sql

Access Roundcube from your browser by using http://IP Number/roundcube or http://www.yourdomain.com/roundcube

How To Install Apache 2.2 With Php5 On FreeBSD  How To Install Apache 1.3 With Php5 On FreeBSD  Guide On How To Install MySQL On FreeBSD  Guide On How To Install Courier Imap On FreeBSD  How To Fix Roundcube Language Issues On FreeBSD

Official Roundcube Site