Wednesday, March 24, 2010

Install RoundCube Webmail on Linux

Download location:

http://roundcube.net/download


Introduction

RoundCube is an excellent open source AJAX webmail client that makes older PHP webmail clients seem obsolete. It's easy to set up provided you already have a working LAMP server (Linux, Apache, MySQL, and PHP). RoundCube does also work with PostgreSQL or SQLite, but that is not covered by this HowTo. For PostgreSQL or SQLite, refer to the README and INSTALL contained in the RoundCube tarball (sorry).

The aim of this HowTo is to make installing and configuring RoundCube a trivial 5 minute process.


Preparation

Your Linux computer must be configured as a LAMP server first. To check if your box is ready, you can create a phpinfo file and place it in your Apache document root, and then open it with a browser. This is how:

cd /var/www/htdocs (or /var/www/html or wherever your document root is)
vi phpinfo.php

Paste this code, ensuring there are no additional spaces or carriage returns. Change the comma to a semi-colon and save and close.

Next navigate to http://localhost/phpinfo.php. If you can see a nicely formatted page (like this one), then you already have Apache configured with PHP! Scroll down the list and if you have a MySQL section, congratulations, your server is LAMP enabled and you ready to go! If you do not have a MySQL section, it means that your PHP was not compiled with the --with-mysql=/DIR switch. It's possible to install PHP with MySQL using packages (depending on your distro), or you might find it easier to remove Apache and PHP and follow a LAMP HowTo, like this one.

Once you have a working LAMP server, I would really recommend the use ofPHPMyAdmin or Webmin as a nice interface to MySQL, but that is not required for this tutorial.

Installing RoundCube
Check the
downloads page for the latest copy, and then download it to your box.

cd /var/www/htdocs
wget http://kent.dl.sourceforge.net/sourceforge/roundcubemail/roundcubemail-0.1beta2.tar.gz
tar zxfv roundcubemail-0.1beta2.tar.gz

Next we'll rename the folder to webmail and make some small changes to the permissions and the config files required for RoundCube to work.

Note: after completing extract change mode of given bellow files

mv roundcubemail-0.1beta2 webmail
chmod 777 webmail/logs
chmod 777 webmail/temp
mv webmail/config/db.inc.php.dist webmail/config/db.inc.php
mv webmail/config/main.inc.php.dist webmail/config/main.inc.php

Now to configure MySQL. Substitute password with a real password:

Note: Create Database from mysql

$rcmail_config['db_dsnw'] = 'mysql://DB_User:DB_Pass@localhost/DB_Name';

mysql
create database roundcubemail;
GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhostIDENTIFIED BY 'password';
quit
mysql roundcubemail <>

The final step is to edit the config files to suit your environment.

vi webmail/config/db.inc.php

On the line starting $rcmail_config, change pass to the password you specified earlier.

$rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/...

Nothing else needs to be changed in this file for RoundCube to work.

vi webmail/config/main.inc.php

The commented lines explain what you need to change, but you only really need to edit a few of the lines to get RoundCube working. Namely, your IMAP server, this can be your ISP or webhost, or localhost:

$rcmail_config['default_host'] = 'localhost';

Your domain name:

$rcmail_config['mail_domain'] = 'yourdomain.com';

Your SMTP Server, and the username and password for this server. If you're using "localhost", then a username and password is not normally required. However, if you relay mail through your ISP, you will need to specify a username and password here.

$rcmail_config['smtp_server'] = 'mail.yourisp.com';
$rcmail_config['smtp_user'] = 'your_username';
$rcmail_config['smtp_pass'] = 'your_password';

If your IMAP server is on the same box as your RoundCube installation, it's a good idea to set caching to FALSE. If this is left to TRUE it can cause a known issue with the inbox not displaying the right number of messages.

$rcmail_config['enable_caching'] = FALSE;

You can save and close at this point, but before you do, have a look through the rest of the config file just to familiarise yourself with the workings of these files.

That's it - RoundCube is ready. Point your browser to http://localhost/webmailand you can now log in with your IMAP username and password.

Note: After complete installation please move installer folder to back of public_html or create new fodder and move in it



No comments:

Post a Comment