How to Install RoundCube on cPanel

From ReduxWiki

Jump to: navigation, search


[edit] aka, How to Install RoundCube on cPanel on a VPS and Dedicated Server

First, make certain you know your MySQL root password, you have to replace DATABASEPASSWORD with your MySQL root password.

Image:Unreadable.png If you have already used RoundCube, please make sure you remove any traces of its installation by using the following:

cd /usr/local/cpanel/base
rm -rf roundcube*
mysql -p -e 'drop database roundcube';
chattr -i /usr/local/cpanel/base/frontend/x/webmaillogin.html
chattr -i /usr/local/cpanel/base/webmaillogin.cgi
/scripts/upcp

You will have to specify your root password when prompted.

Now let's download RoundCube first, and chmod the directories:

cd /usr/local/cpanel/base
wget -O roundcube.tar.gz http://heanet.dl.sourceforge.net/sourceforge/roundcubemail/roundcubemail-0.1-rc1.tar.gz
tar -zxvf roundcube.tar.gz
rm -rf roundcube.tar.gz
mv -f roundcubemail-0.1-rc1 roundcube
cd roundcube
chmod -R 777 temp
chmod -R 777 logs

Create the database and install the initial SQL file. The following commands will do this for you. In the following, please replace DATABASEPASSWORD to your current MySQL password:

mysql -e "CREATE DATABASE roundcube;" -pDATABASEPASSWORD
mysql -e "use roundcube; source SQL/mysql.initial.sql;" -pDATABASEPASSWORD

Now let's sort out the configuration of RoundCube:

cd config
mv db.inc.php.dist db.inc.php
mv main.inc.php.dist main.inc.php

Now open db.inc.php:

nano db.inc.php

With this file open in nano, find:

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

and replace with:

$rcmail_config['db_dsnw'] = 'mysql://root:DATABASEPASSWORD@localhost/roundcube'; Change "DATABASEPASSWORD" to your current password

Now open main.inc.php:

nano main.inc.php

With this file open in nano, find:

$rcmail_config['default_host'] = '';

and replace with:

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

Now we have to configure cPanel to show RoundCube in its theme. Please note this is for the X theme (default) only! If you use another theme please skip this step, and see below. Image:2downarrow.png

cd /usr/local/cpanel/base/roundcube/skins/default/images/
cp --reply=yes roundcube_logo.png /usr/local/cpanel/base/frontend/x/images/roundcube_logo.png
cp --reply=yes roundcube_logo.png /usr/local/cpanel/base/webmail/x/images/roundcube_logo.png
cd /usr/local/cpanel/base
wget http://www.hostgeekz.com/files/hostgeekz/HGpatch-roundcube-0.1-rc1
patch -p0 < HGpatch-roundcube-0.1-rc1

Image:Dialog-warning.png If you receive a message stating:

Reversed (or previously applied) patch detected! Assume -R?

please press N for No as this is because you previously installed RoundCube.

Image:Symboliclink.png Once the patch is executed, you may now access RoundCube via http://yourip/webmail.

Image:2rightarrow.png If you do not use the default cPanel theme, please do the following:

cd /usr/local/cpanel/base
wget http://www.hostgeekz.com/files/hostgeekz/HGpatch-roundcube-NON-X-0.1-rc1
patch -p0 < HGpatch-roundcube-NON-X-0.1-rc1

Then open your webmaillogin.html, please replace YOURTHEME with the name of your theme.

nano /usr/local/cpanel/base/frontend/YOURTHEME/webmaillogin.html

and find

</td>
</cpanelif>
</cpanelfeature>

Add the following code after </cpanelfeature>:

<td align="center" valign="bottom" width="200">
<a href="/roundcube/index.php"><img src="images/roundcube_logo.png" border="0"></a>
<a href="/roundcube/index.php">RoundCube</a>
</td>

Remember to chattr +i the files or add the patch to your /scripts/upcp.

chattr +i /usr/local/cpanel/base/frontend/x/webmaillogin.html
chattr +i /usr/local/cpanel/base/webmaillogin.cgi

Image:Readonly.png If you are using cPanel 11, please be certain to run the following fix:

wget http://www.hostgeekz.com/files/hostgeekz/cpanel-11-fix.sh
chmod 700 cpanel-11-fix.sh
./cpanel-11-fix.sh
rm -f cpanel-11-fix.sh

Image:Symboliclink.png Process complete! You may now access RoundCube via ''http://yourip/webmail''


Image:Tip.png Back to How To Documents
Personal tools
Getting Started