searx/admin/installation-uwsgi.html

505 lines
28 KiB
HTML
Raw Normal View History

2020-06-19 11:15:15 +02:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
2020-09-30 10:35:05 +02:00
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
2020-06-19 11:15:15 +02:00
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>uwsgi &#8212; Searx Documentation (Searx-1.0.0.tex)</title>
2020-06-19 11:15:15 +02:00
<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" />
2020-06-19 11:15:15 +02:00
<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>
2020-06-19 11:15:15 +02:00
<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" />
</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>
2020-06-19 11:15:15 +02:00
<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>
2020-09-30 10:35:05 +02:00
<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>
2020-06-19 11:15:15 +02:00
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="uwsgi">
2020-06-19 11:15:15 +02:00
<span id="searx-uwsgi"></span><h1>uwsgi<a class="headerlink" href="#uwsgi" title="Permalink to this headline"></a></h1>
<div class="sidebar">
2020-06-19 11:15:15 +02:00
<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>
</div>
2020-06-19 11:15:15 +02:00
<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>
<div class="section" id="origin-uwsgi">
2020-06-19 11:15:15 +02:00
<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>
</div>
<div class="section" id="distributors">
2020-06-19 11:15:15 +02:00
<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>
</div>
<div class="section" id="alltogether">
2020-06-19 11:15:15 +02:00
<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>
2020-10-16 19:44:45 +02:00
<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>
2020-10-16 19:44:45 +02:00
<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>
2020-10-16 19:44:45 +02:00
<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>
2020-06-19 11:15:15 +02:00
<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>
2020-10-16 19:44:45 +02:00
<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>
2020-10-16 19:44:45 +02:00
<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
2020-10-16 19:44:45 +02:00
<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>
2020-10-22 13:49:31 +02:00
<span class="c1"># chown -R searx:searx /run/uwsgi/app/searx</span>
2020-10-16 19:44:45 +02:00
<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>
2020-10-16 19:44:45 +02:00
</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>
2020-10-16 19:44:45 +02:00
<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>
2020-10-16 19:44:45 +02:00
<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
2020-10-16 19:44:45 +02:00
<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>
2020-10-16 19:44:45 +02:00
</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>
2020-10-16 19:44:45 +02:00
<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>
2020-10-16 19:44:45 +02:00
<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
2020-10-16 19:44:45 +02:00
<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>
2020-10-22 13:49:31 +02:00
<span class="c1"># chown -R searx:searx /run/uwsgi/app/searx</span>
2020-10-16 19:44:45 +02:00
<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>
2020-10-16 19:44:45 +02:00
</pre></div>
</div>
</div></div>
</div>
</div>
2020-06-19 11:15:15 +02:00
2020-09-30 10:35:05 +02:00
<div class="clearer"></div>
2020-06-19 11:15:15 +02:00
</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>
2020-09-30 10:35:05 +02:00
<li><a href="https://github.com/searx/searx">Source</a>
2020-06-19 11:15:15 +02:00
2020-09-30 10:35:05 +02:00
<li><a href="https://github.com/searx/searx/wiki">Wiki</a>
2020-06-19 11:15:15 +02:00
<li><a href="https://searx.space">Public instances</a>
2020-06-19 11:15:15 +02:00
<li><a href="https://twitter.com/Searx_engine">Twitter</a>
<li><a href="https://github.com/searx/searx/issues">Issue Tracker</a>
2020-06-19 11:15:15 +02:00
</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.4.
2020-06-19 11:15:15 +02:00
</div>
<script src="../_static/version_warning_offset.js"></script>
</body>
</html>