Thursday, July 7, 2011

How to Install Roundcube Webmail on Linux

License:
Roundcube Webmail is released under the GNU General Public License (GPL). 

Server Requirements: 
    * Apache or Lighttpd webserver
    * PHP Version 5.2.1 or greater
    * MySQL, PostgreSQL, SQLite or MSSQL database
    * An IMAP server which supports IMAP4 rev1
    * An SMTP server (recommended) or PHP configured for mail delivery

Installation Procedure:

     Download the latest stable version of RoundCube web mail from http://www.roundcube.net and copy it to your web server using winscp or other preffered method

1)Roundcube Webmail installation:

Login to your apache server host through shell (putty)
Un tar roundcubemail-0.3.1.tar.gz in the web root directory
#tar -xvzf roundcubemail-0.3.1.tar.gz -C /var/www/html/
#cd /var/www/html
#mv roundcubemail-0.3.1/ roundcubemail
#cd roundcubemail/

RoundCube needs to save some temp files and it also writes logs. Therefore make sure that the following directories (temp,logs) are writable by the web server user
#chown -R apache.apache logs temp

Configuration:

2) Mysql configuration:

Login to your mysql server through shell (or webmin) and Create a database for your webmail (You can use the same server for both apache and mysql)
db name - roundcubedb, username - roundcubeuser , password - roundcubepwd (your choice)
#mysql -u root -p ( enter the mysql root password)
mysql> create database roundcubedb;
mysql> grant all privileges on roundcubedb.* to roundcubeuser@localhost identified by 'roundcubepwd';
mysql> FLUSH PRIVILEGES;
mysql> exit

Above commands will create a database roundcubedb with the required permissions.
If you are ruining apache and mysql in different servers, you have to grand privilege for roundcubeuser@apacheserverip
Now import the table layout
#mysql roundcubedb < SQL/mysql.initial.sql  -u root -p
(enter the root password or mysql server)
Create the config file from samples
#cd config/
#cp db.inc.php.dist db.inc.php
#cp main.inc.php.dist main.inc.php


Database Configuration:
Edit the db.inc.php file and replace the below lines with your database access details
#vim db.inc.php
$rcmail_config['db_dsnw'] = 'mysql://roundcubeuser:roundcubepwd@localhost/roundcubedb';


3) Apache Server Configuration:

DNS Configuration:
Add dns engry for your support website ( webmail.example.com to 192.168.1.3 (replace with your ip) )
If you don't have dns server already running, you can use the ip directly

edit /etc/httpd/conf/httpd.conf and add the following configurations
< VirtualHost 192.168.1.3:* >
DocumentRoot /var/www/html/roundcubemail
ServerName webmail.example.com
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
    < Directory "/var/www/html/roundcubemail"  >
        DirectoryIndex index.php
    < /Directory >
Options ExecCGI
< /VirtualHost >


If you dont have DNS server you can skip the above step
and add alias for this mail directory
#vim /etc/httpd/conf/httpd.conf
Alias /webmail "/var/www/html/roundcubemail"


Restart apache server
#service httpd restart

4) Installer config:

edit main.inc.php file and enable the installer and check all the required modules are present, php config, etc
#vim main.inc.php
$rcmail_config['enable_installer'] = true;

Now you can Point your browser to http://url-to-roundcube/installer/ (http://192.168.1.3/webmail/installer)


























After checking this installer script you can disable  the installer 
#vim main.inc.php
$rcmail_config['enable_installer'] = false;


Now you start using your webmail through browse 
your webmail url http://webmail.example.com  or ip (from remote computer)
IF no dns server , use aliase http://192.168.1.3/webmail ( from local host http://localhost/webmail)
Here you can enter your username, password, mailserver details and start browsing your mails 











You can start using the webmail with the above configuration itself. Below I have mentioned optional configurations. 

5) Customizing the Configuration

IMAP server configuration:

By default the login screen provides a text box where you need to enter the IMAP host which you want to connect to. If you dont want your users to enter the mailserver details, you can hide this by setting one fixed IMAP host address
#vim main.inc.php
$rcmail_config['default_host'] = 'yourmailserverip';
$rcmail_config['smtp_server'] = 'yourmailserverip';

If you want to add multiple servers
$rcmail_config['default_host'] = array(
  'mail.example.com' => 'Default Server',
  'webmail.example.com' => 'Webmail Server',
  'ssl://mail.example.com:993' => 'Secure Webmail Server'


Deleted messages:
Some mail clients just mark messages as deleted and finally remove them when leaving the application. RoundCube by default move messages to the Trash folder when hitting the delete button. However this behavior can be changed by unsetting the 'trash_mbox' property and enabling 'flag_for_deletion'. Your configuration could look like this:
$rcmail_config['trash_mbox'] = '';
$rcmail_config['flag_for_deletion'] = true;
$rcmail_config['skip_deleted'] = false;

Messages will now be marked as deleted which can be reverted again. To finally remove them, the user needs to click "Compact" below the folder list. 


6) Other Configurations: 
PostgreSQL:

To use RoundCube with PostgreSQL support you have to follow these
simple steps, which have to be done as the postgres system user (or
which ever is the database superuser):
$ createuser roundcube
$ createdb -O roundcube -E UNICODE roundcubemail
$ psql roundcubemail
roundcubemail =# ALTER USER roundcube WITH PASSWORD 'the_new_password';
roundcubemail =# \c - roundcube
roundcubemail => \i SQL/postgres.initial.sql

All this has been tested with PostgreSQL 8.x and 7.4.x. Older
versions don't have a -O option for the createdb, so if you are
using that version you'll have to change ownership of the DB later.


7) Common Problems:

500 Internal Server Error::

Using MySQL - Database Error | Failed Connection

Setup Zabbix with mysql support with in 5 minutes

Step 1
Install Apache and MSSQL server 

#yum install mysql-server httpd
#service mysqld start
#service httpd start

Set Mysql root password
Default root password is null

Step 2


Install Zabbix server , web, agent packages through yum repository.  


#yum install zabbix-server-mysql  zabbix-web-mysql.noarch zabbix-agent


#cd /usr/share/doc/zabbix-server-mysql-x.x.x/


#mysql -uroot -psqlpassword
mysql > create database zabbix character set utf8;
mysql > quit;
#cd create/schema
#cat mysql.sql | mysql -uroot -psqlpassword  zabbix
#cd ../data
#cat data.sql | mysql -uroot -psqlpassword  zabbix
#cat images_mysql.sql | mysql -uroot -psqlpassword  zabbix

Edit the below mentioned files 
Configure /etc/zabbix/zabbix_agent.conf
Configure /etc/zabbix/zabbix_agentd.conf
Configure /etc/zabbix/zabbix_server.conf


#service zabbix-server start
#service zabbix-agent start

Step 3

Go to web interface and  http://localhost/zabbix
And follow the instructions mentioned there
Zabbix front end is ready! Default user name is Admin, password zabbix.

Just For Fun

*Why do we sometimes write 'etc' at the end in the exam?*

bcoz it means...
E-End of
T-thinking
C-capacity.

*How to Create d Biggest Doubt in ur Wife's Mind 4 u?*
?
?
?
?
?

Just Suddenly send her SMS Saying..

"I Luv u too"
.
.
GAME OVER.!

*When do you knw ur in love?*

Ans. When you start searching for the cheapest mobile plan

*Wht is the Diff b/w Young Age & Old Age?

Simple..

In Young Age
Phone Is Full Of Darlings Numbers..

In Old Age
Its Full of Doctors Numbers..!-

*"Why is Facebook such a hit?"*

It works on the principle that-'People are more interested in others life than their own-!

*A Ques Asked In A Talent Test:*
*If You Are Married To 1 Of The Twin Sisters, How wud You Recognize Your WIFE?*

The Best Answer - Why d Hell Should I recognise?


*What is the diff.between"GHAZAL" &"LECTURE"?*

Every word spoken by the girlfriend is "GHAZAL" and Every word spoken by wife is "LECTURE"

*Wats d diff btwn Pongal n idly?*

think.think..think...U ll get a holiday for pongal but not for idly.

*What will be the girl's name born on 1st of APRIL?*

Guess Guess Guess Guess "FOOLAN DEVI..

*Why does d bride & groom xchange garlands at d time of wedding.....*

B'coz they say each affectionately that : "DARLING NOW U R DEAD"...........

*What is the height of confusion?*

Two earth worms Playing HIDE AND SEEK in a Plate full of noodles

*Wat is d Biggest Benefit of having a crush in d same college where u study ?*
.
.
.
.
100% Attendence... :-P

*QUES - Where can u see mangoes?*
On mango trees? NO.At fruit shop? WRONG AGAIN....Fir kaha?

ANS - Jaha jaha women go,piche piche Man(goes).

*Teacher: What Is The Difference between HIMAMI & SUNAMI ?*

Tintu: HIMAMI is Face Wash,SUNAMI is Total Wash.!

*Difference between Friend & Wife*

U can Tell ur Friend "U r my Best Friend" But
Do u have courage tell to ur Wife "U r my Best Wife?"