Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added information about the missing settings to serve Magento app from /pub directory #7038

Merged
merged 4 commits into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
thiaramus marked this conversation as resolved.
Show resolved Hide resolved

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