From 8c9671beb5981ac898d7cb24038d6870b38d5275 Mon Sep 17 00:00:00 2001 From: Roman Lytvynenko Date: Tue, 14 Apr 2020 15:37:42 -0500 Subject: [PATCH 1/3] Added information about the missing settings and steps when the web server is being configured to serve the Magento app from the `/pub` directory. --- .../config-guide/prod/config-reference-envphp.md | 12 ++++++++++++ .../tutorials/change-docroot-to-pub.md | 16 ++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/guides/v2.3/config-guide/prod/config-reference-envphp.md b/src/guides/v2.3/config-guide/prod/config-reference-envphp.md index 76f2e2ff046..f39e466911e 100644 --- a/src/guides/v2.3/config-guide/prod/config-reference-envphp.md +++ b/src/guides/v2.3/config-guide/prod/config-reference-envphp.md @@ -15,6 +15,7 @@ The `env.php` file contains the following sections: | `cache_types` | Cache storage settings | | `crypt` | The encryption key for cryptographic functions | | `db` | Database connection settings | +| `directories` | Magento directories mapping settings | | `downloadable_domains`| List of downloadable domains | | `install` | The installation date | | `lock` | Lock provider settings | @@ -94,6 +95,16 @@ All database configurations are availble in this node. ] ``` +## directories + +Optional directory mapping options that need to be set when the web server is configured to serve Magento app from the `/pub` directory for [improved security][change-docroot-to-pub]. + +```conf +'directories' => [ + 'document_root_is_pub' => true +] +``` + ## downloadable_domains A list of downloadable domains available in this node. Additional domains can be added, removed, or listed using CLI commands. @@ -190,3 +201,4 @@ Learn more about session in [x-frame-options][x-frame-options]. [magento-mode]: {{ page.baseurl }}/config-guide/bootstrap/magento-modes.html [message-queues]: {{ page.baseurl }}/config-guide/mq/rabbitmq-overview.html [downloadable-domains]: {{ page.baseurl }}/reference/cli/magento.html#downloadabledomainsadd +[change-docroot-to-pub]: {{ page.baseurl }}/install-gde/tutorials/change-docroot-to-pub diff --git a/src/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.md b/src/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.md index 9718ffb9008..92fe2a47edc 100644 --- a/src/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.md +++ b/src/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.md @@ -113,7 +113,19 @@ Replace `192.168.33.10` with your server's hostname. UPDATE core_config_data SET value='http://192.168.33.10' WHERE path='web/unsecure/base_url'; ``` -## 3. Switch modes +## 3. Update the env.php file +The following node needs to be appended to the `env.php` file. + +```conf +'directories' => [ + 'document_root_is_pub' => true +] +``` + +{:.bs-callout-info} +Refer to the [env.php reference]({{ page.baseurl }}/config-guide/prod/config-reference-envphp.html) for more information. + +## 4. Switch modes [Magento modes]({{ page.baseurl }}/config-guide/bootstrap/magento-modes.html), which include `production` and `developer`, are designed to improve security and make development easier. As the names suggest, you should switch to `developer` mode when extending or customizing Magento and switch to `production` mode when running Magento in a live environment. Switching between modes is an important step in verifying that your server configuration is working properly. You can switch between modes using the Magento CLI tool: @@ -142,7 +154,7 @@ Switching between modes is an important step in verifying that your server confi 1. Refresh your browser and verify that the storefront displays properly. -## 4. Verify the storefront +## 5. Verify the storefront Go to the [storefront](https://glossary.magento.com/storefront) in a web browser to verify that everything is working. From 8ce9145bd07f2c88ddadc85d98080809f643f884 Mon Sep 17 00:00:00 2001 From: Roman Lytvynenko Date: Mon, 20 Apr 2020 15:27:00 -0500 Subject: [PATCH 2/3] Added information about the missing settings and steps when the web server is being configured to serve the Magento app from the `/pub` directory. --- src/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.md b/src/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.md index 92fe2a47edc..9569825d873 100644 --- a/src/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.md +++ b/src/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.md @@ -114,6 +114,7 @@ Replace `192.168.33.10` with your server's hostname. ``` ## 3. Update the env.php file + The following node needs to be appended to the `env.php` file. ```conf @@ -122,10 +123,10 @@ The following node needs to be appended to the `env.php` file. ] ``` -{:.bs-callout-info} Refer to the [env.php reference]({{ page.baseurl }}/config-guide/prod/config-reference-envphp.html) for more information. ## 4. Switch modes + [Magento modes]({{ page.baseurl }}/config-guide/bootstrap/magento-modes.html), which include `production` and `developer`, are designed to improve security and make development easier. As the names suggest, you should switch to `developer` mode when extending or customizing Magento and switch to `production` mode when running Magento in a live environment. Switching between modes is an important step in verifying that your server configuration is working properly. You can switch between modes using the Magento CLI tool: From c8c1b4e6e6916da1df8fa7bca0efd1c492fe9c80 Mon Sep 17 00:00:00 2001 From: Roman Lytvynenko Date: Tue, 21 Apr 2020 08:02:58 -0500 Subject: [PATCH 3/3] Added information about the missing settings and steps when the web server is being configured to serve the Magento app from the `/pub` directory. --- src/guides/v2.3/config-guide/prod/config-reference-envphp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guides/v2.3/config-guide/prod/config-reference-envphp.md b/src/guides/v2.3/config-guide/prod/config-reference-envphp.md index f39e466911e..60e4718b7e6 100644 --- a/src/guides/v2.3/config-guide/prod/config-reference-envphp.md +++ b/src/guides/v2.3/config-guide/prod/config-reference-envphp.md @@ -201,4 +201,4 @@ Learn more about session in [x-frame-options][x-frame-options]. [magento-mode]: {{ page.baseurl }}/config-guide/bootstrap/magento-modes.html [message-queues]: {{ page.baseurl }}/config-guide/mq/rabbitmq-overview.html [downloadable-domains]: {{ page.baseurl }}/reference/cli/magento.html#downloadabledomainsadd -[change-docroot-to-pub]: {{ page.baseurl }}/install-gde/tutorials/change-docroot-to-pub +[change-docroot-to-pub]: {{ page.baseurl }}/install-gde/tutorials/change-docroot-to-pub.html