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