Skip to content

Commit

Permalink
Merge pull request #7038 from magento-tango/docroot_pub_notes
Browse files Browse the repository at this point in the history
Added information about the missing settings to serve Magento app from `/pub` directory
  • Loading branch information
dobooth authored Apr 21, 2020
2 parents 9593d67 + c8c1b4e commit c6f49c5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/guides/v2.3/config-guide/prod/config-reference-envphp.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.html
17 changes: 15 additions & 2 deletions src/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,20 @@ 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
]
```
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:
Expand Down Expand Up @@ -142,7 +155,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.
Expand Down

0 comments on commit c6f49c5

Please sign in to comment.