{"id":133,"date":"2017-10-09T09:55:00","date_gmt":"2017-10-09T09:55:00","guid":{"rendered":"https:\/\/linuxadmin.melberi.com\/uncategorized\/roundcube-webmail-installation"},"modified":"2017-10-09T14:31:13","modified_gmt":"2017-10-09T14:31:13","slug":"roundcube-installation-procedure","status":"publish","type":"post","link":"https:\/\/www.melberi.com\/linuxadmin\/roundcube\/roundcube-installation-procedure","title":{"rendered":"Roundcube webmail installation Guide"},"content":{"rendered":"<p>How to Install Roundcube Webmail on Linux CentOS Fedora Ubuntu Redhat Linux<\/p>\n<h3><u><b>License<\/b><\/u><\/h3>\n<p>Roundcube Webmail is released under the GNU General Public License (GPL).<\/p>\n<h3><u><b>Server Requirements<\/b><\/u><\/h3>\n<p>* Apache or Lighttpd webserver<br \/>\n* PHP Version 5.2.1 or greater<br \/>\n* MySQL, PostgreSQL, SQLite or MSSQL database<br \/>\n* An IMAP server which supports IMAP4 rev1<br \/>\n* An SMTP server (recommended) or PHP configured for mail delivery<\/p>\n<h3><u><b>Installation Procedure<\/b><\/u><\/h3>\n<p>Download the latest stable version of RoundCube web mail from http:\/\/www.roundcube.net and copy it to your web server using winscp or other preferred method<\/p>\n<h3><u><b>1)Roundcube Webmail installation<\/b><\/u><\/h3>\n<p>Login to your Apache server host through shell (putty)<br \/>\nUn tar roundcubemail-0.3.1.tar.gz in the web root directory<\/p>\n<p><b style=\"background-color: #cccccc;\">#tar -xvzf roundcubemail-x.x.x.tar.gz -C \/var\/www\/html\/<br \/>\n#cd \/var\/www\/html<br \/>\n#mv roundcubemail-0.3.1\/ roundcubemail<br \/>\n#cd roundcubemail\/<\/b><\/p>\n<p>RoundCube needs to save some temp files and it also writes logs. Therefore make sure that the following directories (temp,logs) are writable by the web server user<\/p>\n<p><b style=\"background-color: #cccccc;\">#chown -R apache.apache logs temp<\/b><\/p>\n<h3><u><b>Configuration:<\/b><\/u><\/h3>\n<h3><u><b>2) Mysql configuration:<\/b><\/u><\/h3>\n<p>Login to your mysql server through shell (or webmin) and Create a database for your webmail (You can use the same server for both Apache and MySQL)<\/p>\n<p><b>Example: db name &#8211; roundcubedb, username &#8211; roundcubeuser , password &#8211; roundcubepwd (your choice)<\/b><\/p>\n<p><b>#mysql -u root -p ( enter the mysql root password)<br \/>\nmysql&gt; create database roundcubedb;<br \/>\nmysql&gt; grant all privileges on roundcubedb.* to roundcubeuser@localhost identified by &#8217;roundcubepwd&#8217;;<br \/>\nmysql&gt; FLUSH PRIVILEGES;<br \/>\nmysql&gt; exit<\/b><\/p>\n<p>Above commands will create a database roundcubedb with the required permissions.<br \/>\nIf you are ruining Apache and mysql in different servers, you have to grand privilege for roundcubeuser@apacheserverip<br \/>\nNow import the table layout<\/p>\n<p><b style=\"background-color: #cccccc;\">#mysql roundcubedb &lt; SQL\/mysql.initial.sql\u00a0 -u root -p<\/b><br \/>\n(enter the root password or mysql server)<br \/>\nCreate the config file from samples<\/p>\n<p><b style=\"background-color: #cccccc;\">#cd config\/<br \/>\n#cp db.inc.php.dist db.inc.php<br \/>\n#cp main.inc.php.dist main.inc.php<\/b><\/p>\n<h4><u><b>Edit Database Configuration File:<\/b><\/u><\/h4>\n<p>Edit the db.inc.php file and replace the below lines with your database access details<\/p>\n<p><b style=\"background-color: #cccccc;\">#vim db.inc.php<br \/>\n$rcmail_config[&#8216;db_dsnw&#8217;] = &#8216;mysql:\/\/roundcubeuser:roundcubepwd@localhost\/roundcubedb&#8217;;<\/b><\/p>\n<h3><u><b>3) Apache Server Configuration:<\/b><\/u><\/h3>\n<p><u><b>DNS Configuration:<\/b><\/u><br \/>\nAdd dns entry for your support website ( webmail.example.com to 192.168.1.3 (replace with your ip) )<br \/>\nIf you don&#8217;t have dns server already running, you can use the ip directly<\/p>\n<p><u><b>Edit Apache Config:<\/b><\/u><br \/>\nedit \/etc\/httpd\/conf\/httpd.conf and add the following configurations<\/p>\n<p><span style=\"color: #808080;\"><b>&lt; VirtualHost 192.168.1.3:* &gt;<br \/>\nDocumentRoot \/var\/www\/html\/roundcubemail<br \/>\nServerName webmail.example.com<br \/>\nRewriteEngine on<br \/>\nRewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)<br \/>\nRewriteRule .* &#8211; [F]<br \/>\n&lt; Directory &#8220;\/var\/www\/html\/roundcubemail&#8221;\u00a0 &gt;<br \/>\nDirectoryIndex index.php<br \/>\n&lt; \/Directory &gt;<br \/>\nOptions ExecCGI<br \/>\n&lt; \/VirtualHost &gt;<\/b><\/span><\/p>\n<p><b>If you don&#8217;t have DNS server you can skip the above step<\/b><br \/>\nand add alias for this mail directory<\/p>\n<p><b style=\"background-color: #cccccc;\">#vim \/etc\/httpd\/conf\/httpd.conf<br \/>\nAlias \/webmail &#8220;\/var\/www\/html\/roundcubemail&#8221;<\/b><br \/>\nRestart apache server<br \/>\n<b style=\"background-color: #cccccc;\">#service httpd restart<\/b><\/p>\n<h3><u><b>4) Installer config:<\/b><\/u><\/h3>\n<p>edit main.inc.php file and enable the installer and check all the required modules are present, php config, etc<\/p>\n<p><b style=\"background-color: #cccccc;\">#vim main.inc.php<br \/>\n$rcmail_config[&#8216;enable_installer&#8217;] = true;<\/b><\/p>\n<p>Now you can Point your browser to http:\/\/url-to-roundcube\/installer\/ (http:\/\/192.168.1.3\/webmail\/installer)<\/p>\n<div class=\"separator\" style=\"clear: both; text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.melberi.com\/linuxadmin\/wp-content\/uploads\/sites\/3\/2010\/07\/roundcube-webmail-installation2.jpg\" alt=\"\" width=\"500\" height=\"800\" border=\"0\" \/><\/div>\n<p>After checking this installer script you can disable\u00a0 the installer<br \/>\n<b style=\"background-color: #cccccc;\">#vim main.inc.php<br \/>\n$rcmail_config[&#8216;enable_installer&#8217;] = false;<\/b><\/p>\n<p><b>Now you can start using your webmail through browse\u00a0<\/b><\/p>\n<p>your webmail url http:\/\/webmail.example.com\u00a0 or ip (from remote computer)<br \/>\nIf no dns server configured , use alias http:\/\/192.168.1.3\/webmail ( from local host http:\/\/localhost\/webmail)<br \/>\nHere you can enter your username, password, mail server details and start browsing your mails<b> <\/b><\/p>\n<div class=\"separator\" style=\"clear: both; text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.melberi.com\/linuxadmin\/wp-content\/uploads\/sites\/3\/2010\/07\/roundcube-webmail-installation.jpg\" alt=\"\" width=\"500\" height=\"225\" border=\"0\" \/><\/div>\n<p>You can start using the webmail with the above configuration itself. Below I have mentioned optional configurations.<\/p>\n<h3><u><b>5) Customizing the Configuration<\/b><\/u><\/h3>\n<p><b> <\/b><br \/>\n<u><b>IMAP server configuration:<\/b><\/u><br \/>\nBy default the login screen provides a text box where you need to enter the IMAP host which you want to connect to.<\/p>\n<p>If you dont want your users to enter the mailserver details, you can hide this by setting one fixed IMAP host address<\/p>\n<p><b style=\"background-color: #cccccc;\">#vim main.inc.php<br \/>\n$rcmail_config[&#8216;default_host&#8217;] = &#8216;yourmailserverip&#8217;;<br \/>\n$rcmail_config[&#8216;smtp_server&#8217;] = &#8216;yourmailserverip&#8217;;<\/b><br \/>\nIf you want to add multiple servers<br \/>\n<b>$rcmail_config[&#8216;default_host&#8217;] = array(<br \/>\n&#8216;mail.example.com&#8217; =&gt; &#8216;Default Server&#8217;,<br \/>\n&#8216;webmail.example.com&#8217; =&gt; &#8216;Webmail Server&#8217;,<br \/>\n&#8216;ssl:\/\/mail.example.com:993&#8217; =&gt; &#8216;Secure Webmail Server&#8217;<\/b><\/p>\n<p><u><b>Deleted messages:<\/b><\/u><br \/>\nSome mail clients just mark messages as deleted and finally remove them when leaving the application.<\/p>\n<p>RoundCube by default move messages to the Trash folder when hitting the delete button.<\/p>\n<p>However this behavior can be changed by unsetting the &#8216;trash_mbox&#8217; property and enabling &#8216;flag_for_deletion&#8217;.<\/p>\n<p>Your configuration could look like this:<\/p>\n<p><b>$rcmail_config[&#8216;trash_mbox&#8217;] = &#8221;;<br \/>\n$rcmail_config[&#8216;flag_for_deletion&#8217;] = true;<br \/>\n$rcmail_config[&#8216;skip_deleted&#8217;] = false;<\/b><\/p>\n<p>Messages will now be marked as deleted which can be reverted again. To finally remove them, the user needs to click &#8220;Compact&#8221; below the folder list.<br \/>\n<b> <\/b><\/p>\n<h3><u><b>6) Other Configurations: <\/b><\/u><\/h3>\n<p><b>PostgreSQL<\/b>:<br \/>\nTo use RoundCube with PostgreSQL support you have to follow these<br \/>\nsimple steps, which have to be done as the postgres system user (or<br \/>\nwhich ever is the database superuser)<\/p>\n<p><b>$ createuser roundcube<br \/>\n$ createdb -O roundcube -E UNICODE roundcubemail<br \/>\n$ psql roundcubemail<br \/>\nroundcubemail =# ALTER USER roundcube WITH PASSWORD &#8216;the_new_password&#8217;;<br \/>\nroundcubemail =# c &#8211; roundcube<br \/>\nroundcubemail =&gt; i SQL\/postgres.initial.sql<\/b><\/p>\n<p>All this has been tested with PostgreSQL 8.x and 7.4.x.<\/p>\n<p>Older versions don&#8217;t have a -O option for the createdb, so if you are<br \/>\nusing that version you&#8217;ll have to change ownership of the DB later.<\/p>\n<p><strong><span style=\"text-decoration: underline;\">7) Common Problems:<\/span><\/strong><br \/>\n<b>500 Internal Server Error::<\/b><br \/>\n<b>Using MySQL &#8211; Database Error | Failed Connection<\/b><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Install Roundcube Webmail on Linux CentOS Fedora Ubuntu Redhat Linux License Roundcube Webmail is released under the GNU General Public License (GPL). Server Requirements * Apache or Lighttpd&#8230; <a href=\"https:\/\/www.melberi.com\/linuxadmin\/roundcube\/roundcube-installation-procedure\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":332,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[93,136],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts\/133"}],"collection":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/comments?post=133"}],"version-history":[{"count":4,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts\/133\/revisions"}],"predecessor-version":[{"id":599,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts\/133\/revisions\/599"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/media\/332"}],"wp:attachment":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/media?parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/categories?post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/tags?post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}