RoundCube Webmail
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

306 lines
12 KiB

20 years ago
16 years ago
20 years ago
20 years ago
7 years ago
8 years ago
8 years ago
20 years ago
  1. INTRODUCTION
  2. ============
  3. This file describes the basic steps to install Roundcube Webmail on your
  4. web server. For additional information, please also consult the project's
  5. wiki page at https://github.com/roundcube/roundcubemail/wiki
  6. REQUIREMENTS
  7. ============
  8. * An IMAP, HTTP and SMTP server
  9. * .htaccess support allowing overrides for DirectoryIndex
  10. * PHP Version 5.5 or greater including:
  11. - PCRE, DOM, JSON, Session, Sockets, OpenSSL, Mbstring, Filter, Ctype, Intl (required)
  12. - PHP PDO with driver for either MySQL, PostgreSQL, SQL Server, Oracle or SQLite (required)
  13. - Iconv, Zip, Fileinfo, Exif (recommended)
  14. - LDAP for LDAP addressbook support (optional)
  15. - GD, Imagick (optional thumbnails generation, QR-code)
  16. * PEAR and PEAR packages distributed with Roundcube or external.
  17. See composer.json-dist for the list of required packages.
  18. * php.ini options:
  19. - error_reporting E_ALL & ~E_NOTICE & ~E_STRICT
  20. - memory_limit > 16MB
  21. - file_uploads enabled (for uploading attachments and import files)
  22. - session.auto_start disabled
  23. - suhosin.session.encrypt disabled
  24. - mbstring.func_overload disabled
  25. - pcre.backtrack_limit >= 100000
  26. * A MySQL, PostgreSQL, MS SQL Server (2005 or newer), Oracle database
  27. or SQLite v3 support in PHP - with permission to create tables
  28. * Composer installed either locally or globally (https://getcomposer.org)
  29. INSTALLATION
  30. ============
  31. 1. Decompress and put this folder somewhere inside your document root.
  32. Note: Make sure files have proper owner/group for your setup. If you use
  33. tar command `--no-same-owner` option might be helpful.
  34. 2. In case you don't use the so-called "complete" release package,
  35. you have to install PHP and javascript dependencies.
  36. 2.1. Install PHP dependencies using composer:
  37. - get composer from https://getcomposer.org/download/
  38. - rename the composer.json-dist file into composer.json
  39. - if you want to use LDAP address books, enable the LDAP libraries in your
  40. composer.json file by moving the items from "suggest" to the "require"
  41. section (remove the explanation texts after the version!).
  42. - run `php composer.phar install --no-dev`
  43. 2.2. Install Javascript dependencies by executing `bin/install-jsdeps.sh` script.
  44. 3. Make sure that the following directories (and the files within)
  45. are writable by the webserver
  46. - /temp
  47. - /logs
  48. 4. Create a new database and a database user for Roundcube (see DATABASE SETUP)
  49. 5. Point your browser to http://url-to-roundcube/installer/
  50. 6. Follow the instructions of the install script (or see MANUAL CONFIGURATION)
  51. 7. After creating and testing the configuration, remove the installer directory
  52. ------------------------------------------
  53. IMPORTANT: REMOVE THE INSTALLER DIRECTORY!
  54. ------------------------------------------
  55. 8. If you use git sources compile css files for the Elastic skin (required
  56. lessc >= 2.5.2):
  57. $ cd skins/elastic
  58. $ lessc --clean-css="--s1 --advanced" styles/styles.less > styles/styles.min.css
  59. $ lessc --clean-css="--s1 --advanced" styles/print.less > styles/print.min.css
  60. $ lessc --clean-css="--s1 --advanced" styles/embed.less > styles/embed.min.css
  61. 9. Check Known Issues section of this file
  62. CONFIGURATION HINTS
  63. ===================
  64. IMPORTANT! Read all comments in defaults.inc.php, understand them
  65. and configure your installation to be not surprised by default behaviour.
  66. Roundcube writes internal errors to the 'errors.log' log file located in the logs
  67. directory which can be configured in config/config.inc.php. If you want ordinary
  68. PHP errors to be logged there as well, set error_log in php.ini or .htaccess file.
  69. Roundcube forces display_errors=Off and log_errors=On.
  70. By default the session cookie settings of PHP are not modified by Roundcube.
  71. However if you want to limit the session cookies to the directory where
  72. Roundcube resides you can set session.cookie_path in the php.ini or .htaccess file.
  73. More about PHP settings: https://github.com/roundcube/roundcubemail/wiki/Installation#php-configuration
  74. DATABASE SETUP
  75. ==============
  76. Note: Database for Roundcube must use UTF-8 character set.
  77. Note: See defaults.inc.php file for examples of DSN configuration.
  78. * MySQL
  79. -------
  80. Setting up the mysql database can be done by creating an empty database,
  81. importing the table layout and granting the proper permissions to the
  82. roundcube user. Here is an example of that procedure:
  83. # mysql
  84. > CREATE DATABASE roundcubemail CHARACTER SET utf8 COLLATE utf8_general_ci;
  85. > CREATE USER roundcube@localhost IDENTIFIED BY 'password';
  86. > GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhost;
  87. > quit
  88. # mysql roundcubemail < SQL/mysql.initial.sql
  89. Note 1: 'password' is the master password for the roundcube user. It is strongly
  90. recommended you replace this with a more secure password. Please keep in
  91. mind: You need to specify this password later in 'config/db.inc.php'.
  92. Note 2: When using MySQL < 5.7.7 or MariaDB < 10.2.2 it is required to configure
  93. the database engine with:
  94. innodb_large_prefix=true
  95. innodb_file_format=Barracuda
  96. * SQLite
  97. --------
  98. Versions of sqlite database engine older than 3.0 aren't supported.
  99. Database file and structure is created automatically by Roundcube.
  100. Make sure your configuration points to some file location and that the
  101. webserver can write to the file and the directory containing the file.
  102. * PostgreSQL
  103. ------------
  104. To use Roundcube with PostgreSQL support you have to follow these
  105. simple steps, which have to be done as the postgres system user (or
  106. which ever is the database superuser):
  107. $ createuser -P roundcube
  108. $ createdb -O roundcube -E UNICODE roundcubemail
  109. $ psql -U roundcube -f SQL/postgres.initial.sql roundcubemail
  110. Note: in some system configurations you might need to add '-U postgres' to
  111. createuser and createdb commands.
  112. * Microsoft SQL Server
  113. ----------------------
  114. Language/locale of the database must be set to us_english (1033). More info
  115. on this at https://github.com/roundcube/roundcubemail/issues/4078.
  116. Database cleaning
  117. -----------------
  118. To keep your database slick and clean we recommend to periodically execute
  119. bin/cleandb.sh which finally removes all records that are marked as deleted.
  120. Best solution is to install a cronjob running this script daily.
  121. MANUAL CONFIGURATION
  122. ====================
  123. First of all, copy the sample configuration file config/config.inc.php.sample
  124. to config/config.inc.php and make the necessary adjustments according to your
  125. environment and your needs. More configuration options can be copied from the
  126. config/defaults.inc.php file into your local config.inc.php file as needed.
  127. Read the comments above the individual configuration options to find out what
  128. they do or read https://github.com/roundcube/roundcubemail/wiki/Installation
  129. for even more guidance.
  130. The maximum size of email attachments and other file uploads is controlled by
  131. PHP settings: upload_max_filesize and post_max_size. Read more about PHP
  132. settings at https://github.com/roundcube/roundcubemail/wiki/Installation#php-configuration.
  133. SECURE YOUR INSTALLATION
  134. ========================
  135. Access through the webserver to the following directories should be denied:
  136. /config
  137. /temp
  138. /logs
  139. Roundcube uses .htaccess files to protect these directories, so be sure to
  140. allow override of the Limit directives to get them taken into account. The
  141. package also ships a .htaccess file in the root directory which defines some
  142. rewrite rules. In order to properly secure your installation, please enable
  143. mod_rewrite for Apache webserver and double check access to the above listed
  144. directories and their contents is denied.
  145. NOTE: In Apache 2.4, support for .htaccess files has been disabled by
  146. default. Therefore you first need to enable this in your Apache main or
  147. virtual host config by with:
  148. AllowOverride all
  149. For non-apache web servers add equivalent configuration parameters to deny
  150. direct access to these private resources.
  151. It is also recommended to change the document root to <install path>/public_html
  152. after installation if Roundcube runs at root of a dedicated virtual host. This
  153. will automatically keep sensitive files out of reach for http requests.
  154. UPGRADING
  155. =========
  156. If you already have a previous version of Roundcube installed,
  157. please refer to the instructions in UPGRADING guide.
  158. OPTIMISING
  159. ==========
  160. There are two forms of optimisation here, compression and caching, both aimed
  161. at increasing an end user's experience using Roundcube Webmail. Compression
  162. allows the static web pages to be delivered with less bandwidth. The index.php
  163. of Roundcube Webmail already enables compression on its output. The settings
  164. below allow compression to occur for all static files. Caching sets HTTP
  165. response headers that enable a user's web client to understand what is static
  166. and how to cache it.
  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. For more information refer to RFC 2616.
  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. If you are changing the skins, it is recommended that you copy content to
  182. a different directory apart from 'default'.
  183. Apache:
  184. -------
  185. To enable these features in apache the following modules need to be enabled:
  186. * mod_deflate
  187. * mod_expires
  188. * mod_headers
  189. The optimisation is already included in the .htaccess file in the top
  190. directory of your installation.
  191. Lighttpd:
  192. ---------
  193. With Lightty the addition of Expire: tags by mod_expire is incompatible with
  194. the addition of "Cache-control: public". Using Cache-control 'public' is
  195. used below as it is assumed to give a better caching result.
  196. Enable modules in server.modules:
  197. "mod_setenv"
  198. "mod_compress"
  199. Mod_compress is a server side cache of compressed files to improve its performance.
  200. $HTTP["host"] == "www.example.com" {
  201. static-file.etags = "enable"
  202. # http://redmine.lighttpd.net/projects/lighttpd/wiki/Etag.use-mtimeDetails
  203. etag.use-mtime = "enable"
  204. # http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModSetEnv
  205. $HTTP["url"] =~ "^/roundcubemail/(plugins|skins|program)" {
  206. setenv.add-response-header = ( "Cache-Control" => "public, max-age=2592000")
  207. }
  208. # http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModCompress
  209. # set compress.cache-dir to somewhere outside the docroot.
  210. compress.cache-dir = var.statedir + "/cache/compress"
  211. compress.filetype = ("text/plain", "text/html", "text/javascript", "text/css", "text/xml", "image/gif", "image/png")
  212. }
  213. KNOWN ISSUES
  214. ============
  215. Installations with uw-imap server should set imap_disabled_caps = array('ESEARCH')
  216. in main configuration file. ESEARCH implementation in this server is broken (#1489184).
  217. PHP >= 5.6 validates the ssl certificates by default. It means that
  218. if IMAP/SMTP certificates are self-signed or use wrong host name you'll get
  219. connection errors. A solution in such cases is to set imap_conn_options,
  220. smtp_conn_options and managesieve_conn_options in a way described in config/defaults.inc.php.
  221. If you have problems with temp files or non-working logs make sure temp and logs folders
  222. are writeable to the user used by http server. Access to them may also be blocked by
  223. SELINUX. Here's some sample commands for SELINUX:
  224. $ semanage fcontext -a -t httpd_sys_rw_content_t "/path_to_roundcube/logs(/.*)?"
  225. $ semanage fcontext -a -t httpd_sys_rw_content_t "/path_to_roundcube/temp(/.*)?"
  226. $ restorecon -Rv /path_to_roundcube/
  227. Microsoft IIS Server by default does not support WOFF fonts used in Elastic skin. It might be
  228. needed to add following MIME Types definitions (via web.config or IIS Manager):
  229. .woff application/font-woff
  230. .woff2 application/font-woff2
  231. When installing on Windows be aware we're using symbolic links which may need an additional
  232. attention. See https://github.com/roundcube/roundcubemail/issues/7151.