Skip to content

Commit c6f49c5

Browse files
authored
Merge pull request magento#7038 from magento-tango/docroot_pub_notes
Added information about the missing settings to serve Magento app from `/pub` directory
2 parents 9593d67 + c8c1b4e commit c6f49c5

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

src/guides/v2.3/config-guide/prod/config-reference-envphp.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The `env.php` file contains the following sections:
1515
| `cache_types` | Cache storage settings |
1616
| `crypt` | The encryption key for cryptographic functions |
1717
| `db` | Database connection settings |
18+
| `directories` | Magento directories mapping settings |
1819
| `downloadable_domains`| List of downloadable domains |
1920
| `install` | The installation date |
2021
| `lock` | Lock provider settings |
@@ -94,6 +95,16 @@ All database configurations are availble in this node.
9495
]
9596
```
9697

98+
## directories
99+
100+
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].
101+
102+
```conf
103+
'directories' => [
104+
'document_root_is_pub' => true
105+
]
106+
```
107+
97108
## downloadable_domains
98109

99110
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].
190201
[magento-mode]: {{ page.baseurl }}/config-guide/bootstrap/magento-modes.html
191202
[message-queues]: {{ page.baseurl }}/config-guide/mq/rabbitmq-overview.html
192203
[downloadable-domains]: {{ page.baseurl }}/reference/cli/magento.html#downloadabledomainsadd
204+
[change-docroot-to-pub]: {{ page.baseurl }}/install-gde/tutorials/change-docroot-to-pub.html

src/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,20 @@ Replace `192.168.33.10` with your server's hostname.
113113
UPDATE core_config_data SET value='http://192.168.33.10' WHERE path='web/unsecure/base_url';
114114
```
115115

116-
## 3. Switch modes
116+
## 3. Update the env.php file
117+
118+
The following node needs to be appended to the `env.php` file.
119+
120+
```conf
121+
'directories' => [
122+
'document_root_is_pub' => true
123+
]
124+
```
125+
126+
Refer to the [env.php reference]({{ page.baseurl }}/config-guide/prod/config-reference-envphp.html) for more information.
127+
128+
## 4. Switch modes
129+
117130
[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.
118131

119132
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 +155,7 @@ Switching between modes is an important step in verifying that your server confi
142155

143156
1. Refresh your browser and verify that the storefront displays properly.
144157

145-
## 4. Verify the storefront
158+
## 5. Verify the storefront
146159

147160
Go to the [storefront](https://glossary.magento.com/storefront) in a web browser to verify that everything is working.
148161

0 commit comments

Comments
 (0)