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.

310 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 7.3 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, XMLWriter (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 utf8mb4 COLLATE utf8mb4_unicode_ci;
  85. > CREATE USER roundcube@localhost IDENTIFIED BY 'password';
  86. > GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhost;
  87. > quit
  88. Note 1: 'password' is the master password for the roundcube user. It is strongly
  89. recommended you replace this with a more secure password. Please keep in
  90. mind that you must specify this password later in 'config/config.inc.php'.
  91. Note 2: When using MySQL < 5.7.7 or MariaDB < 10.2.2 it is required to configure
  92. the database engine with:
  93. innodb_large_prefix=1
  94. innodb_file_per_table=1
  95. innodb_file_format=Barracuda
  96. Now you can run the Installer or configure the database access options in
  97. 'config/config.inc.php' and run: `bin/initdb.sh --dir=SQL`.
  98. * SQLite
  99. --------
  100. Versions of sqlite database engine older than 3.6.19 aren't supported.
  101. Database file and structure is created automatically by Roundcube.
  102. Make sure your configuration points to some file location and that the
  103. webserver can write to the file and the directory containing the file.
  104. * PostgreSQL
  105. ------------
  106. To use Roundcube with PostgreSQL support you have to follow these
  107. simple steps, which have to be done as the postgres system user (or
  108. which ever is the database superuser):
  109. $ createuser -P roundcube
  110. $ createdb -O roundcube -E UNICODE roundcubemail
  111. Note: in some system configurations you might need to add '-U postgres' to
  112. createuser and createdb commands.
  113. Now you can run the Installer or configure the database access options in
  114. 'config/config.inc.php' and run: `bin/initdb.sh --dir=SQL`.
  115. * Microsoft SQL Server
  116. ----------------------
  117. Language/locale of the database must be set to us_english (1033). More info
  118. on this at https://github.com/roundcube/roundcubemail/issues/4078.
  119. Database cleaning
  120. -----------------
  121. To keep your database slick and clean we recommend to periodically execute
  122. bin/cleandb.sh which finally removes all records that are marked as deleted.
  123. Best solution is to install a cronjob running this script daily.
  124. MANUAL CONFIGURATION
  125. ====================
  126. First of all, copy the sample configuration file config/config.inc.php.sample
  127. to config/config.inc.php and make the necessary adjustments according to your
  128. environment and your needs. More configuration options can be copied from the
  129. config/defaults.inc.php file into your local config.inc.php file as needed.
  130. Read the comments above the individual configuration options to find out what
  131. they do or read https://github.com/roundcube/roundcubemail/wiki/Installation
  132. for even more guidance.
  133. The maximum size of email attachments and other file uploads is controlled by
  134. PHP settings: upload_max_filesize and post_max_size. Read more about PHP
  135. settings at https://github.com/roundcube/roundcubemail/wiki/Installation#php-configuration.
  136. SECURE YOUR INSTALLATION
  137. ========================
  138. Access through the webserver to the following directories should be denied:
  139. /config
  140. /temp
  141. /logs
  142. Roundcube uses .htaccess files to protect these directories, so be sure to
  143. allow override of the Limit directives to get them taken into account. The
  144. package also ships a .htaccess file in the root directory which defines some
  145. rewrite rules. In order to properly secure your installation, please enable
  146. mod_rewrite for Apache webserver and double check access to the above listed
  147. directories and their contents is denied.
  148. NOTE: In Apache 2.4, support for .htaccess files has been disabled by
  149. default. Therefore you first need to enable this in your Apache main or
  150. virtual host config by with:
  151. AllowOverride all
  152. For non-apache web servers add equivalent configuration parameters to deny
  153. direct access to these private resources.
  154. It is also recommended to change the document root to <install path>/public_html
  155. after installation if Roundcube runs at root of a dedicated virtual host. This
  156. will automatically keep sensitive files out of reach for http requests.
  157. UPGRADING
  158. =========
  159. If you already have a previous version of Roundcube installed,
  160. please refer to the instructions in UPGRADING guide.
  161. OPTIMISING
  162. ==========
  163. There are two forms of optimization here, compression and caching, both aimed
  164. at increasing an end user's experience using Roundcube Webmail. Compression
  165. allows the static web pages to be delivered with less bandwidth. The index.php
  166. of Roundcube Webmail already enables compression on its output. The settings
  167. below allow compression to occur for all static files. Caching sets HTTP
  168. response headers that enable a user's web client to understand what is static
  169. and how to cache it.
  170. The caching directives used are:
  171. * Etags - sets at tag so the client can request is the page has changed
  172. * Cache-control - defines the age of the page and that the page is 'public'
  173. This enables clients to cache javascript files that don't have private
  174. information between sessions even if using HTTPS. It also allows proxies
  175. to share the same cached page between users.
  176. * Expires - provides another hint to increase the lifetime of static pages.
  177. For more information refer to RFC 2616.
  178. Side effects:
  179. -------------
  180. These directives are designed for production use. If you are using this in
  181. a development environment you may get horribly confused if your webclient
  182. is caching stuff that you changed on the server. Disabling the expires
  183. parts below should save you some grief.
  184. If you are changing the skins, it is recommended that you copy content to
  185. a different directory apart from 'default'.
  186. Apache:
  187. -------
  188. To enable these features in apache the following modules need to be enabled:
  189. * mod_deflate
  190. * mod_expires
  191. * mod_headers
  192. The optimization is already included in the .htaccess file in the top
  193. directory of your installation.
  194. Lighttpd:
  195. ---------
  196. With Lighttpd the addition of Expire: tags by mod_expire is incompatible with
  197. the addition of "Cache-control: public". Using Cache-control 'public' is
  198. used below as it is assumed to give a better caching result.
  199. Enable modules in server.modules:
  200. "mod_setenv"
  201. "mod_compress"
  202. Mod_compress is a server side cache of compressed files to improve its performance.
  203. $HTTP["host"] == "www.example.com" {
  204. static-file.etags = "enable"
  205. # http://redmine.lighttpd.net/projects/lighttpd/wiki/Etag.use-mtimeDetails
  206. etag.use-mtime = "enable"
  207. # http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModSetEnv
  208. $HTTP["url"] =~ "^/roundcubemail/(plugins|skins|program)" {
  209. setenv.add-response-header = ( "Cache-Control" => "public, max-age=2592000")
  210. }
  211. # http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModCompress
  212. # set compress.cache-dir to somewhere outside the docroot.
  213. compress.cache-dir = var.statedir + "/cache/compress"
  214. compress.filetype = ("text/plain", "text/html", "text/javascript", "text/css", "text/xml", "image/gif", "image/png")
  215. }
  216. KNOWN ISSUES
  217. ============
  218. Installations with uw-imap server should set imap_disabled_caps = array('ESEARCH')
  219. in main configuration file. ESEARCH implementation in this server is broken (#1489184).
  220. PHP >= 5.6 validates the ssl certificates by default. It means that
  221. if IMAP/SMTP certificates are self-signed or use wrong host name you'll get
  222. connection errors. A solution in such cases is to set imap_conn_options,
  223. smtp_conn_options and managesieve_conn_options in a way described in config/defaults.inc.php.
  224. If you have problems with temp files or non-working logs make sure temp and logs folders
  225. are writeable to the user used by http server. Access to them may also be blocked by
  226. SELINUX. Here's some sample commands for SELINUX:
  227. $ semanage fcontext -a -t httpd_sys_rw_content_t "/path_to_roundcube/logs(/.*)?"
  228. $ semanage fcontext -a -t httpd_sys_rw_content_t "/path_to_roundcube/temp(/.*)?"
  229. $ restorecon -Rv /path_to_roundcube/
  230. Microsoft IIS Server by default does not support WOFF fonts used in Elastic skin. It might be
  231. needed to add following MIME Types definitions (via web.config or IIS Manager):
  232. .woff application/font-woff
  233. .woff2 application/font-woff2
  234. When installing on Windows be aware we're using symbolic links which may need an additional
  235. attention. See https://github.com/roundcube/roundcubemail/issues/7151.