Aleksander Machniak
2016-02-05 bd0551b22076b82a6d49e9f7a2b2e0c90a1b2326
commit | author | age
a89845 1 INTRODUCTION
T 2 ============
3
e019f2 4 This file describes the basic steps to install Roundcube Webmail on your
a89845 5 web server. For additional information, please also consult the project's
83ce4b 6 wiki page at http://trac.roundcube.net/wiki
T 7
4e17e6 8
535da2 9 REQUIREMENTS
T 10 ============
11
5d62d9 12 * The Apache, Lighttpd, Cherokee or Hiawatha web server
535da2 13 * .htaccess support allowing overrides for DirectoryIndex
8cc567 14 * PHP Version 5.3.7 or greater including
8447ba 15    - PCRE, DOM, JSON, Session, Sockets, OpenSSL, Mbstring (required)
a84efc 16    - PHP Data Objects (PDO) with driver for either MySQL, PostgreSQL or SQLite (required)
8447ba 17    - Libiconv, Zip, Fileinfo (recommended)
91790e 18 * PEAR packages distributed with Roundcube or external:
8c1c4f 19    - Mail_Mime 1.10.0 or newer
c4a226 20    - Net_SMTP (latest from https://github.com/pear/Net_SMTP/)
50d7d3 21    - Net_IDNA2 0.1.1 or newer
114cf1 22    - Auth_SASL 1.0.6 or newer
52674e 23    - Net_Sieve 1.3.2 or newer (for managesieve plugin)
3ac29f 24    - Crypt_GPG 1.4.0 or newer (for enigma plugin)
7d3406 25 * php.ini options (see .htaccess file):
535da2 26    - error_reporting E_ALL & ~E_NOTICE (or lower)
29640b 27    - memory_limit > 16MB (increase as suitable to support large attachments)
067763 28    - file_uploads enabled (for attachment upload features)
A 29    - session.auto_start disabled
7d3406 30    - suhosin.session.encrypt disabled
A 31    - mbstring.func_overload disabled
140abb 32    - magic_quotes_runtime disabled
0b6d02 33    - magic_quotes_sybase disabled
0314bf 34    - register_globals disabled (PHP < 5.4)
6c1c60 35 * PHP compiled with OpenSSL to use secure (tls/ssl) connections and to use the spell checker
ec6a77 36 * A MySQL (4.0.8 or newer), PostgreSQL, MS SQL Server (2005 or newer) database engine
d239ee 37   or SQLite support in PHP
1fb2c8 38 * One of the above databases with permission to create tables
7d3406 39 * An SMTP server (recommended) or PHP configured for mail delivery
d4a820 40 * Composer installed either locally or globally (https://getcomposer.org)
535da2 41
T 42
4e17e6 43 INSTALLATION
T 44 ============
45
46 1. Decompress and put this folder somewhere inside your document root
1985eb 47 2. Install dependencies using composer:
TB 48    - get composer from https://getcomposer.org/download/
49    - rename the composer.json-dist file into composer.json
408194 50    - if you want to use LDAP address books, enable the LDAP libraries in your
TB 51      composer.json file by moving the items from "suggest" to the "require"
52      section (remove the explanation texts after the version!).
0c137f 53    - run `php composer.phar install --no-dev`
1985eb 54 3. Make sure that the following directories (and the files within)
10a699 55    are writable by the webserver
4e17e6 56    - /temp
T 57    - /logs
1985eb 58 4. Create a new database and a database user for Roundcube (see DATABASE SETUP)
TB 59 5. Point your browser to http://url-to-roundcube/installer/
60 6. Follow the instructions of the install script (or see MANUAL CONFIGURATION)
61 7. After creating and testing the configuration, remove the installer directory
62 8. Check Known Issues section of this file
42b113 63
T 64
4b20e2 65 CONFIGURATION HINTS
T 66 ===================
67
2c6951 68 IMPORTANT! Read all comments in defaults.inc.php, understand them
AM 69 and configure your installation to be not surprised by default behaviour.
70
233622 71 Roundcube writes internal errors to the 'errors' log file located in the logs
461a30 72 directory which can be configured in config/config.inc.php. If you want ordinary
4b20e2 73 PHP errors to be logged there as well, enable the 'php_value error_log' line
T 74 in the .htaccess file and set the path to the log file accordingly.
75
29640b 76 By default the session_path settings of PHP are not modified by Roundcube.
T 77 However if you want to limit the session cookies to the directory where
78 Roundcube resides you can uncomment and configure the according line
79 in the .htaccess file.
80
4b20e2 81
10a699 82 DATABASE SETUP
T 83 ==============
84
233622 85 Note: Database for Roundcube must use UTF-8 character set.
90c82e 86 Note: See defaults.inc.php file for examples of DSN configuration.
0ba548 87
fa898a 88 * MySQL
T 89 -------
10a699 90 Setting up the mysql database can be done by creating an empty database,
T 91 importing the table layout and granting the proper permissions to the
92 roundcube user. Here is an example of that procedure:
93
94 # mysql
ad5600 95 > CREATE DATABASE roundcubemail /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
10a699 96 > GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhost
6ae6e4 97     IDENTIFIED BY 'password';
10a699 98 > quit
fa898a 99
10a699 100 # mysql roundcubemail < SQL/mysql.initial.sql
535da2 101
fa898a 102 Note 1: 'password' is the master password for the roundcube user. It is strongly
3cf664 103 recommended you replace this with a more secure password. Please keep in
T 104 mind: You need to specify this password later in 'config/db.inc.php'.
fa898a 105
1cded8 106
10a699 107 * SQLite
T 108 --------
8da072 109 Versions of sqlite database engine older than 3 aren't supported.
AM 110 Database file and structure is created automatically by Roundcube.
111 Make sure your configuration points to some file location and that the
83ce4b 112 webserver can write to the file and the directory containing the file.
10a699 113
T 114
1cded8 115 * PostgreSQL
T 116 ------------
233622 117 To use Roundcube with PostgreSQL support you have to follow these
a89845 118 simple steps, which have to be done as the postgres system user (or
1cded8 119 which ever is the database superuser):
T 120
b91bc1 121 $ createuser -P roundcube
ad5600 122 $ createdb -O roundcube -E UNICODE roundcubemail
b91bc1 123 $ psql -U roundcube -f SQL/postgres.initial.sql roundcubemail
1cded8 124
b91bc1 125 Note: in some system configurations you might need to add '-U postgres' to
AM 126 createuser and createdb commands.
233622 127
T 128
c72f69 129 * Microsoft SQL Server
AM 130 ----------------------
131 Language/locale of the database must be set to us_english (1033). More info
132 on this at http://trac.roundcube.net/ticket/1488918.
133
134
233622 135 Database cleaning
T 136 -----------------
c72f69 137 To keep your database slick and clean we recommend to periodically execute
30aa4c 138 bin/cleandb.sh which finally removes all records that are marked as deleted.
233622 139 Best solution is to install a cronjob running this script daily.
1cded8 140
T 141
190e97 142 MANUAL CONFIGURATION
T 143 ====================
535da2 144
9bacb2 145 First of all, copy the sample configuration file config/config.inc.php.sample
TB 146 to config/config.inc.php and make the necessary adjustments according to your
147 environment and your needs. More configuration options can be copied from the
148 config/defaults.inc.php file into your local config.inc.php file as needed.
149 Read the comments above the individual configuration options to find out what
150 they do or read http://trac.roundcube.net/wiki/Howto_Install for even more
151 guidance.
535da2 152
4b9efb 153 You can also modify the default .htaccess file. This is necessary to
S 154 increase the allowed size of file attachments, for example:
155     php_value       upload_max_filesize     2M
535da2 156
83ce4b 157
012555 158 SECURE YOUR INSTALLATION
TB 159 ========================
160
161 Access through the webserver to the following directories should be denied:
162
163   /config
164   /temp
165   /logs
166
167 Roundcube uses .htaccess files to protect these directories, so be sure to
168 allow override of the Limit directives to get them taken into account. The
169 package also ships a .htaccess file in the root directory which defines some
170 rewrite rules. In order to properly secure your installation, please enable
171 mod_rewrite for Apache webserver and double check access to the above listed
172 directories and their contents is denied.
173
585ee9 174 NOTE: In Apache 2.4, support for .htaccess files has been disabled by
TB 175 default. Therefore you first need to enable this in your Apache main or
176 virtual host config by with:
177
178  AllowOverride all
179
012555 180
42b113 181 UPGRADING
T 182 =========
6ae6e4 183
233622 184 If you already have a previous version of Roundcube installed,
42b113 185 please refer to the instructions in UPGRADING guide.
4e17e6 186
T 187
d7f49d 188 OPTIMISING
T 189 ==========
190
191 There are two forms of optimisation here, compression and caching, both aimed
233622 192 at increasing an end user's experience using Roundcube Webmail. Compression
d7f49d 193 allows the static web pages to be delivered with less bandwidth. The index.php
233622 194 of Roundcube Webmail already enables compression on its output. The settings
d7f49d 195 below allow compression to occur for all static files. Caching sets HTTP 
T 196 response headers that enable a user's web client to understand what is static
197 and how to cache it.
198
199 The caching directives used are:
200  * Etags - sets at tag so the client can request is the page has changed
201  * Cache-control - defines the age of the page and that the page is 'public'
202    This enables clients to cache javascript files that don't have private 
203    information between sessions even if using HTTPS. It also allows proxies
204    to share the same cached page between users.
205  * Expires - provides another hint to increase the lifetime of static pages.
206
207 For more information refer to RFC 2616.
208
209 Side effects:
210 -------------
211 These directives are designed for production use. If you are using this in
212 a development environment you may get horribly confused if your webclient
213 is caching stuff that you changed on the server. Disabling the expires 
214 parts below should save you some grief.
215
216 If you are changing the skins, it is recommended that you copy content to 
217 a different directory apart from 'default'.
218
219 Apache:
220 -------
221 To enable these features in apache the following modules need to be enabled:
a5c2ad 222  * mod_deflate
A 223  * mod_expires
d7f49d 224  * mod_headers
T 225
226 The optimisation is already included in the .htaccess file in the top 
227 directory of your installation.
228
229 If you are using Apache version 2.2.9 and later, in the .htaccess file
230 change the 'append' word to 'merge' for a more correct response. Keeping
231 as 'append' shouldn't cause any problems though changing to merge will 
232 eliminate the possibility of duplicate 'public' headers in Cache-control.
233
234 Lighttpd:
235 ---------
236 With Lightty the addition of Expire: tags by mod_expire is incompatible with
237 the addition of "Cache-control: public". Using Cache-control 'public' is 
238 used below as it is assumed to give a better caching result.
239
240 Enable modules in server.modules:
241     "mod_setenv"
242     "mod_compress"
243
244 Mod_compress is a server side cache of compressed files to improve its performance.
245
246 $HTTP["host"] == "www.example.com" {
247
248     static-file.etags = "enable"
249     # http://redmine.lighttpd.net/projects/lighttpd/wiki/Etag.use-mtimeDetails
250     etag.use-mtime = "enable"
251
252     # http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModSetEnv
253     $HTTP["url"] =~ "^/roundcubemail/(plugins|skins|program)" {
254         setenv.add-response-header  = ( "Cache-Control" => "public, max-age=2592000")
255     }
256
257     # http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModCompress
258     # set compress.cache-dir to somewhere outside the docroot.
259     compress.cache-dir   = var.statedir + "/cache/compress"
260
261     compress.filetype = ("text/plain", "text/html", "text/javascript", "text/css", "text/xml", "image/gif", "image/png")
262 }
ed3e51 263
AM 264
265 KNOWN ISSUES
266 ============
267
268 Installations with uw-imap server should set imap_disabled_caps = array('ESEARCH')
269 in main configuration file. ESEARCH implementation in this server is broken (#1489184).