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

+3-3
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

+4
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

+9-5
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

+3-2
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

+4
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

+4-1
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

+1-1
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

+4-1
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

+2-2
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

+3-1
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

source/howto/modules.rst

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ Languages supported by Unit fall into these two categories:
1414

1515
For any specific language and its version, Unit needs a language module.
1616

17+
.. note::
18+
The commands in this document starting with a hash (#) must be run as root or
19+
with superuser privileges.
20+
1721
.. _modules-ext:
1822

1923
*************************

source/howto/nextcloud.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ platform using Unit:
180180
#. .. include:: ../include/howto_upload_config.rst
181181

182182
#. Adjust Unit's **max_body_size** :ref:`option <configuration-stngs>` to
183-
avoid potential issues with large file uploads, for example:
183+
avoid potential issues with large file uploads, for example, runnig the
184+
following command as root:
184185

185186
.. code-block:: console
186187

source/howto/roundcube.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ To run the `Roundcube <https://roundcube.net>`_ webmail platform using Unit:
7171
#. After installation, switch **share** and **root** to the
7272
**public_html/** subdirectory to `protect
7373
<https://github.com/roundcube/roundcubemail/wiki/Installation#protect-your-installation>`__
74-
sensitive data:
74+
sensitive data, run the following command as root:
7575
7676
.. code-block:: console
7777

source/howto/samples.rst

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ App Samples
77
These steps assume Unit was already :ref:`installed
88
<installation-precomp-pkgs>` with the language module for each app.
99

10+
The commands in this document starting with a hash (#) must be run as root or
11+
with superuser privileges.
12+
1013
.. _sample-go:
1114

1215
**

source/howto/security.rst

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ configuration, and maintenance.
99
This guide lists the steps to protect your Unit from installation to individual
1010
app configuration.
1111

12+
.. note::
13+
The commands in this document starting with a hash (#) must be run as root or
14+
with superuser privileges.
1215

1316
.. _security-update:
1417

source/howto/source.rst

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ Building From Source
77
After you've obtained Unit's :ref:`source code <source>`, configure
88
and compile it to fine-tune and run a custom Unit build.
99

10+
.. note::
11+
The commands in this document starting with a hash (#) must be run as root or
12+
with superuser privileges.
13+
1014
.. _source-prereq-build:
1115

1216
============================

source/include/howto_change_ownership.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Run the following command so Unit can access :nxt_hint:`the application
1+
Run the following command (as root) so Unit can access :nxt_hint:`the application
22
directory <If the application uses several directories, run the command for
33
each one>`:
44

source/include/howto_upload_config.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Upload the updated configuration. Assuming the JSON above was added to
2-
:file:`config.json`:
2+
:file:`config.json`. Run the following command as root:
33

44
.. code-block:: console
55

source/installation.rst

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ You can install NGINX Unit in four alternative ways:
3030
and :ref:`build <source-config-src>` a custom binary from scratch;
3131
just make sure you know what you're doing.
3232

33+
.. note::
34+
The commands in this document starting with a hash (#) must be run as root or
35+
with superuser privileges.
36+
3337

3438
.. _source-prereqs:
3539

source/scripting.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,16 @@ by their **Authorization** header field values:
151151
export default http
152152
153153
To upload it to Unit's JavaScript module storage
154-
as **http**:
154+
as **http**, run the following command as root:
155155

156156
.. code-block:: console
157157
158158
# curl -X PUT --data-binary @http.js --unix-socket :nxt_ph:`/path/to/control.unit.sock <Path to the remote control socket>` \
159159
http://localhost/js_modules/:nxt_ph:`http <Module name in Unit's configuration>`
160160
161161
Unit doesn't enable the uploaded modules by default,
162-
so add the module's name to **settings/js_module**:
162+
so add the module's name to **settings/js_module** running the following command
163+
as root:
163164

164165
.. code-block:: console
165166

source/troubleshooting.rst

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
Troubleshooting
1010
###############
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
.. _troubleshooting-log:
1317

1418
*******

0 commit comments

Comments
 (0)