Aleksander Machniak
2013-10-17 197203727417a03d87053a47e5aa5175a76e3e0b
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
d36115 14 * PHP Version 5.2.1 or greater including
0f9687 15    - PCRE, DOM, JSON, XML, Session, Sockets (required)
1fb2c8 16    - libiconv (recommended)
0f9687 17    - mbstring, fileinfo, mcrypt (optional)
91790e 18 * PEAR packages distributed with Roundcube or external:
A 19    - MDB2 2.5.0 or newer
53604a 20    - Mail_Mime 1.8.1 or newer
cc2c83 21    - Net_SMTP 1.4.2 or newer
50d7d3 22    - Net_IDNA2 0.1.1 or newer
5c84da 23    - Auth_SASL 1.0.3 or newer
7d3406 24 * php.ini options (see .htaccess file):
535da2 25    - error_reporting E_ALL & ~E_NOTICE (or lower)
29640b 26    - memory_limit > 16MB (increase as suitable to support large attachments)
067763 27    - file_uploads enabled (for attachment upload features)
A 28    - session.auto_start disabled
29    - zend.ze1_compatibility_mode disabled
7d3406 30    - suhosin.session.encrypt disabled
A 31    - mbstring.func_overload disabled
140abb 32    - magic_quotes_runtime disabled
3a01c3 33 * PHP compiled with OpenSSL to connect to IMAPS and to use the spell checker
94fe9c 34 * A MySQL (4.0.8 or newer), PostgreSQL, MSSQL database engine
A 35   or the SQLite extension for PHP
1fb2c8 36 * One of the above databases with permission to create tables
7d3406 37 * An SMTP server (recommended) or PHP configured for mail delivery
535da2 38
T 39
4e17e6 40 INSTALLATION
T 41 ============
42
43 1. Decompress and put this folder somewhere inside your document root
10a699 44 2. Make sure that the following directories (and the files within)
T 45    are writable by the webserver
4e17e6 46    - /temp
T 47    - /logs
e019f2 48 3. Create a new database and a database user for Roundcube (see DATABASE SETUP)
967b34 49 4. Point your browser to http://url-to-roundcube/installer/
b8ae99 50 5. Follow the instructions of the install script (or see MANUAL CONFIGURATION)
190e97 51 6. After creating and testing the configuration, remove the installer directory
42b113 52 7. Done!
T 53
54
4b20e2 55 CONFIGURATION HINTS
T 56 ===================
57
233622 58 Roundcube writes internal errors to the 'errors' log file located in the logs
4b20e2 59 directory which can be configured in config/main.inc.php. If you want ordinary
T 60 PHP errors to be logged there as well, enable the 'php_value error_log' line
61 in the .htaccess file and set the path to the log file accordingly.
62
29640b 63 By default the session_path settings of PHP are not modified by Roundcube.
T 64 However if you want to limit the session cookies to the directory where
65 Roundcube resides you can uncomment and configure the according line
66 in the .htaccess file.
67
4b20e2 68
10a699 69 DATABASE SETUP
T 70 ==============
71
233622 72 Note: Database for Roundcube must use UTF-8 character set.
0ba548 73
fa898a 74 * MySQL
T 75 -------
10a699 76 Setting up the mysql database can be done by creating an empty database,
T 77 importing the table layout and granting the proper permissions to the
78 roundcube user. Here is an example of that procedure:
79
80 # mysql
ad5600 81 > CREATE DATABASE roundcubemail /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
10a699 82 > GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhost
6ae6e4 83     IDENTIFIED BY 'password';
10a699 84 > quit
fa898a 85
10a699 86 # mysql roundcubemail < SQL/mysql.initial.sql
535da2 87
fa898a 88 Note 1: 'password' is the master password for the roundcube user. It is strongly
3cf664 89 recommended you replace this with a more secure password. Please keep in
T 90 mind: You need to specify this password later in 'config/db.inc.php'.
fa898a 91
1cded8 92
10a699 93 * SQLite
T 94 --------
50d515 95 You need sqlite 2 (preferably 2.8) to setup the sqlite db 
A 96 (sqlite 3.x also doesn't work at the moment). Here is
10a699 97 an example how you can setup the sqlite.db for roundcube:
T 98
99 # sqlite -init SQL/sqlite.initial.sql sqlite.db
d7f49d 100 Loading resources from SQL/sqlite.initial.sql
T 101 SQLite version 2.8.16
102 Enter ".help" for instructions
103 sqlite> .exit
104 # chmod o+rw sqlite.db
10a699 105
T 106 Make sure your configuration points to the sqlite.db file and that the
83ce4b 107 webserver can write to the file and the directory containing the file.
10a699 108
T 109
1cded8 110 * PostgreSQL
T 111 ------------
233622 112 To use Roundcube with PostgreSQL support you have to follow these
a89845 113 simple steps, which have to be done as the postgres system user (or
1cded8 114 which ever is the database superuser):
T 115
a89845 116 $ createuser roundcube
ad5600 117 $ createdb -O roundcube -E UNICODE roundcubemail
1cded8 118 $ psql roundcubemail
T 119
120 roundcubemail =# ALTER USER roundcube WITH PASSWORD 'the_new_password';
a89845 121 roundcubemail =# \c - roundcube
1cded8 122 roundcubemail => \i SQL/postgres.initial.sql
T 123
a89845 124 All this has been tested with PostgreSQL 8.x and 7.4.x. Older
1cded8 125 versions don't have a -O option for the createdb, so if you are
T 126 using that version you'll have to change ownership of the DB later.
233622 127
T 128
129 Database cleaning
130 -----------------
131 Do keep your database slick and clean we recommend to periodically execute
30aa4c 132 bin/cleandb.sh which finally removes all records that are marked as deleted.
233622 133 Best solution is to install a cronjob running this script daily.
T 134
1cded8 135
T 136
190e97 137 MANUAL CONFIGURATION
T 138 ====================
535da2 139
a89845 140 First of all, rename the files config/*.inc.php.dist to config/*.inc.php.
T 141 You can then change these files according to your environment and your needs.
142 Details about the config parameters can be found in the config files.
190e97 143 See http://trac.roundcube.net/wiki/Howto_Install for even more guidance.
535da2 144
4b9efb 145 You can also modify the default .htaccess file. This is necessary to
S 146 increase the allowed size of file attachments, for example:
147     php_value       upload_max_filesize     2M
535da2 148
83ce4b 149
42b113 150 UPGRADING
T 151 =========
6ae6e4 152
233622 153 If you already have a previous version of Roundcube installed,
42b113 154 please refer to the instructions in UPGRADING guide.
4e17e6 155
T 156
d7f49d 157 OPTIMISING
T 158 ==========
159
160 There are two forms of optimisation here, compression and caching, both aimed
233622 161 at increasing an end user's experience using Roundcube Webmail. Compression
d7f49d 162 allows the static web pages to be delivered with less bandwidth. The index.php
233622 163 of Roundcube Webmail already enables compression on its output. The settings
d7f49d 164 below allow compression to occur for all static files. Caching sets HTTP 
T 165 response headers that enable a user's web client to understand what is static
166 and how to cache it.
167
168 The caching directives used are:
169  * Etags - sets at tag so the client can request is the page has changed
170  * Cache-control - defines the age of the page and that the page is 'public'
171    This enables clients to cache javascript files that don't have private 
172    information between sessions even if using HTTPS. It also allows proxies
173    to share the same cached page between users.
174  * Expires - provides another hint to increase the lifetime of static pages.
175
176 For more information refer to RFC 2616.
177
178 Side effects:
179 -------------
180 These directives are designed for production use. If you are using this in
181 a development environment you may get horribly confused if your webclient
182 is caching stuff that you changed on the server. Disabling the expires 
183 parts below should save you some grief.
184
185 If you are changing the skins, it is recommended that you copy content to 
186 a different directory apart from 'default'.
187
188 Apache:
189 -------
190 To enable these features in apache the following modules need to be enabled:
a5c2ad 191  * mod_deflate
A 192  * mod_expires
d7f49d 193  * mod_headers
T 194
195 The optimisation is already included in the .htaccess file in the top 
196 directory of your installation.
197
198 If you are using Apache version 2.2.9 and later, in the .htaccess file
199 change the 'append' word to 'merge' for a more correct response. Keeping
200 as 'append' shouldn't cause any problems though changing to merge will 
201 eliminate the possibility of duplicate 'public' headers in Cache-control.
202
203 Lighttpd:
204 ---------
205 With Lightty the addition of Expire: tags by mod_expire is incompatible with
206 the addition of "Cache-control: public". Using Cache-control 'public' is 
207 used below as it is assumed to give a better caching result.
208
209 Enable modules in server.modules:
210     "mod_setenv"
211     "mod_compress"
212
213 Mod_compress is a server side cache of compressed files to improve its performance.
214
215 $HTTP["host"] == "www.example.com" {
216
217     static-file.etags = "enable"
218     # http://redmine.lighttpd.net/projects/lighttpd/wiki/Etag.use-mtimeDetails
219     etag.use-mtime = "enable"
220
221     # http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModSetEnv
222     $HTTP["url"] =~ "^/roundcubemail/(plugins|skins|program)" {
223         setenv.add-response-header  = ( "Cache-Control" => "public, max-age=2592000")
224     }
225
226     # http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModCompress
227     # set compress.cache-dir to somewhere outside the docroot.
228     compress.cache-dir   = var.statedir + "/cache/compress"
229
230     compress.filetype = ("text/plain", "text/html", "text/javascript", "text/css", "text/xml", "image/gif", "image/png")
231 }
232
233