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