how to setup roundcubemail on gentoo
Tuesday, December 13th, 2005After using horde-imp mail for, well, since back in college, and squirrelmail for years — I finally decided to check out roundcubemail. It is fantastic, so far!
Fellow (and current) Georgia Techian, Paul Stamatiou has a much linked to document describing howto setup roundcube on MediaTemple and on FreeBSD. I’ll just add some shortcuts to his setup, but it is really good, and is what I glanced at before giving it a try myself.
First, I grabbed a tarball of the latest dev build:
# cd /var/www/webmail.example.com/htdocs-secure/
# wget [url_to_latest_roundcube_build_tarball]
# tar xzvf [roundcubemail_tarball].tar.gz
Then I moved it to a nicer directory (without the versioning number in the dir):
# mv roundcubemail-[version] roundcubemail
# cd roundcubemail
# mv config/db.inc.php.dist config/db.inc.php
# mv config/main.inc.php.dist config/main.inc.php
Then I edited the db.inc.php file, adding my own mysql table and user for the PEAR DSN string:
$rcmail_config['db_dsnw'] = 'mysql://user:password@localhost/roundcubemail';
I also edited the main.inc.php file to use secure IMAP on port 993 (since I don’t run unencrypted IMAP):
$rcmail_config['default_host'] = 'ssl://localhost:993';
// TCP port used for IMAP connections
$rcmail_config['default_port'] = 993;
Now to create that database (command-line style) and import the initial structure:
# mysql -u root -p
mysql> CREATE DATABASE roundcubemail;
mysql> USE mysql;
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE,
DROP on roundcubemail.* TO user@localhost IDENTIFIED BY 'password';
mysql> FLUSH PRIVILEGES;
mysql> USE roundcubemail;
mysql> SOURCE ../SQL/mysql.initial.sql
mysql> SHOW TABLES;
mysql> q
It should be all set, but to make sure it runs on the ssl for this webmail server, I simply toss a small index.php file in the normal htdocs directory:
header("Location: https://webmail.example.com/roundcubemail/");
So that when a user hits: http://webmail.example.com/ they are automatically forwarded to https://webmail.example.com/roundcubemail/.
This would be a great opportunity for me to create an ebuild and use the webapp-config tool to configure it - thus allowing me and others to be able to upgrade and instal easily — perhaps one day (or night) I will delve into this. Enjoy!
