on master help sign in
doc: installation.rst improve reST markup

- normalize section header markup - limit all lines to a maximum of 79 characters - add option -H to the sudo command used in code blocks - place *WARNING* lines into a '.. warning::' admonition block - make use of ``literal`` markup for monospace rendering - drop useless indentation of lists [1] https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>

commit5b14772b203fa32a9a2c7a6951a3c17ff32b6d88 authorMarkus Heiser <markus.heiser@darmarit.de> dateWed 4 Dec 2019, 17:54 (7 years ago) parent0a7479f
1 file changed+84−72
docs/dev/install/installation.rst+84−72
docs/dev/install/installation.rst+84−72
@@ -1,5 +1,6 @@
11.. _installation:
22
3+============
34Installation
45============
56
@@ -7,37 +8,44 @@ Installation
78 :depth: 3
89
910Basic installation
10−------------------
11+==================
1112
12−Step by step installation for Debian/Ubuntu with virtualenv. For Ubuntu, be sure to have enable universe repository.
13+Step by step installation for Debian/Ubuntu with virtualenv. For Ubuntu, be sure
14+to have enable universe repository.
1315
1416Install packages:
1517
1618.. code:: sh
1719
18− sudo apt-get install git build-essential libxslt-dev python-dev python-virtualenv python-babel zlib1g-dev libffi-dev libssl-dev
20+ $ sudo -H apt-get install \
21+ git build-essential libxslt-dev \
22+ python-dev python-virtualenv python-babel \
23+ zlib1g-dev libffi-dev libssl-dev
1924
2025Install searx:
2126
2227.. code:: sh
2328
2429 cd /usr/local
25− sudo git clone https://github.com/asciimoo/searx.git
26− sudo useradd searx -d /usr/local/searx
27− sudo chown searx:searx -R /usr/local/searx
30+ sudo -H git clone https://github.com/asciimoo/searx.git
31+ sudo -H useradd searx -d /usr/local/searx
32+ sudo -H chown searx:searx -R /usr/local/searx
2833
2934Install dependencies in a virtualenv:
3035
3136.. code:: sh
3237
33− sudo -u searx -i
3438 cd /usr/local/searx
35− virtualenv searx-ve
36− . ./searx-ve/bin/activate
37− ./manage.sh update_packages
39+ sudo -H -u searx -i
40+
41+.. code:: sh
42+
43+ (searx)$ virtualenv searx-ve
44+ (searx)$ . ./searx-ve/bin/activate
45+ (searx)$ ./manage.sh update_packages
3846
3947Configuration
40−-------------
48+==============
4149
4250.. code:: sh
4351
@@ -46,7 +54,7 @@ Configuration
4654Edit searx/settings.yml if necessary.
4755
4856Check
49−-----
57+=====
5058
5159Start searx:
5260
@@ -68,18 +76,19 @@ You can exit the virtualenv and the searx user bash (enter exit command
6876twice).
6977
7078uwsgi
71−-----
79+=====
7280
7381Install packages:
7482
7583.. code:: sh
7684
77− sudo apt-get install uwsgi uwsgi-plugin-python
85+ sudo -H apt-get install \
86+ uwsgi uwsgi-plugin-python
7887
79−Create the configuration file /etc/uwsgi/apps-available/searx.ini with
80−this content:
88+Create the configuration file ``/etc/uwsgi/apps-available/searx.ini`` with this
89+content:
8190
82−::
91+.. code:: ini
8392
8493 [uwsgi]
8594 # Who will run the code
@@ -119,22 +128,22 @@ Activate the uwsgi application and restart:
119128 /etc/init.d/uwsgi restart
120129
121130Web server
122−----------
131+==========
123132
124133with nginx
125−^^^^^^^^^^
134+----------
126135
127136If nginx is not installed (uwsgi will not work with the package
128137nginx-light):
129138
130139.. code:: sh
131140
132− sudo apt-get install nginx
141+ sudo -H apt-get install nginx
133142
134143Hosted at /
135−"""""""""""
144+~~~~~~~~~~~
136145
137−Create the configuration file /etc/nginx/sites-available/searx with this
146+Create the configuration file ``/etc/nginx/sites-available/searx`` with this
138147content:
139148
140149.. code:: nginx
@@ -154,20 +163,20 @@ Create a symlink to sites-enabled:
154163
155164.. code:: sh
156165
157− sudo ln -s /etc/nginx/sites-available/searx /etc/nginx/sites-enabled/searx
166+ sudo -H ln -s /etc/nginx/sites-available/searx /etc/nginx/sites-enabled/searx
158167
159168Restart service:
160169
161170.. code:: sh
162171
163− sudo service nginx restart
164− sudo service uwsgi restart
172+ sudo -H service nginx restart
173+ sudo -H service uwsgi restart
165174
166175from subdirectory URL (/searx)
167−""""""""""""""""""""""""""""""
176+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
168177
169178Add this configuration in the server config file
170−/etc/nginx/sites-enabled/default:
179+``/etc/nginx/sites-enabled/default``:
171180
172181.. code:: nginx
173182
@@ -183,10 +192,8 @@ Add this configuration in the server config file
183192 }
184193
185194
186−OR
187−
188−using reverse proxy
189−(Please, note that reverse proxy advised to be used in case of single-user or low-traffic instances.)
195+**OR** using reverse proxy (Please, note that reverse proxy advised to be used
196+in case of single-user or low-traffic instances.)
190197
191198.. code:: nginx
192199
@@ -200,9 +207,9 @@ using reverse proxy
200207 }
201208
202209
203−Enable base\_url in searx/settings.yml
210+Enable ``base_url`` in ``searx/settings.yml``
204211
205−::
212+.. code:: yaml
206213
207214 base_url : http://your.domain.tld/searx/
208215
@@ -210,18 +217,18 @@ Restart service:
210217
211218.. code:: sh
212219
213− sudo service nginx restart
214− sudo service uwsgi restart
220+ sudo -H service nginx restart
221+ sudo -H service uwsgi restart
215222
216223disable logs
217−~~~~~~~~~~~~
224+^^^^^^^^^^^^
218225
219226for better privacy you can disable nginx logs about searx.
220227
221−how to proceed: below ``uwsgi_pass`` in
222−/etc/nginx/sites-available/default add
228+how to proceed: below ``uwsgi_pass`` in ``/etc/nginx/sites-available/default``
229+add:
223230
224−::
231+.. code:: nginx
225232
226233 access_log /dev/null;
227234 error_log /dev/null;
@@ -230,19 +237,19 @@ Restart service:
230237
231238.. code:: sh
232239
233− sudo service nginx restart
240+ sudo -H service nginx restart
234241
235242with apache
236−^^^^^^^^^^^
243+-----------
237244
238245Add wsgi mod:
239246
240247.. code:: sh
241248
242− sudo apt-get install libapache2-mod-uwsgi
243− sudo a2enmod uwsgi
249+ sudo -H apt-get install libapache2-mod-uwsgi
250+ sudo -H a2enmod uwsgi
244251
245−Add this configuration in the file /etc/apache2/apache2.conf:
252+Add this configuration in the file ``/etc/apache2/apache2.conf``:
246253
247254.. code:: apache
248255
@@ -252,27 +259,26 @@ Add this configuration in the file /etc/apache2/apache2.conf:
252259 uWSGISocket /run/uwsgi/app/searx/socket
253260 </Location>
254261
255−Note that if your instance of searx is not at the root, you should
256−change ``<Location />`` by the location of your instance, like
257−``<Location /searx>``.
262+Note that if your instance of searx is not at the root, you should change
263+``<Location />`` by the location of your instance, like ``<Location /searx>``.
258264
259265Restart Apache:
260266
261267.. code:: sh
262268
263− sudo /etc/init.d/apache2 restart
269+ sudo -H /etc/init.d/apache2 restart
264270
265271disable logs
266−""""""""""""
272+~~~~~~~~~~~~
267273
268274For better privacy you can disable Apache logs.
269275
270−WARNING: not tested
276+.. warning::
271277
272−WARNING: you can only disable logs for the whole (virtual) server not
273−for a specific path.
278+ You can only disable logs for the whole (virtual) server not for a specific
279+ path.
274280
275−Go back to /etc/apache2/apache2.conf and above ``<Location />`` add:
281+Go back to ``/etc/apache2/apache2.conf`` and above ``<Location />`` add:
276282
277283.. code:: apache
278284
@@ -282,24 +288,30 @@ Restart Apache:
282288
283289.. code:: sh
284290
285− sudo /etc/init.d/apache2 restart
291+ sudo -H /etc/init.d/apache2 restart
286292
287293How to update
288−-------------
294+=============
289295
290296.. code:: sh
291297
292298 cd /usr/local/searx
293− sudo -u searx -i
294− . ./searx-ve/bin/activate
295− git stash
296− git pull origin master
297− git stash apply
298− ./manage.sh update_packages
299− sudo service uwsgi restart
299+ sudo -H -u searx -i
300+
301+.. code:: sh
302+
303+ (searx)$ . ./searx-ve/bin/activate
304+ (searx)$ git stash
305+ (searx)$ git pull origin master
306+ (searx)$ git stash apply
307+ (searx)$ ./manage.sh update_packages
308+
309+.. code:: sh
310+
311+ sudo -H service uwsgi restart
300312
301313Docker
302−------
314+======
303315
304316Make sure you have installed Docker. For instance, you can deploy searx like this:
305317
@@ -308,22 +320,22 @@ Make sure you have installed Docker. For instance, you can deploy searx like thi
308320 docker pull wonderfall/searx
309321 docker run -d --name searx -p $PORT:8888 wonderfall/searx
310322
311−Go to http://localhost:$PORT.
312−
313−See https://hub.docker.com/r/wonderfall/searx/ for more informations.
323+Go to ``http://localhost:$PORT``.
314324
315−It's also possible to build searx from the embedded Dockerfile.
325+See https://hub.docker.com/r/wonderfall/searx/ for more informations. It's also
326+possible to build searx from the embedded Dockerfile.
316327
317328.. code:: sh
318329
319− git clone https://github.com/asciimoo/searx.git
320− cd searx
321− docker build -t whatever/searx .
330+ git clone https://github.com/asciimoo/searx.git
331+ cd searx
332+ docker build -t whatever/searx .
322333
323334References
324335==========
325336
326− * https://about.okhin.fr/posts/Searx/ with some additions
337+* https://about.okhin.fr/posts/Searx/ with some additions
327338
328− * How to: `Setup searx in a couple of hours with a free SSL certificate <https://www.reddit.com/r/privacytoolsIO/comments/366kvn/how_to_setup_your_own_privacy_respecting_search/>`__
339+* How to: `Setup searx in a couple of hours with a free SSL certificate
340+ <https://www.reddit.com/r/privacytoolsIO/comments/366kvn/how_to_setup_your_own_privacy_respecting_search/>`__
329341