Skip to content

Commit 713d997

Browse files
authored
Merge pull request #188 from nginx/issue-171
docs: add notes about root requirements for commands
2 parents 00a0bfc + 1041550 commit 713d997

21 files changed

+67
-22
lines changed

source/certificates.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ order them leaf to root.
3939

4040
Upload the resulting bundle file to Unit's certificate storage
4141
under a suitable name
42-
(in this case, **bundle**):
42+
(in this case, **bundle**), running the following command as root:
4343

4444
.. code-block:: console
4545
@@ -127,7 +127,7 @@ as **GET**-table JSON using **/certificates**:
127127

128128
Access array items,
129129
such as individual certificates in a chain,
130-
and their properties by indexing:
130+
and their properties by indexing, running the following commands as root:
131131

132132
.. code-block:: console
133133
@@ -196,7 +196,7 @@ the application is now accessible via SSL/TLS:
196196
197197
Finally, you can delete a certificate bundle
198198
that you don't need anymore
199-
from the storage:
199+
from the storage, running the following command as root:
200200

201201
.. code-block:: console
202202

source/configuration/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
.. include:: ../include/replace.rst
66

7+
.. note::
8+
The commands in this document starting with a hash (#) must be run as root or
9+
with superuser privileges.
10+
711
#############
812
Configuration
913
#############

source/controlapi.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ may benefit from this
130130
Repeat these commands on the second machine
131131
to see where the target instance stores its state.
132132

133-
Stop both Unit instances, for example:
133+
Stop both Unit instances, for example, running the following command as root:
134134

135135
.. code-block:: console
136136
@@ -147,7 +147,7 @@ may benefit from this
147147
Copy the reference state directory to the target state directory
148148
by arbitrary means;
149149
make sure to include subdirectories and hidden files.
150-
Finally, restart both Unit instances:
150+
Finally, restart both Unit instances running the following command as root:
151151

152152
.. code-block:: console
153153
@@ -205,6 +205,10 @@ OpenAPI specification
205205
Quick start
206206
***********
207207

208+
209+
.. note::
210+
Run the `curl` commands in this section as root.
211+
208212
For a brief intro,
209213
we configure Unit to serve a static file.
210214
Suppose you saved this as **/www/data/index.html**:
@@ -264,7 +268,7 @@ To configure Unit,
264268
**PUT** this snippet to the **/config** section via the
265269
:ref:`control socket <source-startup>`.
266270
Working with JSON in the command line can be cumbersome;
267-
instead, save and upload it as **snippet.json**:
271+
instead, save and upload it as **snippet.json**.
268272

269273
.. code-block:: console
270274
@@ -362,7 +366,7 @@ connections are properly closed,
362366
processes end smoothly.
363367

364368
Any type of update can be done with different URIs,
365-
provided you supply the right JSON:
369+
provided you supply the right JSON. Run the following commands as root:
366370

367371
.. code-block:: console
368372
@@ -400,7 +404,7 @@ For instance, save your application object as **wiki.json**:
400404
"path": "/www/wiki/"
401405
}
402406
403-
Use it to set up an application called **wiki-prod**:
407+
Use it to set up an application called **wiki-prod**.
404408

405409
.. code-block:: console
406410

source/howto/apollo.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ using Unit:
1010

1111
#. Install :ref:`Unit <installation-precomp-pkgs>` with the
1212
**unit-dev/unit-devel** package. Next, :ref:`install
13-
<installation-nodejs-package>` Unit's **unit-http** package:
13+
<installation-nodejs-package>` Unit's **unit-http** package. Run the following
14+
command as root:
1415

1516
.. code-block:: console
1617
1718
# npm install -g --unsafe-perm unit-http
1819
1920
#. Create your app directory, `install
2021
<https://expressjs.com/en/starter/installing.html>`_ |app|, and link
21-
**unit-http**:
22+
**unit-http**. Run the commands starting with a hash (#) as root:
2223

2324
.. code-block:: console
2425

source/howto/certbot.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ advisable to obtain certificates for your website from a certificate authority
99
<https://certbot.eff.org>`__ that issues free certificates signed by `Let's
1010
Encrypt <https://letsencrypt.org>`_, a non-profit CA.
1111

12+
.. note::
13+
The commands in this document starting with a hash (#) must be run as root or
14+
with superuser privileges.
15+
1216
***********************
1317
Generating Certificates
1418
***********************

source/howto/express.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ using Unit:
1010

1111
#. Install :ref:`Unit <installation-precomp-pkgs>` with the
1212
**unit-dev/unit-devel** package. Next, :ref:`install
13-
<installation-nodejs-package>` Unit's **unit-http** package:
13+
<installation-nodejs-package>` Unit's **unit-http** package. Run the following
14+
command as root:
1415

1516
.. code-block:: console
1617
@@ -32,6 +33,8 @@ using Unit:
3233
3334
$ npm install express --save
3435
36+
Run the following command as root:
37+
3538
.. code-block:: console
3639
3740
# npm link unit-http

source/howto/grafana.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ so we can :ref:`configure it <configuration-go>` to run on Unit.
134134
usually **$GOPATH/bin/**; it's used for the **executable** option in
135135
the Unit configuration.
136136

137-
#. Run the following commands so Unit can access |app|'s files:
137+
#. Run the following commands (as root) so Unit can access |app|'s files:
138138

139139
.. code-block:: console
140140

source/howto/koa.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ To run apps built with the `Koa <https://koajs.com>`_ web framework using Unit:
99

1010
#. Install :ref:`Unit <installation-precomp-pkgs>` with the
1111
**unit-dev/unit-devel** package. Next, :ref:`install
12-
<installation-nodejs-package>` Unit's **unit-http** package:
12+
<installation-nodejs-package>` Unit's **unit-http** package. Run the following
13+
command as root:
1314

1415
.. code-block:: console
1516
@@ -30,6 +31,8 @@ To run apps built with the `Koa <https://koajs.com>`_ web framework using Unit:
3031
3132
$ npm install koa
3233
34+
Run the following command as root:
35+
3336
.. code-block:: console
3437
3538
# npm link unit-http

source/howto/mailman.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ To install and run the web UI for the `Mailman 3
2525

2626
These are needed to configure Unit.
2727

28-
#. Run the following command so Unit can access |app|'s static files:
28+
#. Run the following command (as root) so Unit can access |app|'s static files:
2929

3030
.. code-block:: console
3131
@@ -39,7 +39,7 @@ To install and run the web UI for the `Mailman 3
3939
run the :program:`ps aux | grep unitd` command to be sure.
4040

4141
Alternatively, add Unit's unprivileged user account to |app|'s group so Unit
42-
can access the static files:
42+
can access the static files. Run the following command as root:
4343

4444
.. code-block:: console
4545

source/howto/mediawiki.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ documentation platform using Unit:
138138
139139
$ chmod 600 LocalSettings.php
140140
141+
Run the following commands (as root) to set the correct ownership:
142+
141143
.. code-block:: console
142144
143145
# chown :nxt_ph:`unit:unit <Values from Step 3>` LocalSettings.php
@@ -147,7 +149,7 @@ documentation platform using Unit:
147149
# mv LocalSettings.php :nxt_ph:`/path/to/app/ <Path to the application directory; use a real path in your configuration>`
148150
149151
#. After installation, add a match condition to the first step to disable
150-
access to the **mw-config/** directory:
152+
access to the **mw-config/** directory. Run the following command (as root):
151153

152154
.. code-block:: console
153155

0 commit comments

Comments
 (0)