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