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