Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 69c587f

Browse files
authored
Merge branch 'master' into imgbot
2 parents 000531a + 90f317f commit 69c587f

File tree

3 files changed

+101
-64
lines changed

3 files changed

+101
-64
lines changed

src/_includes/install/allowoverrides22.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/_includes/install/allowoverrides24.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Failure to enable these settings typically results in no styles displaying on yo
1919

2020
```terminal
2121
<Directory "/var/www/html">
22-
AllowOverride <value from Apache site>
22+
AllowOverride All
2323
</Directory>
2424
```
2525

src/guides/v2.3/install-gde/prereq/apache.md

Lines changed: 100 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,26 @@ Magento supports Apache 2.4.x.
1313

1414
## Help if you are just starting out {#apache-help-beginner}
1515

16-
If you're new to all this and need some help getting started, we suggest the following:
16+
If you are new to all this and need some help getting started, we suggest the following:
1717

1818
* [Is the Magento software installed already?]({{page.baseurl }}/install-gde/basics/basics_magento-installed.html)
1919
* [What is the software that the Magento server needs to run?]({{page.baseurl }}/install-gde/basics/basics_software.html)
2020
* [What operating system is my server running?]({{page.baseurl }}/install-gde/basics/basics_os-version.html)
2121
* [How do I log in to my Magento server using a terminal, command prompt, or SSH?]({{page.baseurl }}/install-gde/basics/basics_login.html)
2222

23+
## Important: Apache required directives {#apache-required-directives}
24+
25+
1. Set `AllowEncodedSlashes` in the server config (globally) or in the virtual host configurations to avoid decoding the encoded slashes that may cause issues for URLs. For instance, when retrieving products with a slash in the SKU via the API, you will not want that converted.
26+
27+
```conf
28+
<VirtualHost *:443>
29+
...
30+
# Allow encoded slashes
31+
AllowEncodedSlashes NoDecode
32+
...
33+
</VirtualHost>
34+
```
35+
2336
## Important: Apache rewrites and .htaccess {#apache-help-rewrite}
2437

2538
This topic discusses how to enable Apache 2.2 rewrites and specify a setting for the [distributed configuration file, `.htaccess`](http://httpd.apache.org/docs/current/howto/htaccess.html){:target="_blank"}.
@@ -30,10 +43,6 @@ Magento uses server rewrites and `.htaccess` to provide directory-level instruct
3043
{% include install/allowoverrides24.md %}
3144
{% endcollapsible %}
3245

33-
{% collapsible Click to show Apache 2.2 instructions %}
34-
{% include install/allowoverrides22.md %}
35-
{% endcollapsible %}
36-
3746
{:.bs-callout-info}
3847
Failure to enable these settings typically results in no styles displaying on your storefront or Admin.
3948

@@ -105,10 +114,6 @@ To install the default version of Apache (Ubuntu 14, 16---Apache 2.4, Ubuntu 12-
105114

106115
{% include install/allowoverrides24.md %}
107116

108-
### Enable rewrites and .htaccess for Apache 2.2
109-
110-
{% include install/allowoverrides22.md %}
111-
112117
{:.ref-header}
113118
Next steps
114119

@@ -207,11 +212,92 @@ Installing and configuring Apache is basically a three-step process: install the
207212
1. Continue with the next section.
208213

209214
{:.bs-callout-info}
210-
Even though Apache 2.4 is provided by default with CentOS 7, you configure it like Apache 2.2. See the following section.
215+
Even though Apache 2.4 is provided by default with CentOS 7. See the following section to configure it.
216+
217+
### Enable rewrites and .htaccess for CentOS 7
218+
219+
1. Open `/etc/httpd/conf/httpd.conf` file for editing:
220+
221+
```bash
222+
vim /etc/httpd/conf/httpd.conf`
223+
```
224+
225+
1. Locate the block that starts with:
226+
227+
```conf
228+
<Directory /var/www/html>
229+
```
230+
231+
1. Change the value of `AllowOverride` to `All`.
232+
233+
For example,
234+
235+
```conf
236+
<Directory /var/www/>
237+
Options Indexes FollowSymLinks MultiViews
238+
AllowOverride All
239+
Order allow,deny
240+
Allow from all
241+
<Directory>
242+
```
243+
244+
{:.bs-callout-info}
245+
The preceding values for `Order` might not work in all cases. For more information, see the Apache documentation ([2.4](https://httpd.apache.org/docs/2.4/mod/mod_authz_host.html#order)).
246+
247+
1. Save the file and exit the text editor.
211248

212-
### Enable rewrites and .htaccess for Apache 2.2 (including CentOS 7)
249+
1. To apply Apache settings, restart Apache.
250+
251+
```bash
252+
service apache2 restart
253+
```
213254

214-
{% include install/allowoverrides22.md %}
255+
{:.bs-callout-info}
256+
Failure to enable these settings typically results in no styles displaying on your storefront or Admin.
257+
258+
### Enable rewrites and .htaccess for Ubuntu
259+
260+
1. Open `/etc/apache2/sites-available/default` file for editing:
261+
262+
```bash
263+
vim /etc/apache2/sites-available/default
264+
```
265+
266+
1. Locate the block that starts with:
267+
268+
* Ubuntu 12: `<Directory /var/www/>`
269+
* Ubuntu 14: `<Directory /var/www/html>`
270+
271+
1. Change the value of `AllowOverride` to `All`.
272+
273+
An example for Ubuntu 12 follows:
274+
275+
```conf
276+
<Directory /var/www/>
277+
Options Indexes FollowSymLinks MultiViews
278+
AllowOverride All
279+
Order allow,deny
280+
Allow from all
281+
<Directory>
282+
```
283+
284+
1. Save the file and exit the text editor.
285+
286+
1. Configure Apache to use the `mod_rewrite` module:
287+
288+
```bash
289+
cd /etc/apache2/mods-enabled
290+
```
291+
292+
```bash
293+
ln -s ../mods-available/rewrite.load
294+
```
295+
296+
1. Restart Apache to apply changes:
297+
298+
```bash
299+
service apache2 restart
300+
```
215301

216302
{:.ref-header}
217303
Next steps
@@ -239,7 +325,7 @@ For example:
239325
```conf
240326
<Directory /var/www/>
241327
Options Indexes FollowSymLinks MultiViews
242-
AllowOverride <value from Apache site>
328+
AllowOverride All
243329
Order allow,deny
244330
Require all granted
245331
</Directory>
@@ -257,7 +343,7 @@ For example:
257343
```conf
258344
<Directory /var/www/>
259345
Options Indexes FollowSymLinks MultiViews
260-
AllowOverride <value from Apache site>
346+
AllowOverride All
261347
Order allow,deny
262348
Allow from all
263349
</Directory>

0 commit comments

Comments
 (0)