@@ -4,234 +4,63 @@
44Installation
55============
66
7−.. sidebar:: Searx server setup
7+*You're spoilt for choice*, choose your preferred method of installation.
88
9− - :ref:`installation nginx`
10− - :ref:`installation apache`
9+- :ref:`installation docker`
10+- `Installation scripts`_
11+- :ref:`installation basic`
1112
12− If you do not have any special preferences, it is recommend to use
13− :ref:`searx.sh`.
13+The :ref:`installation basic` is good enough for intranet usage and it is a
14+excellent illustration of *how a searx instance is build up*. If you place your
15+instance public to the internet you should really consider to install a
16+:ref:`filtron reverse proxy <filtron.sh>` and for privacy a :ref:`result proxy
17+<morty.sh>` is mandatory.
1418
15−.. contents:: Contents
16− :depth: 2
17− :local:
18− :backlinks: entry
19+Therefore, if you do not have any special preferences, its recommend to use the
20+:ref:`installation docker` or the `Installation scripts`_ from our :ref:`tooling
21+box <toolboxing>` as described below.
1922
20−.. _installation basic:
2123
22−Basic installation
23−==================
24+Installation scripts
25+====================
2426
25−Step by step installation with virtualenv. For Ubuntu, be sure to have enable
26−universe repository.
27+The following will install a setup as shown in :ref:`architecture`. First you
28+need to get a clone. The clone is only needed for the installation procedure
29+and some maintenance tasks (alternatively you can create your own fork).
2730
28−Install packages:
31+.. code:: bash
2932
30−.. tabs::
33+ $ cd ~/Download
34+ $ git clone https://github.com/asciimoo/searx searx
35+ $ cd searx
3136
32− .. group-tab:: Ubuntu / debian
37+.. hint::
3338
34− .. code-block:: sh
39+ The *tooling box* is not yet merged into `asciimoo/searx master
40+ <https://github.com/asciimoo/searx>`_. As long as PR is not merged, you need
41+ to merge the PR into your local clone (see below). The discussion takes
42+ place in :pull:`1803`. To merge the :pull:`1803` in your local branch use:
3543
36− $ sudo -H apt-get install -m \
37− git build-essential
38− libxslt-dev python3-dev python3-babel python3-venv \
39− zlib1g-dev libffi-dev libssl-dev
44+ .. code:: bash
4045
41−Install searx:
46+ $ git pull origin refs/pull/1803/head
4247
43−.. code:: sh
48+**Install** :ref:`searx service <searx.sh>`
4449
45− sudo -H useradd searx --system --disabled-password -d /usr/local/searx
46− sudo -H usermod -a -G shadow searx
47− cd /usr/local/searx
48− sudo -H git clone https://github.com/asciimoo/searx.git searx-src
49− sudo -H chown searx:searx -R /usr/local/searx
50+This installs searx as described in :ref:`installation basic`.
5051
51−Install virtualenv:
52+.. code:: bash
5253
53−.. code:: sh
54+ $ sudo -H ./utils/searx.sh install all
5455
55− sudo -H -u searx -i
56− (searx)$ python3 -m venv searx-pyenv
57− (searx)$ echo 'source ~/searx-pyenv/bin/activate' > ~/.profile
56+**Install** :ref:`filtron reverse proxy <filtron.sh>`
5857
59−Exit the searx bash and restart a new to install the searx dependencies:
58+.. code:: bash
6059
61−.. code:: sh
60+ $ sudo -H ./utils/filtron.sh install all
6261
63− sudo -H -u searx -i
64− (searx)$ cd searx-src
65− (searx)$ ./manage.sh update_packages
62+**Install** :ref:`result proxy <morty.sh>`
6663
67−Configuration
68−==============
64+.. code:: bash
6965
70−.. code:: sh
71−
72− sudo -H -u searx -i
73− (searx)$ cd searx-src
74− (searx)$ sed -i -e "s/ultrasecretkey/`openssl rand -hex 16`/g" searx/settings.yml
75−
76−Edit searx/settings.yml if necessary.
77−
78−Check
79−=====
80−
81−Start searx:
82−
83−.. code:: sh
84−
85− sudo -H -u searx -i
86− (searx)$ cd searx-src
87− (searx)$ python3 searx/webapp.py
88−
89−Go to http://localhost:8888
90−
91−If everything works fine, disable the debug option in settings.yml:
92−
93−.. code:: sh
94−
95− sed -i -e "s/debug : True/debug : False/g" searx/settings.yml
96−
97−At this point searx is not demonized ; uwsgi allows this. You can exit the
98−virtualenv and the searx user bash (enter exit command twice).
99−
100−uwsgi
101−=====
102−
103−Install packages:
104−
105−.. tabs::
106−
107− .. group-tab:: Ubuntu / debian
108−
109− .. code-block:: bash
110−
111− sudo -H apt-get install uwsgi uwsgi-plugin-python3
112−
113−Create the configuration file ``/etc/uwsgi/apps-available/searx.ini`` with this
114−content:
115−
116−.. code:: ini
117−
118− [uwsgi]
119−
120− # uWSGI core
121− # ----------
122− #
123− # https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core
124−
125− # Who will run the code
126− uid = searx
127− gid = searx
128−
129− # chdir to specified directory before apps loading
130− chdir = /usr/local/searx/searx-src/searx
131−
132− # disable logging for privacy
133− disable-logging = true
134−
135− # The right granted on the created socket
136− chmod-socket = 666
137−
138− # Plugin to use and interpretor config
139− single-interpreter = true
140−
141− # enable master process
142− master = true
143−
144− # load apps in each worker instead of the master
145− lazy-apps = true
146−
147− # load uWSGI plugins
148− plugin = python3,http
149−
150− # By default the Python plugin does not initialize the GIL. This means your
151− # app-generated threads will not run. If you need threads, remember to enable
152− # them with enable-threads. Running uWSGI in multithreading mode (with the
153− # threads options) will automatically enable threading support. This *strange*
154− # default behaviour is for performance reasons.
155− enable-threads = true
156−
157− # plugin: python
158− # --------------
159− #
160− # https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python
161−
162− # load a WSGI module
163− module = searx.webapp
164−
165− # set PYTHONHOME/virtualenv
166− virtualenv = /usr/local/searx/searx-pyenv
167−
168− # add directory (or glob) to pythonpath
169− pythonpath = /usr/local/searx/searx-src
170−
171−
172− # plugin http
173− # -----------
174− #
175− # https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http
176−
177− # Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html
178− http = 127.0.0.1:8888
179−
180−Activate the uwsgi application and restart:
181−
182−.. code:: sh
183−
184− cd /etc/uwsgi/apps-enabled
185− ln -s ../apps-available/searx.ini
186− /etc/init.d/uwsgi restart
187−
188−
189−How to update
190−=============
191−
192−.. code:: sh
193−
194− sudo -H -u searx -i
195− (searx)$ git stash
196− (searx)$ git pull origin master
197− (searx)$ git stash apply
198− (searx)$ ./manage.sh update_packages
199−
200−Restart uwsgi:
201−
202−.. tabs::
203−
204− .. group-tab:: Ubuntu / debian
205−
206− .. code:: sh
207−
208− sudo -H systemctl restart uwsgi
209−
210−Docker
211−======
212−
213−Make sure you have installed Docker. For instance, you can deploy searx like this:
214−
215−.. code:: sh
216−
217− docker pull wonderfall/searx
218− docker run -d --name searx -p $PORT:8888 wonderfall/searx
219−
220−Go to ``http://localhost:$PORT``.
221−
222−See https://hub.docker.com/r/wonderfall/searx/ for more informations. It's also
223−possible to build searx from the embedded Dockerfile.
224−
225−.. code:: sh
226−
227− git clone https://github.com/asciimoo/searx.git
228− cd searx
229− docker build -t whatever/searx .
230−
231−References
232−==========
233−
234−* https://about.okhin.fr/posts/Searx/ with some additions
235−
236−* How to: `Setup searx in a couple of hours with a free SSL certificate
237− <https://www.reddit.com/r/privacytoolsIO/comments/366kvn/how_to_setup_your_own_privacy_respecting_search/>`__
66+ $ sudo -H ./utils/morty.sh install all