alecpl
2010-02-09 91790e41f3fa307658077043bc2fa5f71e270cf4
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)
7d3406 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
59
10a699 60 DATABASE SETUP
T 61 ==============
62
0ba548 63 Note: Database for RoundCube must use UTF-8 character set.
A 64
fa898a 65 * MySQL
T 66 -------
10a699 67 Setting up the mysql database can be done by creating an empty database,
T 68 importing the table layout and granting the proper permissions to the
69 roundcube user. Here is an example of that procedure:
70
71 # mysql
ad5600 72 > CREATE DATABASE roundcubemail /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */;
10a699 73 > GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhost
6ae6e4 74     IDENTIFIED BY 'password';
10a699 75 > quit
fa898a 76
10a699 77 # mysql roundcubemail < SQL/mysql.initial.sql
535da2 78
fa898a 79 Note 1: 'password' is the master password for the roundcube user. It is strongly
3cf664 80 recommended you replace this with a more secure password. Please keep in
T 81 mind: You need to specify this password later in 'config/db.inc.php'.
fa898a 82
1cded8 83
10a699 84 * SQLite
T 85 --------
50d515 86 You need sqlite 2 (preferably 2.8) to setup the sqlite db 
A 87 (sqlite 3.x also doesn't work at the moment). Here is
10a699 88 an example how you can setup the sqlite.db for roundcube:
T 89
90 # sqlite -init SQL/sqlite.initial.sql sqlite.db
d7f49d 91 Loading resources from SQL/sqlite.initial.sql
T 92 SQLite version 2.8.16
93 Enter ".help" for instructions
94 sqlite> .exit
95 # chmod o+rw sqlite.db
10a699 96
T 97 Make sure your configuration points to the sqlite.db file and that the
83ce4b 98 webserver can write to the file and the directory containing the file.
10a699 99
T 100
1cded8 101 * PostgreSQL
T 102 ------------
a89845 103 To use RoundCube with PostgreSQL support you have to follow these
T 104 simple steps, which have to be done as the postgres system user (or
1cded8 105 which ever is the database superuser):
T 106
a89845 107 $ createuser roundcube
ad5600 108 $ createdb -O roundcube -E UNICODE roundcubemail
1cded8 109 $ psql roundcubemail
T 110
111 roundcubemail =# ALTER USER roundcube WITH PASSWORD 'the_new_password';
a89845 112 roundcubemail =# \c - roundcube
1cded8 113 roundcubemail => \i SQL/postgres.initial.sql
T 114
a89845 115 All this has been tested with PostgreSQL 8.x and 7.4.x. Older
1cded8 116 versions don't have a -O option for the createdb, so if you are
T 117 using that version you'll have to change ownership of the DB later.
118
119
190e97 120 MANUAL CONFIGURATION
T 121 ====================
535da2 122
a89845 123 First of all, rename the files config/*.inc.php.dist to config/*.inc.php.
T 124 You can then change these files according to your environment and your needs.
125 Details about the config parameters can be found in the config files.
190e97 126 See http://trac.roundcube.net/wiki/Howto_Install for even more guidance.
535da2 127
4b9efb 128 You can also modify the default .htaccess file. This is necessary to
S 129 increase the allowed size of file attachments, for example:
130     php_value       upload_max_filesize     2M
535da2 131
83ce4b 132
42b113 133 UPGRADING
T 134 =========
6ae6e4 135
42b113 136 If you already have a previous version of RoundCube installed,
T 137 please refer to the instructions in UPGRADING guide.
4e17e6 138
T 139
d7f49d 140 OPTIMISING
T 141 ==========
142
143 There are two forms of optimisation here, compression and caching, both aimed
144 at increasing an end user's experience using RoundCube Webmail. Compression
145 allows the static web pages to be delivered with less bandwidth. The index.php
146 of RoundCube Webmail already enables compression on its output. The settings
147 below allow compression to occur for all static files. Caching sets HTTP 
148 response headers that enable a user's web client to understand what is static
149 and how to cache it.
150
151 The caching directives used are:
152  * Etags - sets at tag so the client can request is the page has changed
153  * Cache-control - defines the age of the page and that the page is 'public'
154    This enables clients to cache javascript files that don't have private 
155    information between sessions even if using HTTPS. It also allows proxies
156    to share the same cached page between users.
157  * Expires - provides another hint to increase the lifetime of static pages.
158
159 For more information refer to RFC 2616.
160
161 Side effects:
162 -------------
163 These directives are designed for production use. If you are using this in
164 a development environment you may get horribly confused if your webclient
165 is caching stuff that you changed on the server. Disabling the expires 
166 parts below should save you some grief.
167
168 If you are changing the skins, it is recommended that you copy content to 
169 a different directory apart from 'default'.
170
171 Apache:
172 -------
173 To enable these features in apache the following modules need to be enabled:
a5c2ad 174  * mod_deflate
A 175  * mod_expires
d7f49d 176  * mod_headers
T 177
178 The optimisation is already included in the .htaccess file in the top 
179 directory of your installation.
180
181 If you are using Apache version 2.2.9 and later, in the .htaccess file
182 change the 'append' word to 'merge' for a more correct response. Keeping
183 as 'append' shouldn't cause any problems though changing to merge will 
184 eliminate the possibility of duplicate 'public' headers in Cache-control.
185
186 Lighttpd:
187 ---------
188 With Lightty the addition of Expire: tags by mod_expire is incompatible with
189 the addition of "Cache-control: public". Using Cache-control 'public' is 
190 used below as it is assumed to give a better caching result.
191
192 Enable modules in server.modules:
193     "mod_setenv"
194     "mod_compress"
195
196 Mod_compress is a server side cache of compressed files to improve its performance.
197
198 $HTTP["host"] == "www.example.com" {
199
200     static-file.etags = "enable"
201     # http://redmine.lighttpd.net/projects/lighttpd/wiki/Etag.use-mtimeDetails
202     etag.use-mtime = "enable"
203
204     # http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModSetEnv
205     $HTTP["url"] =~ "^/roundcubemail/(plugins|skins|program)" {
206         setenv.add-response-header  = ( "Cache-Control" => "public, max-age=2592000")
207     }
208
209     # http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModCompress
210     # set compress.cache-dir to somewhere outside the docroot.
211     compress.cache-dir   = var.statedir + "/cache/compress"
212
213     compress.filetype = ("text/plain", "text/html", "text/javascript", "text/css", "text/xml", "image/gif", "image/png")
214 }
215
216