Friday, September 28, 2007

Installing roundcube webmail on Directadmin server

How to install roundcube on Linux server with Directadmin installed:

Following is the roundcube install script and It's being released as beta version.

To install it: code is

# cd /usr/local/directadmin/scripts

# wget -O roundcube.sh http://files.directadmin.com/services/all/roundcube.sh

# chmod 755 roundcube.sh

# ./roundcube.sh

# chmod 755 roundcube.sh


Once installed, you'll need to restart apache for the /roundcube alias to function. Roundcube uses mysql for it's data, so a da_roundcube database is created.


On CentOS 4.4 + and Debian 3.1 + the above script will work smoothly but If you have freebsd os on your server then,

/bin/mv --force [files]

you need to change it to

/bin/mv -f [files]

or it will error saying

mv: illegal option -- -

If you had no da_admin or root password set for mysql so if you get permission errors about mysql, try running the following

# /usr/local/bin/mysqladmin -u root password 'new password'

# /usr/local/directadmin/scripts/mysql.sh 'root mysql password' da_admin 'da_admin password you want'


If you want to see errors - edit /var/www/html/roundcube/config/main.inc.php and set debug level to 4.


RoundCube webmail is a web-based mail client like squirrelmail or uebimiau is. More info about RoundCube webmail: http://www.roundcube.net


Issue: If IMAP not working. Can't connect to 143

Following are the quick fixes:

1) Make sure /usr/sbin/imapd exists and is executeable. You should be able to run it and see:

[root@user sbin]# /usr/sbin/imapd
* OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS STARTTLS AUTH=LOGIN]
server.hostname.com IMAP4rev1 2003.339 at Thu, 23 Sept 2007 12:34:14 -0600 (MDT)

2) make sure xinetd is running (inetd on FreeBSD)

[root@user sbin]# ps -ax | grep inetd | grep -v grep

On newer redhat/fedora/centos machines, you can install it with:

# yum -y install xinetd

# /sbin/service xinetd start

# /sbin/chkconfig xinetd on


3) Make sure xinetd has the proper settings:
RedHat: /etc/xinetd.d/imap

# default: on
# description: imapd
service imap
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/imapd
log_on_success += DURATION USERID
log_on_failure += USERID
nice = 10
}


FreeBSD: /etc/inetd.conf

imap4 stream tcp nowait root /usr/sbin/imapd imapd

ote that the /etc/inetd.conf will contain many other lines. Just make sure that this one exists somewhere.

To test it out, run:

[root@user]# telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS STARTTLS AUTH=LOGIN]
localhost IMAP4rev1 2003.339 at Thu, 23 Sept 2007 12:39:55 -0600 (MDT)

4) You can also double check that the imapd binary is the one we included by running:

# rm -f /usr/sbin/imapd

# cd /usr/local/directadmin/scripts

# ./imapd.sh


5) check your /etc/hosts file. Make sure you have one line that contains

127.0.0.1 localhost.localdomain localhost

6) If you can connect via localhost and not from outside the server, check your firewall settings to make sure port 143 is open.

# netstat --listen
# lsof -i

And if nmap is installed on server then you can check by using command

# nmap localhost

If you can see the port 443 opened in the listing that means port is still opened on the server .