How to Install Roundcube on Ubuntu

Save

Roundcube is an open-source Web-based email tool for users. The Roundcube package is included in the core Ubuntu repositories. To install Roundcube, you must install Apache, MySQL and PHP as prerequisites, install Roundcube from the repository, configure Roundcube to use MySQL and then configure access Roundcube with a virtual host.

Install Prerequisites

  • Log in to the Ubuntu system as a user with super-user privileges. Update your repositories and upgrade your existing system with security updates before you install new software. Type "sudo apt-get update && sudo apt-get upgrade -y" (no quotes here and in the remainder of the document) and press "Enter" at a shell prompt.

  • Install the Apache Web server, the MySQL database and PHP. Type "sudo apt-get install apache2 mysql-server php5 php-pear php5-mysql php5-mcrypt php5-intl" and press "Enter." Type a password for the MySQL root user when prompted, and type it a second time to confirm.

  • Enable the deflate, expires and headers modules in Apache. Type "sudo a2enmod deflate expires headers" and press "Enter." Type "sudo service apache2 restart" to activate the new configuration.

Install Roundcube

  • Type "sudo apt-get install roundcube roundcube-mysql roundcube-plugins roundcube-plugins-extra -y" and press "Enter" at a shell prompt.

  • Select "Yes" when you're prompted to configure the database with dbconfig-common and select "mysql" from the list of database types. Type the password for the root MySQL user that you assigned during the installation.

  • Press "Enter" when prompted for a Roundcube system password to have the database script automatically assign a strong password.

Configure Roundcube

  • Type "sudo dpkg-reconfigure roundcube" at a shell prompt to begin the configuration script.

  • Type the address and port of the IMAP server you intend to use with Roundcube to retrieve incoming mail. Prefix a host that requires secure sockets layer with "ssl." For example, to configure the Gmail IMAP server, type "ssl://imap.gmail.com:993."

  • Choose your default language and press "Enter." Select "No" when prompted to reinstall the Roundcube database.

  • Choose the Apache Web server for configuration. Use your cursor key to arrow to any Web servers other than "apache2" and press the spacebar to deselect the Web server so the only option shown with an asterisk next to it is "apache2." Press the "Tab" key and press "Enter" to choose OK.

  • Press "Enter" when prompted to restart the Apache Web server.

  • Type "cat /usr/share/doc/roundcube-core/README.Debian" to display the options for setting up roundcube as a virtual host.

  • Edit the Apache configuration file the script created to set up access to Roundcube at a /roundcube directory of any virtual host or follow the instructions in the next section to create a virtual host for Roundcube. Type "sudo nano /etc/roundcube/apache.conf" and press "Enter." Uncomment the two lines that begin with "#Alias" by deleting the hash symbol that begins each line. Press "Ctrl-X" to save, press "Y" to confirm and press "Enter" to save your changes.

  • Type "sudo nano /etc/roundcube/main.inc.php" and press "Enter" to edit the configuration file and enable the TinyMCE editor. Press "Ctrl-W," type "htmleditor" and press "Enter" to search for the line to change. Change the zero to a one after the equal sign so the line reads:
    $rcmail_config['htmleditor'] = 1;

  • Launch a browser and navigate to the Roundcube login screen, for example, at "http://www.example.com/roundcube."

Create Subdomain and Virtual Host

  • Edit the DNS records for your domain at your domain registrar. Add an "A" record and point the record to the Web server's public IP address.

  • Change to the Apache virtual host directory by typing "cd /etc/apache2/sites-available" and pressing "Enter." Copy the Apache configuration file that the configuration script created to that directory. Type "sudo cp /etc/roundcube/apache2.conf roundcube.conf" and press "Enter."

  • Edit the configuration file to create a virtual host. Type "sudo nano roundcube.conf" and press "Enter."

  • Type the following lines after the first four comment lines, which begin with "#," to create a server at a roundcube subdomain. Substitute your domain name for "example.com":
    NameVirtualHost
    <VirtualHost
    :80>
    ServerName roundcube.example.com
    ServerAlias www.roundcube.example.com
    DocumentRoot /var/lib/roundcube

  • Scroll to the bottom of the file and add the following lines to log access and errors in Apache:
    ErrorLog ${APACHE_LOG_DIR}/rc-error.log
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/rc-access.log combined
    </VirtualHost>

  • Press "Ctrl-X" to save, press "Y" to confirm and press "Enter" to save your changes to the file.

  • Type "sudo a2ensite roundcube" and press "Enter" to activate the virtual host. Type "sudo service apache2 restart" to restart Apache with the new virtual host added.

  • Launch a browser and navigate to the subdomain, such as "http://roundcube.example.com,&quot; to access the Roundcube login screen.

Tips & Warnings

  • If your Web server is behind a firewall, you must forward ports 80 and 443 to the server's private IP address.

References

  • Photo Credit Spike Mafford/Photodisc/Getty Images
Promoted By Zergnet

Comments

You May Also Like

Related Searches

M
Is DIY in your DNA? Become part of our maker community.
Submit Your Work!