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

Commit b80bd28

Browse files
Merge pull request #5439 from magento/code-blocks
Merge code block fixes from integration branch (MD040)
2 parents 296de4a + 19e82b6 commit b80bd28

File tree

23 files changed

+245
-147
lines changed

23 files changed

+245
-147
lines changed

_includes/comp-man/checklist.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,23 @@ Magento requires three cron jobs, all running as the [Magento file system owner]
1717

1818
To verify your cron jobs are set up properly, enter the following command as a user with `root` privileges:
1919

20-
crontab -u <magento file system owner> -l
20+
```bash
21+
crontab -u <magento file system owner> -l
22+
```
2123

2224
For example, if your Magento file system owner is named `magento_user`, enter:
2325

24-
crontab -u magento_user -l
26+
```bash
27+
crontab -u magento_user -l
28+
```
2529

2630
Results similar to the following should display:
2731

28-
* * * * * /usr/bin/php /var/www/magento2/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /var/www/magento2/var/log/magento.cron.log
29-
* * * * * /usr/bin/php /var/www/magento2/update/cron.php >> /var/www/magento2/var/log/update.cron.log
30-
* * * * * /usr/bin/php /var/www/magento2/bin/magento setup:cron:run >> /var/www/magento2/var/log/setup.cron.log
32+
```terminal
33+
* * * * * /usr/bin/php /var/www/magento2/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /var/www/magento2/var/log/magento.cron.log
34+
* * * * * /usr/bin/php /var/www/magento2/update/cron.php >> /var/www/magento2/var/log/update.cron.log
35+
* * * * * /usr/bin/php /var/www/magento2/bin/magento setup:cron:run >> /var/www/magento2/var/log/setup.cron.log
36+
```
3137

3238
Another symptom of cron not running is the following error in the Magento Admin:
3339

@@ -49,7 +55,9 @@ To verify your file system permissions are set properly, either log in to the Ma
4955

5056
For example, enter the following commands on a Linux system if the Magento application is installed in `/var/www/html/magento2`:
5157

52-
ls -al /var/www/html/magento2
58+
```bash
59+
ls -al /var/www/html/magento2
60+
```
5361

5462
A sample result follows:
5563

@@ -92,7 +100,9 @@ In the preceding example, the Magento file system owner is `magento_user`. Direc
92100

93101
To get more detailed information, you can optionally enter the following command:
94102

95-
ls -al /var/www/html/magento2/pub
103+
```bash
104+
ls -al /var/www/html/magento2/pub
105+
```
96106

97107
Because Magento deploys static file assets to subdirectories of `pub`, it's a good idea to verify permissions and ownership there as well.
98108

guides/v2.2/comp-mgr/extens-man/extensman-uninst-data.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ After backing up, you have the choice of removing data from the Magento 2 databa
1919

2020
If the [extension](https://glossary.magento.com/extension) has no data to remove, the following message displays. (If a extension has data but no uninstall script, the same prompt displays. In that case, contact the vendor or remove database data manually.)
2121

22-
The selected extension has no data to remove.
22+
```terminal
23+
The selected extension has no data to remove.
24+
```
2325

2426
If the extension has data to remove, a page similar to the following displays.
2527

@@ -30,7 +32,6 @@ Click one of the following:
3032
* **Keep data**: Click to keep the data in the database.
3133
* **Remove data**: Click to remove data from the database.
3234

33-
You can click **Back** to back up the database first if you did not do so already.
35+
You can click **Back** to back up the database first if you did not do so already.
3436

3537
Continue with [Step 4. Uninstall]({{ page.baseurl }}/comp-mgr/extens-man/extensman-uninst-final.html)
36-

guides/v2.2/comp-mgr/trouble/cman/maint-mode.md

Lines changed: 51 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,20 @@ To redirect traffic to a custom maintenance page:
7171
* Redirect all traffic to the maintenance page
7272
* Whitelist certain IPs so an administrator can run the System Upgrade utility to upgrade the Magento software.
7373

74-
The following example whitelists 192.0.2.110.
74+
The following example whitelists 192.0.2.110.
7575

76-
Add the following at the end of your Apache configuration file:
76+
Add the following at the end of your Apache configuration file:
7777

78-
RewriteEngine On
79-
RewriteCond %{REMOTE_ADDR} !^192\.0\.2\.110
80-
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
81-
RewriteCond %{DOCUMENT_ROOT}/maintenance.enable -f
82-
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
83-
RewriteRule ^.*$ /maintenance.html [R=503,L]
84-
ErrorDocument 503 /maintenance.html
85-
Header Set Cache-Control "max-age=0, no-store"
78+
```terminal
79+
RewriteEngine On
80+
RewriteCond %{REMOTE_ADDR} !^192\.0\.2\.110
81+
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
82+
RewriteCond %{DOCUMENT_ROOT}/maintenance.enable -f
83+
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
84+
RewriteRule ^.*$ /maintenance.html [R=503,L]
85+
ErrorDocument 503 /maintenance.html
86+
Header Set Cache-Control "max-age=0, no-store"
87+
```
8688

8789
3. Restart Apache:
8890

@@ -91,7 +93,10 @@ To redirect traffic to a custom maintenance page:
9193

9294
4. Enter the following command:
9395

94-
touch <web server docroot>/maintenance.enable
96+
```bash
97+
touch <web server docroot>/maintenance.enable
98+
```
99+
95100
5. [Upgrade your system]({{ page.baseurl }}/comp-mgr/upgrader/upgrade-start.html).
96101
7. Test your site to make sure it functions correctly.
97102
6. After the upgrade is done, delete `maintenance.enable`.
@@ -105,46 +110,56 @@ To redirect traffic to a custom maintenance page:
105110
1. Use a text editor to open the [nginx](https://glossary.magento.com/nginx) configuration file that contains your server block.
106111
2. Add the following to the server block (`server` is shown for clarity only; don't add a second server block).
107112
108-
The following whitelists IP address 192.0.2.110 and 192.0.2.115 on a system where Magento is installed in `/var/www/html/magento2`:
113+
The following whitelists IP address 192.0.2.110 and 192.0.2.115 on a system where Magento is installed in `/var/www/html/magento2`:
114+
115+
```conf
116+
server {
117+
listen 80;
118+
set $MAGE_ROOT /var/www/html/magento2;
109119
110-
server {
111-
listen 80;
112-
set $MAGE_ROOT /var/www/html/magento2;
120+
set $maintenance off;
113121
114-
set $maintenance off;
122+
if (-f $MAGE_ROOT/maintenance.enable) {
123+
set $maintenance on;
124+
}
115125
116-
if (-f $MAGE_ROOT/maintenance.enable) {
117-
set $maintenance on;
118-
}
126+
if ($remote_addr ~ (192.0.2.110|192.0.2.115)) {
127+
set $maintenance off;
128+
}
119129
120-
if ($remote_addr ~ (192.0.2.110|192.0.2.115)) {
121-
set $maintenance off;
122-
}
130+
if ($maintenance = on) {
131+
return 503;
132+
}
123133
124-
if ($maintenance = on) {
125-
return 503;
126-
}
134+
location /maintenance {
135+
}
127136
128-
location /maintenance {
129-
}
137+
error_page 503 @maintenance;
130138
131-
error_page 503 @maintenance;
139+
location @maintenance {
140+
root $MAGE_ROOT;
141+
rewrite ^(.*)$ /maintenance.html break;
132142
133-
location @maintenance {
134-
root $MAGE_ROOT;
135-
rewrite ^(.*)$ /maintenance.html break;
143+
include /var/www/html/magento2/nginx.conf;
144+
}
136145
137-
include /var/www/html/magento2/nginx.conf;
138-
}
139146
4. Enter the following command:
140147
141-
touch <magento_root>/maintenance.enable
148+
```bash
149+
touch <magento_root>/maintenance.enable
150+
```
151+
142152
3. Reload the nginx configuration:
143153
144-
service nginx reload
154+
```bash
155+
service nginx reload
156+
```
157+
145158
5. [Upgrade your system]({{ page.baseurl }}/comp-mgr/upgrader/upgrade-start.html).
146159
7. Test your site to make sure it functions correctly.
147160
6. After the upgrade is done, delete or rename `maintenance.enable`
148161
5. Reload the nginx configuration:
149162
150-
service nginx reload
163+
```bash
164+
service nginx reload
165+
```

guides/v2.2/comp-mgr/trouble/cman/out-of-memory.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ You may encounter an error, caused by your system running out of physical memory
1515

1616
When installing or updating the Magento application or components like extensions, themes, or language packages, an error similar to the following displays:
1717

18-
Could not complete update {"components":[
19-
{"name":"magento/module-bundle-sample-data","version":"100.1.0"}
20-
]} successfully: proc_open(): fork failed - Cannot allocate memory
18+
```terminal
19+
Could not complete update {"components":[
20+
{"name":"magento/module-bundle-sample-data","version":"100.1.0"}
21+
]} successfully: proc_open(): fork failed - Cannot allocate memory
22+
```
2123

2224
The error `proc_open(): fork failed - Cannot allocate memory` can also display on the command line.
2325

guides/v2.2/comp-mgr/trouble/cman/update-fail.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ functional_areas:
1111

1212
If your component update fails, messages similar to the following display in the Console Log:
1313

14-
[2015-08-14 12:12:02 CDT] Job "update {"components":[{"name":"example/module","version":"1.1.0"}]}" has been started
15-
[2015-08-14 12:12:02 CDT] Starting composer update...
16-
[2015-08-14 12:12:02 CDT] An error occurred while executing job "update {"components":
17-
[{"name":"example/module","version":"1.1.0"}]}": Could not complete update {"components":
18-
[{"name":"example/module","version":"1.1.0"}]} successfully: Cannot find component to update
14+
```terminal
15+
[2015-08-14 12:12:02 CDT] Job "update {"components":[{"name":"example/module","version":"1.1.0"}]}" has been started
16+
[2015-08-14 12:12:02 CDT] Starting composer update...
17+
[2015-08-14 12:12:02 CDT] An error occurred while executing job "update {"components":
18+
[{"name":"example/module","version":"1.1.0"}]}": Could not complete update {"components":
19+
[{"name":"example/module","version":"1.1.0"}]} successfully: Cannot find component to update
20+
```
1921

2022
In the preceding example, there is no component version to which to roll back. Contact the component vendor or try to resolve the issue yourself.
2123

guides/v2.2/comp-mgr/trouble/cman/were-sorry.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,30 +43,39 @@ Modify Magento's `composer.json` to reference the `https://repo.magento.com` rep
4343
2. Change to your Magento installation directory.
4444
3. Back up your existing `composer.json`:
4545

46-
cp composer.json composer.json.bak
46+
```bash
47+
cp composer.json composer.json.bak
48+
```
4749

4850
4. Open `composer.json` in a text editor.
4951
5. To the `repositories` section, add the following:
5052

51-
{
52-
"type": "composer",
53-
"url": "https://repo.magento.com/"
54-
}
53+
```json
54+
{
55+
"type": "composer",
56+
"url": "https://repo.magento.com/"
57+
}
58+
```
5559

5660
Example:
5761

58-
"repositories": [
59-
{
60-
"type": "composer",
61-
"url": "https://repo.magento.com/"
62-
}
63-
]
62+
```json
63+
"repositories": [
64+
{
65+
"type": "composer",
66+
"url": "https://repo.magento.com/"
67+
}
68+
]
69+
```
6470

6571
6. Save your changes to `composer.json` and exit the text editor.
6672
7. Change to the `update` subdirectory, where the updater is located.
6773
8. Enter the following command:
6874

69-
composer install
75+
```bash
76+
composer install
77+
```
78+
7079
9. After the command completes, try the upgrade again.
7180

7281
### You cloned the Magento GitHub repository {#git-clone}

guides/v2.2/comp-mgr/upgrader/ce-ee-upgrade-start.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@ After the upgrade completes:
6565

6666
* The following error might display:
6767

68-
[2016-01-19 23:33:24 UTC] An error occurred while executing job
69-
"setup:upgrade {"command":"setup:upgrade"}": Could not complete
70-
setup:upgrade {"command":"setup:upgrade"} successfully: Source
71-
class "\Cybersource" for "CybersourceLogger" generation does not exist.
68+
```terminal
69+
[2016-01-19 23:33:24 UTC] An error occurred while executing job
70+
"setup:upgrade {"command":"setup:upgrade"}": Could not complete
71+
setup:upgrade {"command":"setup:upgrade"} successfully: Source
72+
class "\Cybersource" for "CybersourceLogger" generation does not exist.
73+
```
7274

7375
## Continue your upgrade {#ce-ee-continue}
7476

guides/v2.2/comp-mgr/upgrader/upgrade.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,25 @@ bin/magento cache:clean
3737

3838
After the upgrade completes, manually clear `var` subdirectories:
3939

40-
rm -rf <Magento install dir>/var/cache/*
41-
rm -rf <Magento install dir>/var/page_cache/*
42-
rm -rf <Magento install dir>/generated/code/*
40+
```bash
41+
rm -rf <Magento install dir>/var/cache/*
42+
```
43+
44+
```bash
45+
rm -rf <Magento install dir>/var/page_cache/*
46+
```
47+
48+
```bash
49+
rm -rf <Magento install dir>/generated/code/*
50+
```
4351

4452
## Restart Varnish
4553

4654
After the upgrade completes, restart Varnish if you use it for page caching.
4755

48-
service varnish restart
56+
```bash
57+
service varnish restart
58+
```
4959

5060
Then access your [storefront](https://glossary.magento.com/storefront) and verify everything is working properly.
5161

@@ -55,10 +65,11 @@ After you finish your upgrade, errors might display.
5565

5666
* On the main storefront page, the following error might display.
5767

58-
We're sorry, an error has occurred while generating this email.
68+
_We're sorry, an error has occurred while generating this email._
69+
5970
* On a [category](https://glossary.magento.com/category) page, the following error might display:
6071

61-
We can't find products matching the selection.
72+
_We can't find products matching the selection._
6273

6374
If any of the preceding errors display, perform all of the following tasks.
6475

@@ -70,7 +81,9 @@ Clear the `var/cache`, `var/page_cache`, `generated/code`
7081

7182
A sample command follows:
7283

73-
rm -rf var/cache/* var/page_cache/* generated/code/*
84+
```bash
85+
rm -rf var/cache/* var/page_cache/* generated/code/*
86+
```
7487

7588
### Access your storefront again
7689

guides/v2.2/get-started/authentication/gs-authentication-token.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ The following image shows a token request for the [admin](https://glossary.magen
6868

6969
The following example uses the `curl` command to request a token for a customer account:
7070

71-
```
71+
```bash
7272
curl -X POST "https://magento.host/index.php/rest/V1/integration/customer/token" \
7373
-H "Content-Type:application/json" \
7474
-d "{"username":"customer1", "password":"customer1pw"}"
7575
```
7676

7777
The following example makes the same request with [XML](https://glossary.magento.com/xml) for a customer account token:
7878

79-
```
79+
```bash
8080
curl -X POST "http://magento.vg/index.php/rest/V1/integration/customer/token" \
8181
-H "Content-Type:application/xml" \
8282
-d "<login><username>customer1</username><password>customer1pw</password></login>"

guides/v2.2/marketplace/eqp/auth.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ You must use an application ID and secret to obtain a session token. See the fol
2222

2323
The following endpoint grants an application session token:
2424

25-
```
25+
```http
2626
POST /rest/v1/apps/session/token
2727
```
2828

@@ -41,7 +41,7 @@ The following example shows a request and expected response:
4141

4242
**Request**
4343

44-
```shell
44+
```bash
4545
curl -X POST \
4646
-u 'AQ17NZ49WC:8820c99614d65f923df7660276f20e029d73e2ca' \
4747
-H 'Content-Type: application/json' \
@@ -72,7 +72,7 @@ After obtaining a valid session token, you must use it as a bearer token in all
7272

7373
For example, to access a user profile with a session token:
7474

75-
```shell
75+
```bash
7676
curl -X GET \
7777
-H 'Authorization: Bearer baGXoStRuR9VCDFQGZNzgNqbqu5WUwlr.cAxZJ9m22Le7' \
7878
https://developer-api.magento.com/rest/v1/users/MAG123456789

0 commit comments

Comments
 (0)