cPanel Tutorials | Security Guides | News Feeds | Search
Navigation
Home
Guides
Password Generator
Files
News Feeds
Hosting News
Contact Us
Documentation
Site Search
 
Latest Guides
Largest number of established connections
Kill all processes matching certain strings.
Install FFmpeg-PHP
Install FFmpeg
Configure Squid
Install Squid
Password Security
Install Teamspeak
Disable SELinux
Install RoundCube on cPanel

Viewing Guide 

Install RoundCube on cPanel
Written by: HostGeekZ



This guide is wraped for easy viewing, to see the non wraped version Click Here



***Updated May 27th 2007***
***RoundCube 0.1-rc1***

First make sure you know your mysql root password, you have to replace DATABASEPASSWORD to your mysql root password.

If you have already used RoundCube installation please make sure you remove any traces of it with,


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 lets download roundcube first and chmod the directorys


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 intial sql file. The following commands will do this for you.


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


Now lets sort out the configuration


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

Find

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



Replace with

$rcmail_config['db_dsnw'] = 'mysql://root:DATABASEPASSWORD@localhost/roundcube';




Now Open main.inc.php

nano main.inc.php

Find

$rcmail_config['default_host'] = '';



Replace with

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



Now we have to configure cPanel to show roundcube in the theme. Please note this is for the X theme(default) only!! If you use another theme please skip the next part and see below.

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


**NOTE** 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



This will auto do all the necessary changes to roundcube and the X theme.

Once the patch is executed you may now access roundcube via http://yourip/webmail



-----

If you do not use the X 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 Below

<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>




------

***UPDATE***
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


If you are using cPanel 11 ensure 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



That's it! You may now access roundcube via http://yourip/webmail

User Comments 
Erick
2008-08-17
Thanks for these instructions. It's working in the sense that my Cpanel shows roundcube option now. But when I try to access it for my domain, it shows me:

"DATABASE ERROR: CONNECTION FAILED!

Unable to connect to the database!
Please contact your server-administrator.
"

Any ideas why? Please reply to my email address too if you reply. Thanks!
Ivan Romero
2008-06-03
I installed RoundCube 0.1.1 stable on my server with cPanel 11.23.3-R25048 following the updated guidelines. Everything works fine unless something very important. When I delete an email indicates a mistake. There is no recycle bin. Only appears inbox. How can I fix it?
Ben
2008-05-19
Sorry....shouldn't be a period at the end of #2 below. #2 should read

2) change roundcubemail-0.1-rc1 to roundcubemail-0.1.1
Ben
2008-05-19
This is essentially still copy and paste (as of today anyway)if you change two items in the DOWNLOAD section:

1) change roundcubemail-0.1-rc1.tar.gz to roundcubemail-0.1.1.tar.gz
2) change roundcubemail-0.1-rc1 to roundcubemail-0.1.1.

Worked for me anyway.
Aaron
2008-04-25
the layout of this guide is broken you can no longer cut and paste, is it possible for someone to edit this to make it cut and pasteable again?????
Greg
2008-03-30
Do we follow the following procedure for the stable release? (is it ok to us wget http://www.hostgeekz.com/files/hostgeekz/cpanel-11-fix.sh ?). And also, which steps do we follow if we decide to update roundcube later?
devilsoulblack
2008-02-24
thanks for the tutorial
Shawn
2008-02-04
nevermind, I found my problem. In db.inc.php I had dnsw instead of dsnw. Once I corrected that it worked perfect!
Shawn
2008-02-04
I am also getting DATABASE ERROR: CONNECTION FAILED!
joe ben
2008-02-01
link to squirrelmail and horde
Jorge
2008-01-21
So cPanel 11 automatically checks for RoundCube but doesn't log the user in. Is there an easy fix?
Rocco
2008-01-14
I can get most of this to work on cpanel 11, but logout leads you to roundcube webmail page, not the cpanel logout. Any thoughts?
Ahmed
2008-01-14
hi luis :
i can help to fix the inbox show nothing problem it is easy
just comment the following code in index.php in cd /usr/local/cpanel/base/roundcube


like this:


// check client X-header to verify request origin
//if ($OUTPUT->ajax_call)
//{
// if (empty($CONFIG['devel_mode']) && !rc_request_header('X-RoundCube-Referer'))
// {
// header('HTTP/1.1 404 Not Found');
// die("Invalid Request");
// }
//}

and another thing??
this only happen in roundcubemail-0.1-rc2
the roundcubemail-0.1-rc1 works fine , you will not see that code(// check client X-header to verify request origin).
ok that is it for today .
i wish i helped you luis ,because i faced the same thing and i found that code deference from the two index.php
bye

AHMSW

thanks HostGeekZ you the best.
Karl
2007-12-20
Excellent tutorial, worked perfectly. However, we are using the latest version of cPanel 11 with the x3 theme and the following steps were not necessary:

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 Below


<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>
Juanzo
2007-12-15
Is it possible to update to to latest version? (rc2)
Eric
2007-12-11
Amazing tutorial! worked perfectly...took 2 minutes
Lucas
2007-12-05
I have fixed it. Sorry for the posts.
Lucas
2007-12-05
I am also getting "DATABASE ERROR: CONNECTION FAILED!" even thought everything is correct. The database name, password and hostname. Any ideas what else could it be?
Ahman
2007-12-02
How to install to RvSkin ? any info ?
Scott
2007-11-14
We will have more updates to the guide in the coming weeks, the new guide releases and updates are delayed until just after XMAS with the launch of the new website. Feel free to contact webmaster@hostgeekz.com if you would like to preview it or have any suggestions.
luis
2007-11-08
Installation worked fine. When i access the first time i can see messages, but when i click again in Inbox they doesnt show up. However if i click the top icon "E-mail" they show again. Also, if i send an email and click in "Sent" i cannot see the messages too.

anyone know why is this?

thanks
Ilir
2007-11-08
There is a new version released v0.1-rc2 could you update ur tutorial also including update from 0.1-rc1
Tom Whiting
2007-11-08
This guide will work for RC2, you only need to change one minor thing.
-------------------------------------------------------------------------
cd /usr/local/cpanel/base
wget -O roundcube.tar.gz http://internap.dl.sourceforge.net/sourceforge/roundcubemail/roundcubemail-0.1-rc2.tar.gz
tar -zxvf roundcube.tar.gz
rm -rf roundcube.tar.gz
mv -f roundcubemail-0.1-rc2 roundcube
-------------------------------------------------------------------------

Everything else appears to work
susan
2007-11-07
me too, i would like to know the update for roundcube rc2
Chris
2007-10-22
Would like to see this updated for roundcube rc2
EraseR
2007-10-05
cool solution
uknutz
2007-10-02
Worked Perfectly. Thanks.
PWRseth
2007-09-26
Worked perfectly
pkhunter
2007-09-18
Hi, I have followed all the instructions. Ran into MySQL errors, fixed when I made sql-mode= something other than "traditional" in the my.cnf.

Anyway, now when I try to access the webmail, it shows me:

Internal Server Error

Unable to open engine binary (php) at cpsrvd-ssl.pl line 4981
main::phpHandler() called at cpsrvd-ssl.pl line 3751
main::dodoc_webmaild() called at cpsrvd-ssl.pl line 688
main::dodoc() called at cpsrvd-ssl.pl line 590


Any ideas?
Mautik
2007-08-30
answering my own question:
Open up roundcube/index.php

find-->
// try to log in
if ($_action=='login' && $_task=='mail')

above insert this code -->
if(empty($_SESSION['user_id']) && rcmail_login($_SERVER['REMOTE_USER'], $_SERVER['REMOTE_PASSWORD'], $host)) {
// send redirect
header("Location: $COMM_PATH");
exit;
}
Mautik
2007-08-17
In Cpanel 11 when i click in the logo of roundcube, he ask me again for the e-mail and password, someone know how to made the automatic autentication like SquirrelMail or Horde?
Kerry
2007-08-11
Worked perfectly. Thanks.
Susan
2007-08-08
Yes simply add a new mySQL user and set it up that way. The newer patches do create a new user rather than root (and will be released with the next site updates)
Mark
2007-08-08
Well done! works great!!
Susan
2007-08-02
is it possible to use other mysql user instead of mysql root user?
André Bellafronte
2007-07-16
I using RVSKIN, (.com:2096/webmail/rvskin/), if I click in the logo of roundcube, he ask again for the e-mail and pass, whi?
Scott
2007-06-21
If you get a database error, ensure you cut+paste the lines for db.inc.php as many people forget to change the database name part.
dexjul
2007-06-19
I got this error:
DATABASE ERROR: CONNECTION FAILED!

my db.inc.phpand main.inc.php is correct.
Dustin
2007-06-18
After i installed, i got:

DATABASE ERROR: CONNECTION FAILED!

Unable to connect to the database!
Please contact your server-administrator.

I even changed my password through phpmyadmin to see if that would work and it didnt.
Scott
2007-06-17
The webmaillogin.cgi should also be modified to include roundcube. If you do have problems with this you can use the contact us message on the left menu and I will help you.
tim
2007-06-12
any reason why everything works fine, but going to http://myip/webmail it does not list roundcube there?? I have checked webmaillogin.html for x theme and it has the lines in there to display, but it will not display. Any help would be appreciated.
Aaron
2007-06-06
I am using WHM 11.1.0 cPanel 11.4.1-R13361
and appearantly this does not work with that version.... or is there something i am missing.... i am not seeing in the webmaillogin.html when i try and log in
Marko
2007-06-06
Having a few problems here. I'm using the Radiance theme from CPskins.com and there is no </cpanelfeature> tag inside the webmaillogin.html file. When i add the HTML code after the </cpanelif> for neomail (which has been removed from the cpanel) and refresh the webmail viewer i dont see the roundcube options. Any1 got any ideas?
katmai
2007-06-02
for the x3 theme, /usr/local/cpanel/base/frontend/x3/branding/webmaillogininclude.html this is the file that must be edited, and you add the last code just at the bottom.

<p> <cpanel langprint="WebmailDesktopPre"><cpanel print="$CPDATA{'DNS'}"><cpanel langprint="WebmailDesktopPost"></p>
<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>
Scott
2007-06-02
Daniel15, the non-x patch does take cPanel 11 into consideration hence why it does not apply those changes automatically anymore, the instructions are alittle outdated with regards to specfically specifying that however and those are all planned to be updated on the next release of the website.
Daniel15
2007-06-02
Note that if you're using cPanel 11 (with its X3 skin), it will automatically detect RoundCube. This means that you do not need to apply the main patch, or chattr +i the files (however, I believe you still need to use the "HGpatch-roundcube-NON-X-0.1-rc1" patch to fix some stuff like URIs using ./ instead of ./index.php)
Scott
2007-05-30
Good spot Matt, this has now been corrected.
Matt
2007-05-30
Nicely done. You forgot the 'wget' for the following last bit of code:

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

Other than that.. works great.

Thanks.
David
2007-05-27
Brilliant, thanks for the quick update and the speedy reply to all emails as always, true professional!
Brad
2007-05-27
Thanks alot for this guide, it worked perfectly!
Scott
2007-05-27
The new guide has been released
     
Name:
Email: If you provide your email address you will receive updates for this guide to it.
Comment:
Verification We require you to add the following 2 values together for anti-spam purposes.
4 + 16
   

©Copyright HostGeekZ 2004-2007. All Rights Reserved.
Resources