Roundcube

-----

## mysql -u root -p mysql> CREATE DATABASE IF NOT EXISTS `roundcube`; mysql> GRANT ALL PRIVILEGES ON `roundcube` . * TO 'roundcube'@'localhost' IDENTIFIED BY 'mySecretPassword'; mysql> FLUSH PRIVILEGES; mysql> quit

--

make sure you change ‘mySecretPassword‘ with your own one.

Before downloading and installing Roundcube, let’s first create Roundcube’s Apache configuration file in /etc/httpd/conf.d/90-roundcube.conf by using an editor:

## vim  /etc/httpd/conf.d/90-roundcube.conf

and paste the following:

Alias /webmail /var/www/html/roundcube  <Directory /var/www/html/roundcube>     Options -Indexes     AllowOverride All </Directory>  <Directory /var/www/html/roundcube/config>     Order Deny,Allow     Deny from All </Directory>  <Directory /var/www/html/roundcube/temp>     Order Deny,Allow     Deny from All </Directory>  <Directory /var/www/html/roundcube/logs>     Order Deny,Allow     Deny from All </Directory>

So far so good. Now, download and set-up the latest version of Roundcube to /var/www/html/roundcube using:

## curl -L "http://sourceforge.net/projects/roundcubemail/files/latest/download?source=files" > /tmp/roundcube-latest.tar.gz ## tar -zxf /tmp/roundcube-latest.tar.gz -C /var/www/html ## rm -f /tmp/roundcube-latest.tar.gz ## cd /var/www/html ## mv roundcubemail-* roundcube ## chown root: -R roundcube/ ## chown apache: -R roundcube/temp/ ## chown apache: -R roundcube/logs/

Next thing to do, is to set-up Roundcube’s main.inc.php configuration file. But, before setting it up, let’s first create all the necessary database tables for Roundcube using:

## mysql -u roundcube -p"mySecretPassword" roundcube < roundcube/SQL/mysql.initial.sql

again, make sure you use the correct MySQL user/password combination

with tables in place, proceed with copying the main.inc.php.dist sample configuration file and editing main.inc.php:

## cp roundcube/config/defaults.inc.php roundcube/config/config.inc.php ## vim roundcube/config/config.inc.php

change:   $rcmail_config['default_host'] = ''; to   $rcmail_config['default_host'] = 'localhost';  change:   $rcmail_config['smtp_server'] = ''; to   $rcmail_config['smtp_server'] = 'localhost';  change:   $rcmail_config['smtp_user'] = ''; to   $rcmail_config['smtp_user'] = '%u';  change:   $rcmail_config['smtp_pass'] = ''; to   $rcmail_config['smtp_pass'] = '%p';  change:   $rcmail_config['quota_zero_as_unlimited'] = false; to   $rcmail_config['quota_zero_as_unlimited'] = true;  change:   $rcmail_config['preview_pane'] = false; to   $rcmail_config['preview_pane'] = true;  change:   $rcmail_config['read_when_deleted'] = true; to   $rcmail_config['read_when_deleted'] = false;  change:   $rcmail_config['check_all_folders'] = false; to   $rcmail_config['check_all_folders'] = true;

save and close the configuration file and proceed with setting up Roundcube’s database configuration file:

## cp roundcube/config/db.inc.php.dist roundcube/config/db.inc.php ## vim roundcube/config/db.inc.php

change:   $rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail'; to   $rcmail_config['db_dsnw'] = 'mysqli://roundcube:mySecretPassword@localhost/roundcube';

save and close the configuration file and remove the installer directory using:

## rm -rf roundcube/installer/

finally, restart Apache using:

## service httpd restart

and login to your webmail at http://yourdomain.com/webmail

--------------------------------------------------------------------------------------------

-----------------

21 Install Roundcube webmail

To install the RoundCube webmail client, run...

yum -y install roundcubemail

Change the roundcubemail.conf configuration file as follows:

nano /etc/httpd/conf.d/roundcubemail.conf

# # Round Cube Webmail is a browser-based multilingual IMAP client #  Alias /roundcubemail /usr/share/roundcubemail

Alias /webmail /usr/share/roundcubemail  # Define who can access the Webmail # You can enlarge permissions once configured  #<Directory /usr/share/roundcubemail/> #    <IfModule mod_authz_core.c> #        # Apache 2.4 #        Require local #    </IfModule> #    <IfModule !mod_authz_core.c> #        # Apache 2.2 #        Order Deny,Allow #        Deny from all #        Allow from 127.0.0.1 #        Allow from ::1 #    </IfModule> #</Directory>  <Directory /usr/share/roundcubemail/>         Options none         AllowOverride Limit         Require all granted </Directory>  # Define who can access the installer # keep this secured once configured  #<Directory /usr/share/roundcubemail/installer/> #    <IfModule mod_authz_core.c> #        # Apache 2.4 #        Require local #    </IfModule> #    <IfModule !mod_authz_core.c> #        # Apache 2.2 #        Order Deny,Allow #        Deny from all #        Allow from 127.0.0.1 #        Allow from ::1 #    </IfModule> #</Directory>  <Directory /usr/share/roundcubemail/installer>         Options none         AllowOverride Limit         Require all granted </Directory>   # Those directories should not be viewed by Web clients. <Directory /usr/share/roundcubemail/bin/>     Order Allow,Deny     Deny from all </Directory> <Directory /usr/share/roundcubemail/plugins/enigma/home/>     Order Allow,Deny     Deny from all </Directory>

Restart Apache:

systemctl restart httpd.service

----------

---------