on master help sign in
docs: describe uwsgi setup of all suported distributions
cbc08fdMarkus Heiser
docs/admin/installation-apache.rst+4−3
@@ -4,10 +4,11 @@
4Install with apache
4Install with apache
5===================
5===================
6
6
7−.. sidebar:: public HTTP servers
7+.. sidebar:: public to the internet?
8
8
9− On public searx instances use an application firewall (:ref:`filtron
9+ If your searx instance is public, stop here and first install :ref:`filtron
10− <filtron.sh>`).
10+ reverse proxy <filtron.sh>` and :ref:`result proxy morty <morty.sh>`, see
11+ :ref:`installation scripts`.
11
12
12.. contents:: Contents
13.. contents:: Contents
13 :depth: 2
14 :depth: 2
docs/admin/installation-nginx.rst+207−70
@@ -4,18 +4,27 @@
4Install with nginx
4Install with nginx
5==================
5==================
6
6
7−.. sidebar:: public HTTP servers
7+.. _nginx:
8−
8+ https://docs.nginx.com/nginx/admin-guide/
9− On public searx instances use an application firewall (:ref:`filtron
9+.. _nginx server configuration:
10− <filtron.sh>`).
10+ https://docs.nginx.com/nginx/admin-guide/web-server/web-server/#setting-up-virtual-servers
11+.. _nginx beginners guide:
12+ http://nginx.org/en/docs/beginners_guide.html
13+.. _Getting Started wiki:
14+ https://www.nginx.com/resources/wiki/start/
11
15
12.. contents:: Contents
16.. contents:: Contents
13 :depth: 2
17 :depth: 2
14 :local:
18 :local:
15 :backlinks: entry
19 :backlinks: entry
16
20
21+
22+The nginx HTTP server
23+=====================
24+
17−If nginx is not installed (uwsgi will not work with the package
25+If nginx_ is not installed (uwsgi will not work with the package nginx-light)
18−nginx-light):
26+install it now.
27+
19
28
20.. tabs::
29.. tabs::
21
30
@@ -25,87 +34,208 @@ nginx-light):
25
34
26 sudo -H apt-get install nginx
35 sudo -H apt-get install nginx
27
36
28−Hosted at ``/``
37+ .. group-tab:: Arch Linux
29−===============
30
38
31−Create the configuration file ``/etc/nginx/sites-available/searx`` with this
39+ .. code-block:: sh
32−content:
33
40
34−.. code:: nginx
41+ sudo -H pacman -S nginx-mainline
42+ sudo -H systemctl enable nginx
43+ sudo -H systemctl start nginx
35
44
36− server {
45+ .. group-tab:: Fedora / RHEL
37− listen 80;
38− server_name searx.example.com;
39− root /usr/local/searx/searx;
40
46
41− location /static {
47+ .. code-block:: sh
42− }
43
48
44− location / {
49+ sudo -H dnf install nginx
45− include uwsgi_params;
50+ sudo -H systemctl enable nginx
46− uwsgi_pass unix:/run/uwsgi/app/searx/socket;
51+ sudo -H systemctl start nginx
47− }
48− }
49
52
50−Create a symlink to sites-enabled:
53+Now at http://localhost you should see a *Welcome to nginx!* page, on Fedora you
54+see a *Fedora Webserver - Test Page*. The test page comes from the default
55+`nginx server configuration`_:
51
56
52−.. code:: sh
57+.. tabs::
53
58
54− sudo -H ln -s /etc/nginx/sites-available/searx /etc/nginx/sites-enabled/searx
59+ .. group-tab:: Ubuntu / debian
55
60
56−Restart service:
61+ .. code:: sh
62+
63+ less /etc/nginx/nginx.conf
64+
65+ there is a line including site configurations from:
66+
67+ .. code:: nginx
68+
69+ include /etc/nginx/sites-enabled/*;
70+
71+ .. group-tab:: Arch Linux
72+
73+ .. code-block:: sh
74+
75+ less /etc/nginx/nginx.conf
76+
77+ in there is a configuration section named ``server``:
78+
79+ .. code-block:: nginx
80+
81+ server {
82+ listen 80;
83+ server_name localhost;
84+ # ...
85+ }
86+
87+ .. group-tab:: Fedora / RHEL
88+
89+ .. code-block:: sh
90+
91+ less /etc/nginx/nginx.conf
92+
93+ there is a line including site configurations from:
94+
95+ .. code:: nginx
96+
97+ include /etc/nginx/conf.d/*.conf;
98+
99+.. _nginx searx site:
100+
101+A searx site
102+============
103+
104+.. sidebar:: public to the internet?
105+
106+ If your searx instance is public, stop here and first install :ref:`filtron
107+ reverse proxy <filtron.sh>` and :ref:`result proxy morty <morty.sh>`, see
108+ :ref:`installation scripts`.
109+
110+Now you have to create a configuration for the searx site. If nginx_ is new to
111+you, the `nginx beginners guide`_ is a good starting point and the `Getting
112+Started wiki`_ is always a good resource *to keep in the pocket*.
57
113
58.. tabs::
114.. tabs::
59
115
60 .. group-tab:: Ubuntu / debian
116 .. group-tab:: Ubuntu / debian
61
117
118+ Create configuration at ``/etc/nginx/sites-available/searx`` and place a
119+ symlink to sites-enabled:
120+
62 .. code:: sh
121 .. code:: sh
63
122
64− sudo -H systemctl restart nginx
123+ sudo -H ln -s /etc/nginx/sites-available/searx /etc/nginx/sites-enabled/searx
65− sudo -H systemctl restart uwsgi
66
124
67−from subdirectory URL (``/searx``)
125+ .. group-tab:: Arch Linux
68−==================================
69
126
70−Add this configuration in the server config file
127+ In the ``/etc/nginx/nginx.conf`` file, replace the configuration section
71−``/etc/nginx/sites-enabled/default``:
128+ named ``server``.
72
129
73−.. code:: nginx
130+ .. group-tab:: Fedora / RHEL
74
131
75− location /searx/static {
132+ Create configuration at ``/etc/nginx/conf.d/searx`` and place a
76− alias /usr/local/searx/searx/static;
133+ symlink to sites-enabled:
77− }
78
134
79− location /searx {
135+.. tabs::
80− uwsgi_param SCRIPT_NAME /searx;
81− include uwsgi_params;
82− uwsgi_pass unix:/run/uwsgi/app/searx/socket;
83− }
84
136
85
137
86−**OR** using reverse proxy (Please, note that reverse proxy advised to be used
138+ .. group-tab:: filtron at ``/`` & ``/morty``
87−in case of single-user or low-traffic instances.)
88
139
89−.. code:: nginx
140+ Use this setup, if your instance is public to the internet:
90
141
91− location /searx/static {
142+ .. code:: nginx
92− alias /usr/local/searx/searx/static;
93− }
94
143
95− location /searx {
144+ location / {
145+ proxy_set_header Host $http_host;
146+ proxy_set_header X-Real-IP $remote_addr;
147+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
148+ proxy_set_header X-Scheme $scheme;
96− proxy_pass http://127.0.0.1:8888;
149+ proxy_pass http://127.0.0.1:4004/;
97− proxy_set_header Host $host;
98− proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
99− proxy_set_header X-Scheme $scheme;
100− proxy_set_header X-Script-Name /searx;
101− proxy_buffering off;
102− }
150+ }
103
151
104−Enable ``base_url`` in ``searx/settings.yml``
152+ .. code:: nginx
105
153
154+ location /morty {
155+ proxy_set_header Host $http_host;
156+ proxy_set_header X-Real-IP $remote_addr;
157+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
158+ proxy_set_header X-Scheme $scheme;
159+ proxy_pass http://127.0.0.1:3000/;
160+ }
161+
162+ For a fully result proxification add :ref:`morty's <searx_morty>` public
163+ URL to your :origin:`searx/settings.yml`:
164+
106−.. code:: yaml
165+ .. code:: yaml
166+
167+ result_proxy:
168+ # replace searx.example.com with your server's public name
169+ url : http://searx.example.com/
170+
171+
172+ .. group-tab:: searx at ``/``
173+
174+ Use this setup only, if your instance is **NOT** public to the internet:
175+
176+ .. code:: nginx
177+
178+ server {
179+ listen 80;
180+ listen [::]:80;
181+
182+ # replace searx.example.com with your server's public name
183+ server_name searx.example.com;
184+
185+ root /usr/local/searx/searx;
186+
187+ location /static {
188+ }
189+
190+ location / {
191+ include uwsgi_params;
192+ uwsgi_pass unix:/run/uwsgi/app/searx/socket;
193+ }
194+ }
195+
196+ .. group-tab:: searx at ``/searx``
197+
198+ Use this setup only, if your instance is **NOT** public to the internet:
199+
200+ .. code:: nginx
201+
202+ location /searx/static {
203+ alias /usr/local/searx/searx/static;
204+ }
205+
206+ location /searx {
207+ uwsgi_param SCRIPT_NAME /searx;
208+ include uwsgi_params;
209+ uwsgi_pass unix:/run/uwsgi/app/searx/socket;
210+ }
211+
212+
213+ **OR** using reverse proxy. Please, note that reverse proxy advised to be
214+ used in case of single-user or low-traffic instances.
215+
216+ .. code:: nginx
217+
218+ location /searx/static {
219+ alias /usr/local/searx/searx/static;
220+ }
221+
222+ location /searx {
223+ proxy_pass http://127.0.0.1:8888;
224+ proxy_set_header Host $host;
225+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
226+ proxy_set_header X-Scheme $scheme;
227+ proxy_set_header X-Script-Name /searx;
228+ proxy_buffering off;
229+ }
230+
231+ Enable ``base_url`` in :origin:`searx/settings.yml`
232+
233+ .. code:: yaml
234+
235+ server:
236+ # replace searx.example.com with your server's public name
237+ base_url : http://searx.example.com/searx/
107
238
108− base_url : http://your.domain.tld/searx/
109
239
110Restart service:
240Restart service:
111
241
@@ -118,24 +248,31 @@ Restart service:
118 sudo -H systemctl restart nginx
248 sudo -H systemctl restart nginx
119 sudo -H systemctl restart uwsgi
249 sudo -H systemctl restart uwsgi
120
250
251+ .. group-tab:: Arch Linux
121
252
122−disable logs
253+ .. code:: sh
123−============
124
254
125−For better privacy you can disable nginx logs about searx. How to proceed:
255+ sudo -H systemctl restart nginx
126−below ``uwsgi_pass`` in ``/etc/nginx/sites-available/default`` add:
256+ sudo -H systemctl restart uwsgi
127
257
128−.. code:: nginx
258+ .. group-tab:: Fedora
129
259
130− access_log /dev/null;
260+ .. code:: sh
131− error_log /dev/null;
132
261
133−Restart service:
262+ sudo -H systemctl restart nginx
263+ sudo -H systemctl restart uwsgi
134
264
135−.. tabs::
136
265
137− .. group-tab:: Ubuntu / debian
266+Disable logs
267+============
138
268
139− .. code:: sh
269+For better privacy you can disable nginx logs in ``/etc/nginx/nginx.conf``.
140
270
141− sudo -H systemctl restart nginx
271+.. code:: nginx
272+
273+ http {
274+ # ...
275+ access_log /dev/null;
276+ error_log /dev/null;
277+ # ...
278+ }
docs/admin/installation.rst+2−1
@@ -7,7 +7,7 @@ Installation
7*You're spoilt for choice*, choose your preferred method of installation.
7*You're spoilt for choice*, choose your preferred method of installation.
8
8
9- :ref:`installation docker`
9- :ref:`installation docker`
10−- `Installation scripts`_
10+- :ref:`installation scripts`
11- :ref:`installation basic`
11- :ref:`installation basic`
12
12
13The :ref:`installation basic` is good enough for intranet usage and it is a
13The :ref:`installation basic` is good enough for intranet usage and it is a
@@ -20,6 +20,7 @@ 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
20:ref:`installation docker` or the `Installation scripts`_ from our :ref:`tooling
21box <toolboxing>` as described below.
21box <toolboxing>` as described below.
22
22
23+.. _installation scripts:
23
24
24Installation scripts
25Installation scripts
25====================
26====================
searx/settings.yml+1−1
@@ -1,5 +1,5 @@
1general:
1general:
2− debug : False # Debug mode, only for development
2+ debug : True # Debug mode, only for development
3 instance_name : "searx" # displayed name
3 instance_name : "searx" # displayed name
4
4
5search:
5search:
utils/lxc.sh+2−1
@@ -192,8 +192,9 @@ main() {
192 if [[ $exit_val -ne 0 ]]; then
192 if [[ $exit_val -ne 0 ]]; then
193 warn_msg "[${_BBlue}${i}${_creset}] exit code (${_BRed}${exit_val}${_creset}) from ${_BGreen}${*}${_creset}"
193 warn_msg "[${_BBlue}${i}${_creset}] exit code (${_BRed}${exit_val}${_creset}) from ${_BGreen}${*}${_creset}"
194 else
194 else
195− info_msg "[${_BBlue}${i}${_creset}] exit code (${_BRed}${exit_val}${_creset}) from ${_BGreen}${*}${_creset}"
195+ info_msg "[${_BBlue}${i}${_creset}] exit code (${exit_val}) from ${_BGreen}${*}${_creset}"
196 fi
196 fi
197+ echo
197 done
198 done
198 ;;
199 ;;
199 install)
200 install)
utils/searx.sh+1−1
@@ -668,7 +668,7 @@ enable: sudo -H ln -s ${uWSGI_APPS_AVAILABLE}/${SEARX_UWSGI_APP} ${uWSGI_APPS
668start: sudo -H service uwsgi start ${SEARX_UWSGI_APP%.*}
668start: sudo -H service uwsgi start ${SEARX_UWSGI_APP%.*}
669restart: sudo -H service uwsgi restart ${SEARX_UWSGI_APP%.*}
669restart: sudo -H service uwsgi restart ${SEARX_UWSGI_APP%.*}
670stop: sudo -H service uwsgi stop ${SEARX_UWSGI_APP%.*}
670stop: sudo -H service uwsgi stop ${SEARX_UWSGI_APP%.*}
671−disable: sudo -H rm ${uWSGI_APPS_ENABLED}/${CONF}
671+disable: sudo -H rm ${uWSGI_APPS_ENABLED}/${SEARX_UWSGI_APP}
672EOF
672EOF
673 ;;
673 ;;
674 arch-*) cat <<EOF
674 arch-*) cat <<EOF