PageRenderTime 52ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/docs/en/00_Getting_Started/00_Server_Requirements.md

http://github.com/silverstripe/sapphire
Markdown | 185 lines | 137 code | 48 blank | 0 comment | 0 complexity | 566e03d9226b43ef9107255e94e1c4c9 MD5 | raw file
Possible License(s): BSD-3-Clause, MIT, CC-BY-3.0, GPL-2.0, AGPL-1.0, LGPL-2.1
  1. ---
  2. title: Server Requirements
  3. icon: server
  4. summary: What you will need to run Silverstripe CMS on a web server
  5. ---
  6. # Requirements
  7. Silverstripe CMS needs to be installed on a web server. Content authors and website administrators use their web browser
  8. to access a web-based GUI to do their day-to-day work. Website designers and developers require access to the files on
  9. the server to update templates, website logic, and perform upgrades or maintenance.
  10. ## PHP
  11. * PHP >=7.1
  12. * PHP extensions: `ctype`, `dom`, `fileinfo`, `hash`, `intl`, `mbstring`, `session`, `simplexml`, `tokenizer`, `xml`
  13. * PHP configuration: `memory_limit` with at least `48M`
  14. * PHP extension for image manipulation: Either `gd` or `imagick`
  15. * PHP extension for a database connector (e.g. `pdo` or `mysqli`)
  16. Use [phpinfo()](http://php.net/manual/en/function.phpinfo.php) to inspect your configuration.
  17. ## Database
  18. * MySQL >=5.6 (built-in, [commercially supported](https://www.silverstripe.org/software/addons/silverstripe-commercially-supported-module-list/))
  19. * PostgreSQL ([third party module](https://addons.silverstripe.org/add-ons/silverstripe/postgresql), community supported)
  20. * SQL Server ([third party module](https://addons.silverstripe.org/add-ons/silverstripe/mssql), community supported)
  21. * SQLite ([third party module](https://addons.silverstripe.org/add-ons/silverstripe/sqlite3), community supported)
  22. ## Webserver Configuration
  23. ### Overview
  24. SilverStripe needs to handle a variety of HTTP requests,
  25. and relies on the hosting environment to be configured securely to
  26. enforce restrictions. There are secure defaults in place for Apache,
  27. but you should be aware of the configuration regardless of your webserver setup.
  28. ### Public webroot
  29. The webroot of your webserver should be configured to the `public/` subfolder.
  30. Projects created prior to SilverStripe 4.1 might be using the main project
  31. folder as the webroot. In this case, you are responsible for ensuring
  32. access to system files such as configuration in `*.yml` is protected
  33. from public access. We strongly recommend switching to more secure
  34. hosting via the `public/`. See [4.1.0 upgrading guide](/changelogs/4.1.0).
  35. ### Filesystem permissions
  36. SilverStripe needs write access for the webserver user to `public/assets`,
  37. and read access for that user on everything else in your webroot.
  38. ### Assets
  39. SilverStripe allows CMS authors to upload files into the `public/assets/` folder,
  40. which should be served by your webserver. **No PHP execution should be allowed in this folder**.
  41. This is configured for Apache by default via `public/assets/.htaccess`.
  42. The file is generated dynamically during the `dev/build` stage.
  43. Additionally, access is whitelisted by file extension through a
  44. dynamically generated whitelist based on the `File.allowed_extensions` setting
  45. (see [File Security](/developer_guides/files/file_security#file-types)).
  46. This whitelist uses the same defaults configured through file upload
  47. through SilverStripe, so is considered a second line of defence.
  48. ### Secure Assets
  49. Files can be kept in draft stage,
  50. and access restricted to certain user groups.
  51. These files are stored in a special `.protected` folder (defaulting to `public/assets/.protected`).
  52. **Requests to files in this folder should be denied by your webserver**.
  53. Requests to files in the `.protected` folder
  54. are routed to PHP by default when using Apache, through `public/assets/.htaccess`.
  55. If you are using another webserver, please follow our guides to ensure a secure setup.
  56. See [Developer Guides: File Security](/developer_guides/files/file_security) for details.
  57. ### Web Worker Concurrency
  58. It's generally a good idea to run multiple workers to serve multiple HTTP requests
  59. to SilverStripe concurrently. The exact number depends on your website needs.
  60. The CMS attempts to request multiple views concurrently.
  61. It also routes [protected and draft files](/developer_guides/files/file_security)
  62. through SilverStripe. This can increase your concurrency requirements,
  63. e.g. when authors batch upload and view dozens of draft files in the CMS.
  64. When allowing upload of large files through the CMS (through PHP settings),
  65. these files might be used as [protected and draft files](/developer_guides/files/file_security).
  66. Files in this state get served by SilverStripe rather than your webserver.
  67. Since the framework uses [PHP streams](https://www.php.net/manual/en/ref.stream.php),
  68. this allows serving of files larger than your PHP memory limit.
  69. Please be aware that streaming operations don't count towards
  70. PHP's [max_execution_time](https://www.php.net/manual/en/function.set-time-limit.php),
  71. which can risk exhaustion of web worker pools for long-running downloads.
  72. ### URL Rewriting
  73. SilverStripe expects URL paths to be rewritten to `public/index.php`.
  74. For Apache, this is preconfigured through `.htaccess` files,
  75. and expects using the `mod_rewrite` module.
  76. By default, these files are located in `public/.htaccess` and `public/assets/.htaccess`.
  77. ### HTTP Headers
  78. SilverStripe can add HTTP headers to reponses it handles directly.
  79. These headers are often sensitive, for example preventing HTTP caching for responses
  80. displaying data based on user sessions, or when serving protected assets.
  81. You need to ensure those headers are kept in place in your webserver.
  82. For example, Apache allows this through `Header setifempty` (see [docs](https://httpd.apache.org/docs/current/mod/mod_headers.html#header)).
  83. See [Developer Guide: Performance](/developer_guides/performance/)
  84. and [Developer Guides: File Security](/developer_guides/files/file_security) for more details.
  85. ### Symlinks
  86. SilverStripe is a modular system, with modules installed and updated
  87. via the `composer` PHP dependency manager. These are usually stored in `vendor/`,
  88. outside of the `public/` webroot. Since many modules rely on serving frontend assets
  89. such as CSS files or images, these are mapped over to the `public/_resources/` folder automatically.
  90. If the filesystem supports it, this is achieved through symlinks.
  91. Depending on your hosting and deployment mechanisms,
  92. you may need to configure the plugin to copy files instead.
  93. See [silverstripe/vendor-plugin](https://github.com/silverstripe/vendor-plugin) for details.
  94. ### Error pages
  95. The default installation includes [silverstripe/errorpage](https://addons.silverstripe.org/add-ons/silverstripe/errorpage),
  96. which generates static error pages that bypass PHP execution when those pages are published in the CMS.
  97. Once published, the static files are located in `public/assets/error-404.html` and `public/assets/error-500.html`.
  98. The default `public/.htaccess` file is configured to have Apache serve those pages based on their HTTP status code.
  99. ### Other webservers (Nginx, IIS, Lighttpd)
  100. Serving through webservers other than Apache requires more manual configuration,
  101. since the defaults configured through `.htaccess` don't apply.
  102. Please apply the considerations above to your webserver to ensure a secure hosting environment.
  103. In particular, configure protected assets correctly to avoid exposing draft or protected files uploaded through the CMS.
  104. There are various community supported installation instructions for different environments.
  105. Nginx is a popular choice, see [Nginx webserver configuration](https://forum.silverstripe.org/t/nginx-webserver-configuration/2246).
  106. SilverStripe is known to work with Microsoft IIS, and generates `web.config` files by default
  107. (see [Microsoft IIS and SQL Server configuration](https://forum.silverstripe.org/t/microsoft-iis-webserver-and-sql-server-support/2245)).
  108. Additionally, there are community supported guides for installing SilverStripe
  109. on various environments:
  110. * [Hosting via Bitnami](https://bitnami.com/stack/silverstripe/virtual-machine): In the cloud or as a locally hosted virtual machine
  111. * [Vagrant/Virtualbox with CentOS](https://forum.silverstripe.org/t/installing-via-vagrant-virtualbox-with-centos/2248)
  112. * [macOS with Homebrew](https://forum.silverstripe.org/t/installing-on-osx-with-homebrew/2247)
  113. * [macOS with MAMP](https://forum.silverstripe.org/t/installing-on-osx-with-mamp/2249)
  114. * [Windows with WAMP](https://forum.silverstripe.org/t/installing-on-windows-via-wamp/2250)
  115. * [Vagrant with silverstripe-australia/vagrant-environment](https://github.com/silverstripe-australia/vagrant-environment)
  116. * [Vagrant with BetterBrief/vagrant-skeleton](https://github.com/BetterBrief/vagrant-skeleton)
  117. ## PHP Requirements for older SilverStripe releases {#php-support}
  118. SilverStripe's PHP support has changed over time and if you are looking to upgrade PHP on your SilverStripe site, this table may be of use:
  119. | SilverStripe Version | PHP Version | More information |
  120. | -------------------- | ----------- | ---------------- |
  121. | 3.0 - 3.5 | 5.3 - 5.6 | [requirements docs](https://docs.silverstripe.org/en/3.4/getting_started/server_requirements/)
  122. | 3.6 | 5.3 - 7.1 | |
  123. | 3.7 | 5.3 - 7.3 | [changelog](https://docs.silverstripe.org/en/3/changelogs/3.7.0/) |
  124. | 4.0 - 4.4 | 5.6+ | |
  125. | 4.5+ (unreleased) | 7.1+ | [blog post](https://www.silverstripe.org/blog/our-plan-for-ending-php-5-6-support-in-silverstripe-4/) |
  126. ## CMS browser requirements
  127. SilverStripe CMS supports the following web browsers:
  128. * Google Chrome
  129. * Internet Explorer 11
  130. * Microsoft Edge
  131. * Mozilla Firefox
  132. We aim to provide satisfactory experiences in Apple Safari. SilverStripe CMS works well across Windows, Linux, and Mac operating systems.
  133. ## End user requirements
  134. SilverStripe CMS is designed to make excellent, standards-compliant websites that are compatible with a wide range of
  135. industry standard browsers and operating systems. A competent developer is able to produce websites that meet W3C
  136. guidelines for HTML, CSS, JavaScript, and accessibility, in addition to meeting specific guide lines, such as
  137. e-government requirements.