searx/admin/installation-uwsgi.html

506 lines
28 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>uwsgi &#8212; Searx Documentation (Searx-1.0.0.tex)</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/searx.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../_static/tabs.css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/tabs.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Install with nginx" href="installation-nginx.html" />
<link rel="prev" title="Step by step installation" href="installation-searx.html" />
<script>DOCUMENTATION_OPTIONS.URL_ROOT = '../';</script>
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="installation-nginx.html" title="Install with nginx"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="installation-searx.html" title="Step by step installation"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Searx Documentation (Searx-1.0.0.tex)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Administrator documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">uwsgi</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="uwsgi">
<span id="searx-uwsgi"></span><h1>uwsgi<a class="headerlink" href="#uwsgi" title="Permalink to this headline"></a></h1>
<aside class="sidebar">
<p class="sidebar-title">further reading</p>
<ul class="simple">
<li><p><a class="reference external" href="https://www.freedesktop.org/software/systemd/man/systemd.unit.html">systemd.unit</a></p></li>
<li><p><a class="reference external" href="https://uwsgi-docs.readthedocs.io/en/latest/Emperor.html">uWSGI Emperor</a></p></li>
</ul>
</aside>
<div class="contents local topic" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#origin-uwsgi" id="id1">Origin uWSGI</a></p></li>
<li><p><a class="reference internal" href="#distributors" id="id2">Distributors</a></p></li>
<li><p><a class="reference internal" href="#alltogether" id="id3">Alltogether</a></p></li>
</ul>
</div>
<section id="origin-uwsgi">
<h2><a class="toc-backref" href="#id1">Origin uWSGI</a><a class="headerlink" href="#origin-uwsgi" title="Permalink to this headline"></a></h2>
<p>How uWSGI is implemented by distributors is different. uWSGI itself
recommend two methods</p>
<p><a class="reference external" href="https://www.freedesktop.org/software/systemd/man/systemd.unit.html">systemd.unit</a> template files as described here <a class="reference external" href="https://uwsgi-docs.readthedocs.io/en/latest/Systemd.html#one-service-per-app-in-systemd">One service per app in systemd</a>.</p>
<blockquote>
<div><p>There is one <a class="reference external" href="http://0pointer.de/blog/projects/instances.html">systemd unit template</a> and one <a class="reference external" href="https://uwsgi-docs.readthedocs.io/en/latest/Configuration.html#ini-files">uwsgi ini file</a> per uWSGI-app
placed at dedicated locations. Take archlinux and a searx.ini as example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>unit template --&gt; /usr/lib/systemd/system/uwsgi@.service
uwsgi ini files --&gt; /etc/uwsgi/searx.ini
</pre></div>
</div>
<p>The searx app can be maintained as know from common systemd units:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>systemctl enable uwsgi@searx
systemctl start uwsgi@searx
systemctl restart uwsgi@searx
systemctl stop uwsgi@searx
</pre></div>
</div>
</div></blockquote>
<p>The <a class="reference external" href="https://uwsgi-docs.readthedocs.io/en/latest/Emperor.html">uWSGI Emperor</a> mode which fits for maintaining a large range of uwsgi apps.</p>
<blockquote>
<div><p>The Emperor mode is a special uWSGI instance that will monitor specific
events. The Emperor mode (service) is started by a (common, not template)
systemd unit. The Emperor service will scan specific directories for <a class="reference external" href="https://uwsgi-docs.readthedocs.io/en/latest/Configuration.html#ini-files">uwsgi
ini file</a>s (also know as <em>vassals</em>). If a <em>vassal</em> is added, removed or the
timestamp is modified, a corresponding action takes place: a new uWSGI
instance is started, reload or stopped. Take Fedora and a searx.ini as
example:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>to start a new searx instance create --&gt; /etc/uwsgi.d/searx.ini
to reload the instance edit timestamp --&gt; touch /etc/uwsgi.d/searx.ini
to stop instance remove ini --&gt; rm /etc/uwsgi.d/searx.ini
</pre></div>
</div>
</div></blockquote>
</section>
<section id="distributors">
<h2><a class="toc-backref" href="#id2">Distributors</a><a class="headerlink" href="#distributors" title="Permalink to this headline"></a></h2>
<p>The <a class="reference external" href="https://uwsgi-docs.readthedocs.io/en/latest/Emperor.html">uWSGI Emperor</a> mode and <a class="reference external" href="http://0pointer.de/blog/projects/instances.html">systemd unit template</a> is what the distributors
mostly offer their users, even if they differ in the way they implement both
modes and their defaults. Another point they might differ is the packaging of
plugins (if so, compare <a class="reference internal" href="installation-searx.html#install-packages"><span class="std std-ref">Install packages</span></a>) and what the default python
interpreter is (python2 vs. python3).</p>
<p>Fedora starts a Emperor by default, while archlinux does not start any uwsgi
service by default. Worth to know; debian (ubuntu) follow a complete different
approach. <em>debian</em>: your are familiar with the apache infrastructure? .. they
do similar for the uWSGI infrastructure (with less comfort), the folders are:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>/etc/uwsgi/apps-available/
/etc/uwsgi/apps-enabled/
</pre></div>
</div>
<p>The <a class="reference external" href="https://uwsgi-docs.readthedocs.io/en/latest/Configuration.html#ini-files">uwsgi ini file</a> is enabled by a symbolic link:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>ln -s /etc/uwsgi/apps-available/searx.ini /etc/uwsgi/apps-enabled/
</pre></div>
</div>
<p>From debians documentation (<code class="docutils literal notranslate"><span class="pre">/usr/share/doc/uwsgi/README.Debian.gz</span></code>): You
could control specific instance(s) by issuing:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>service uwsgi &lt;command&gt; &lt;confname&gt; &lt;confname&gt; ...
sudo -H service uwsgi start searx
sudo -H service uwsgi stop searx
</pre></div>
</div>
<p>My experience is, that this command is a bit buggy.</p>
</section>
<section id="alltogether">
<span id="uwsgi-configuration"></span><h2><a class="toc-backref" href="#id3">Alltogether</a><a class="headerlink" href="#alltogether" title="Permalink to this headline"></a></h2>
<p>Create the configuration ini-file according to your distribution (see below) and
restart the uwsgi application.</p>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-0-VWJ1bnR1IC8gZGViaWFu" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-0-VWJ1bnR1IC8gZGViaWFu" name="VWJ1bnR1IC8gZGViaWFu" role="tab" tabindex="0">Ubuntu / debian</button><button aria-controls="panel-0-QXJjaCBMaW51eA==" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-0-QXJjaCBMaW51eA==" name="QXJjaCBMaW51eA==" role="tab" tabindex="-1">Arch Linux</button><button aria-controls="panel-0-RmVkb3JhIC8gUkhFTA==" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-0-RmVkb3JhIC8gUkhFTA==" name="RmVkb3JhIC8gUkhFTA==" role="tab" tabindex="-1">Fedora / RHEL</button></div><div aria-labelledby="tab-0-VWJ1bnR1IC8gZGViaWFu" class="sphinx-tabs-panel group-tab" id="panel-0-VWJ1bnR1IC8gZGViaWFu" name="VWJ1bnR1IC8gZGViaWFu" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="c1"># init.d --&gt; /usr/share/doc/uwsgi/README.Debian.gz</span>
<span class="c1"># For uWSGI debian uses the LSB init process, this might be changed</span>
<span class="c1"># one day, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833067</span>
create /etc/uwsgi/apps-available/searx.ini
enable: sudo -H ln -s /etc/uwsgi/apps-available/searx.ini /etc/uwsgi/apps-enabled/
start: sudo -H service uwsgi start searx
restart: sudo -H service uwsgi restart searx
stop: sudo -H service uwsgi stop searx
disable: sudo -H rm /etc/uwsgi/apps-enabled/searx.ini
</pre></div>
</div>
</div><div aria-labelledby="tab-0-QXJjaCBMaW51eA==" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-0-QXJjaCBMaW51eA==" name="QXJjaCBMaW51eA==" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="c1"># systemd --&gt; /usr/lib/systemd/system/uwsgi@.service</span>
<span class="c1"># For uWSGI archlinux uses systemd template units, see</span>
<span class="c1"># - http://0pointer.de/blog/projects/instances.html</span>
<span class="c1"># - https://uwsgi-docs.readthedocs.io/en/latest/Systemd.html#one-service-per-app-in-systemd</span>
create: /etc/uwsgi/searx.ini
enable: sudo -H systemctl <span class="nb">enable</span> uwsgi@searx
start: sudo -H systemctl start uwsgi@searx
restart: sudo -H systemctl restart uwsgi@searx
stop: sudo -H systemctl stop uwsgi@searx
disable: sudo -H systemctl disable uwsgi@searx
</pre></div>
</div>
</div><div aria-labelledby="tab-0-RmVkb3JhIC8gUkhFTA==" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-0-RmVkb3JhIC8gUkhFTA==" name="RmVkb3JhIC8gUkhFTA==" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="c1"># systemd --&gt; /usr/lib/systemd/system/uwsgi.service</span>
<span class="c1"># The unit file starts uWSGI in emperor mode (/etc/uwsgi.ini), see</span>
<span class="c1"># - https://uwsgi-docs.readthedocs.io/en/latest/Emperor.html</span>
create: /etc/uwsgi.d/searx.ini
restart: sudo -H touch /etc/uwsgi.d/searx.ini
disable: sudo -H rm /etc/uwsgi.d/searx.ini
</pre></div>
</div>
</div></div>
<div class="sphinx-tabs docutils container">
<div aria-label="Tabbed content" class="closeable" role="tablist"><button aria-controls="panel-1-VWJ1bnR1IC8gZGViaWFu" aria-selected="true" class="sphinx-tabs-tab group-tab" id="tab-1-VWJ1bnR1IC8gZGViaWFu" name="VWJ1bnR1IC8gZGViaWFu" role="tab" tabindex="0">Ubuntu / debian</button><button aria-controls="panel-1-QXJjaCBMaW51eA==" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-1-QXJjaCBMaW51eA==" name="QXJjaCBMaW51eA==" role="tab" tabindex="-1">Arch Linux</button><button aria-controls="panel-1-RmVkb3JhIC8gUkhFTA==" aria-selected="false" class="sphinx-tabs-tab group-tab" id="tab-1-RmVkb3JhIC8gUkhFTA==" name="RmVkb3JhIC8gUkhFTA==" role="tab" tabindex="-1">Fedora / RHEL</button></div><div aria-labelledby="tab-1-VWJ1bnR1IC8gZGViaWFu" class="sphinx-tabs-panel group-tab" id="panel-1-VWJ1bnR1IC8gZGViaWFu" name="VWJ1bnR1IC8gZGViaWFu" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="o">[</span>uwsgi<span class="o">]</span>
<span class="c1"># uWSGI core</span>
<span class="c1"># ----------</span>
<span class="c1">#</span>
<span class="c1"># https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core</span>
<span class="c1"># Who will run the code</span>
<span class="nv">uid</span> <span class="o">=</span> searx
<span class="nv">gid</span> <span class="o">=</span> searx
<span class="c1"># set (python) default encoding UTF-8</span>
<span class="nv">env</span> <span class="o">=</span> <span class="nv">LANG</span><span class="o">=</span>C.UTF-8
<span class="nv">env</span> <span class="o">=</span> <span class="nv">LANGUAGE</span><span class="o">=</span>C.UTF-8
<span class="nv">env</span> <span class="o">=</span> <span class="nv">LC_ALL</span><span class="o">=</span>C.UTF-8
<span class="c1"># chdir to specified directory before apps loading</span>
<span class="nv">chdir</span> <span class="o">=</span> /usr/local/searx/searx-src/searx
<span class="c1"># searx configuration (settings.yml)</span>
<span class="nv">env</span> <span class="o">=</span> <span class="nv">SEARX_SETTINGS_PATH</span><span class="o">=</span>/etc/searx/settings.yml
<span class="c1"># disable logging for privacy</span>
disable-logging <span class="o">=</span> <span class="nb">true</span>
<span class="c1"># The right granted on the created socket</span>
chmod-socket <span class="o">=</span> <span class="m">666</span>
<span class="c1"># Plugin to use and interpretor config</span>
single-interpreter <span class="o">=</span> <span class="nb">true</span>
<span class="c1"># enable master process</span>
<span class="nv">master</span> <span class="o">=</span> <span class="nb">true</span>
<span class="c1"># load apps in each worker instead of the master</span>
lazy-apps <span class="o">=</span> <span class="nb">true</span>
<span class="c1"># load uWSGI plugins</span>
<span class="nv">plugin</span> <span class="o">=</span> python3,http
<span class="c1"># By default the Python plugin does not initialize the GIL. This means your</span>
<span class="c1"># app-generated threads will not run. If you need threads, remember to enable</span>
<span class="c1"># them with enable-threads. Running uWSGI in multithreading mode (with the</span>
<span class="c1"># threads options) will automatically enable threading support. This *strange*</span>
<span class="c1"># default behaviour is for performance reasons.</span>
enable-threads <span class="o">=</span> <span class="nb">true</span>
<span class="c1"># plugin: python</span>
<span class="c1"># --------------</span>
<span class="c1">#</span>
<span class="c1"># https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python</span>
<span class="c1"># load a WSGI module</span>
<span class="nv">module</span> <span class="o">=</span> searx.webapp
<span class="c1"># set PYTHONHOME/virtualenv</span>
<span class="nv">virtualenv</span> <span class="o">=</span> /usr/local/searx/searx-pyenv
<span class="c1"># add directory (or glob) to pythonpath</span>
<span class="nv">pythonpath</span> <span class="o">=</span> /usr/local/searx/searx-src
<span class="c1"># speak to upstream</span>
<span class="c1"># -----------------</span>
<span class="c1">#</span>
<span class="c1"># Activate the &#39;http&#39; configuration for filtron or activate the &#39;socket&#39;</span>
<span class="c1"># configuration if you setup your HTTP server to use uWSGI protocol via sockets.</span>
<span class="c1"># using IP:</span>
<span class="c1">#</span>
<span class="c1"># https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http</span>
<span class="c1"># Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html</span>
<span class="nv">http</span> <span class="o">=</span> <span class="m">127</span>.0.0.1:8888
<span class="c1"># using unix-sockets:</span>
<span class="c1">#</span>
<span class="c1"># On some distributions you need to create the app folder for the sockets::</span>
<span class="c1">#</span>
<span class="c1"># mkdir -p /run/uwsgi/app/searx</span>
<span class="c1"># chown -R searx:searx /run/uwsgi/app/searx</span>
<span class="c1">#</span>
<span class="c1"># socket = /run/uwsgi/app/searx/socket</span>
<span class="c1"># Cache</span>
<span class="nv">cache2</span> <span class="o">=</span> <span class="nv">name</span><span class="o">=</span>searxcache,items<span class="o">=</span><span class="m">2000</span>,blocks<span class="o">=</span><span class="m">2000</span>,blocksize<span class="o">=</span><span class="m">4096</span>,bitmap<span class="o">=</span><span class="m">1</span>
</pre></div>
</div>
</div><div aria-labelledby="tab-1-QXJjaCBMaW51eA==" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-1-QXJjaCBMaW51eA==" name="QXJjaCBMaW51eA==" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="o">[</span>uwsgi<span class="o">]</span>
<span class="c1"># uWSGI core</span>
<span class="c1"># ----------</span>
<span class="c1">#</span>
<span class="c1"># https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core</span>
<span class="c1"># Who will run the code</span>
<span class="nv">uid</span> <span class="o">=</span> searx
<span class="nv">gid</span> <span class="o">=</span> searx
<span class="c1"># set (python) default encoding UTF-8</span>
<span class="nv">env</span> <span class="o">=</span> <span class="nv">LANG</span><span class="o">=</span>C.UTF-8
<span class="nv">env</span> <span class="o">=</span> <span class="nv">LANGUAGE</span><span class="o">=</span>C.UTF-8
<span class="nv">env</span> <span class="o">=</span> <span class="nv">LC_ALL</span><span class="o">=</span>C.UTF-8
<span class="c1"># chdir to specified directory before apps loading</span>
<span class="nv">chdir</span> <span class="o">=</span> /usr/local/searx/searx-src/searx
<span class="c1"># searx configuration (settings.yml)</span>
<span class="nv">env</span> <span class="o">=</span> <span class="nv">SEARX_SETTINGS_PATH</span><span class="o">=</span>/etc/searx/settings.yml
<span class="c1"># disable logging for privacy</span>
<span class="nv">logger</span> <span class="o">=</span> systemd
disable-logging <span class="o">=</span> <span class="nb">true</span>
<span class="c1"># The right granted on the created socket</span>
chmod-socket <span class="o">=</span> <span class="m">666</span>
<span class="c1"># Plugin to use and interpretor config</span>
single-interpreter <span class="o">=</span> <span class="nb">true</span>
<span class="c1"># enable master process</span>
<span class="nv">master</span> <span class="o">=</span> <span class="nb">true</span>
<span class="c1"># load apps in each worker instead of the master</span>
lazy-apps <span class="o">=</span> <span class="nb">true</span>
<span class="c1"># load uWSGI plugins</span>
<span class="nv">plugin</span> <span class="o">=</span> python
<span class="c1"># By default the Python plugin does not initialize the GIL. This means your</span>
<span class="c1"># app-generated threads will not run. If you need threads, remember to enable</span>
<span class="c1"># them with enable-threads. Running uWSGI in multithreading mode (with the</span>
<span class="c1"># threads options) will automatically enable threading support. This *strange*</span>
<span class="c1"># default behaviour is for performance reasons.</span>
enable-threads <span class="o">=</span> <span class="nb">true</span>
<span class="c1"># plugin: python</span>
<span class="c1"># --------------</span>
<span class="c1">#</span>
<span class="c1"># https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python</span>
<span class="c1"># load a WSGI module</span>
<span class="nv">module</span> <span class="o">=</span> searx.webapp
<span class="c1"># set PYTHONHOME/virtualenv</span>
<span class="nv">virtualenv</span> <span class="o">=</span> /usr/local/searx/searx-pyenv
<span class="c1"># add directory (or glob) to pythonpath</span>
<span class="nv">pythonpath</span> <span class="o">=</span> /usr/local/searx/searx-src
<span class="c1"># speak to upstream</span>
<span class="c1"># -----------------</span>
<span class="c1">#</span>
<span class="c1"># Activate the &#39;http&#39; configuration for filtron or activate the &#39;socket&#39;</span>
<span class="c1"># configuration if you setup your HTTP server to use uWSGI protocol via sockets.</span>
<span class="c1"># using IP:</span>
<span class="c1">#</span>
<span class="c1"># https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http</span>
<span class="c1"># Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html</span>
<span class="nv">http</span> <span class="o">=</span> <span class="m">127</span>.0.0.1:8888
<span class="c1"># using unix-sockets:</span>
<span class="c1">#</span>
<span class="c1"># On some distributions you need to create the app folder for the sockets::</span>
<span class="c1">#</span>
<span class="c1"># mkdir -p /run/uwsgi/app/searx</span>
<span class="c1"># chown -R searx:searx /run/uwsgi/app/searx</span>
<span class="c1">#</span>
<span class="c1"># socket = /run/uwsgi/app/searx/socket</span>
<span class="c1"># Cache</span>
<span class="nv">cache2</span> <span class="o">=</span> <span class="nv">name</span><span class="o">=</span>searxcache,items<span class="o">=</span><span class="m">2000</span>,blocks<span class="o">=</span><span class="m">2000</span>,blocksize<span class="o">=</span><span class="m">4096</span>,bitmap<span class="o">=</span><span class="m">1</span>
</pre></div>
</div>
</div><div aria-labelledby="tab-1-RmVkb3JhIC8gUkhFTA==" class="sphinx-tabs-panel group-tab" hidden="true" id="panel-1-RmVkb3JhIC8gUkhFTA==" name="RmVkb3JhIC8gUkhFTA==" role="tabpanel" tabindex="0"><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="o">[</span>uwsgi<span class="o">]</span>
<span class="c1"># uWSGI core</span>
<span class="c1"># ----------</span>
<span class="c1">#</span>
<span class="c1"># https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core</span>
<span class="c1"># Who will run the code</span>
<span class="nv">uid</span> <span class="o">=</span> searx
<span class="nv">gid</span> <span class="o">=</span> searx
<span class="c1"># set (python) default encoding UTF-8</span>
<span class="nv">env</span> <span class="o">=</span> <span class="nv">LANG</span><span class="o">=</span>C.UTF-8
<span class="nv">env</span> <span class="o">=</span> <span class="nv">LANGUAGE</span><span class="o">=</span>C.UTF-8
<span class="nv">env</span> <span class="o">=</span> <span class="nv">LC_ALL</span><span class="o">=</span>C.UTF-8
<span class="c1"># chdir to specified directory before apps loading</span>
<span class="nv">chdir</span> <span class="o">=</span> /usr/local/searx/searx-src/searx
<span class="c1"># searx configuration (settings.yml)</span>
<span class="nv">env</span> <span class="o">=</span> <span class="nv">SEARX_SETTINGS_PATH</span><span class="o">=</span>/etc/searx/settings.yml
<span class="c1"># disable logging for privacy</span>
disable-logging <span class="o">=</span> <span class="nb">true</span>
<span class="c1"># The right granted on the created socket</span>
chmod-socket <span class="o">=</span> <span class="m">666</span>
<span class="c1"># Plugin to use and interpretor config</span>
single-interpreter <span class="o">=</span> <span class="nb">true</span>
<span class="c1"># enable master process</span>
<span class="nv">master</span> <span class="o">=</span> <span class="nb">true</span>
<span class="c1"># load apps in each worker instead of the master</span>
lazy-apps <span class="o">=</span> <span class="nb">true</span>
<span class="c1"># load uWSGI plugins</span>
<span class="nv">plugin</span> <span class="o">=</span> python3,http
<span class="c1"># By default the Python plugin does not initialize the GIL. This means your</span>
<span class="c1"># app-generated threads will not run. If you need threads, remember to enable</span>
<span class="c1"># them with enable-threads. Running uWSGI in multithreading mode (with the</span>
<span class="c1"># threads options) will automatically enable threading support. This *strange*</span>
<span class="c1"># default behaviour is for performance reasons.</span>
enable-threads <span class="o">=</span> <span class="nb">true</span>
<span class="c1"># plugin: python</span>
<span class="c1"># --------------</span>
<span class="c1">#</span>
<span class="c1"># https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python</span>
<span class="c1"># load a WSGI module</span>
<span class="nv">module</span> <span class="o">=</span> searx.webapp
<span class="c1"># set PYTHONHOME/virtualenv</span>
<span class="nv">virtualenv</span> <span class="o">=</span> /usr/local/searx/searx-pyenv
<span class="c1"># add directory (or glob) to pythonpath</span>
<span class="nv">pythonpath</span> <span class="o">=</span> /usr/local/searx/searx-src
<span class="c1"># speak to upstream</span>
<span class="c1"># -----------------</span>
<span class="c1">#</span>
<span class="c1"># Activate the &#39;http&#39; configuration for filtron or activate the &#39;socket&#39;</span>
<span class="c1"># configuration if you setup your HTTP server to use uWSGI protocol via sockets.</span>
<span class="c1"># using IP:</span>
<span class="c1">#</span>
<span class="c1"># https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http</span>
<span class="c1"># Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html</span>
<span class="nv">http</span> <span class="o">=</span> <span class="m">127</span>.0.0.1:8888
<span class="c1"># using unix-sockets:</span>
<span class="c1">#</span>
<span class="c1"># On some distributions you need to create the app folder for the sockets::</span>
<span class="c1">#</span>
<span class="c1"># mkdir -p /run/uwsgi/app/searx</span>
<span class="c1"># chown -R searx:searx /run/uwsgi/app/searx</span>
<span class="c1">#</span>
<span class="c1"># socket = /run/uwsgi/app/searx/socket</span>
<span class="c1"># Cache</span>
<span class="nv">cache2</span> <span class="o">=</span> <span class="nv">name</span><span class="o">=</span>searxcache,items<span class="o">=</span><span class="m">2000</span>,blocks<span class="o">=</span><span class="m">2000</span>,blocksize<span class="o">=</span><span class="m">4096</span>,bitmap<span class="o">=</span><span class="m">1</span>
</pre></div>
</div>
</div></div>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<span id="sidebar-top"></span>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/searx_logo_small.png" alt="Logo"/>
</a></p>
<h3>Project Links</h3>
<ul>
<li><a href="https://github.com/searx/searx">Source</a>
<li><a href="https://github.com/searx/searx/wiki">Wiki</a>
<li><a href="https://searx.space">Public instances</a>
<li><a href="https://twitter.com/Searx_engine">Twitter</a>
<li><a href="https://github.com/searx/searx/issues">Issue Tracker</a>
</ul><h3>Navigation</h3>
<ul>
<li><a href="../index.html">Overview</a>
<ul>
<li><a href="index.html">Administrator documentation</a>
<ul>
<li>Previous: <a href="installation-searx.html" title="previous chapter">Step by step installation</a>
<li>Next: <a href="installation-nginx.html" title="next chapter">Install with nginx</a></ul>
</li>
</ul>
</li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2015-2020, Adam Tauber, Noémi Ványi.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.5.2.
</div>
<script src="../_static/version_warning_offset.js"></script>
</body>
</html>