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