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