mirror of https://github.com/searx/searx
517 lines
29 KiB
HTML
517 lines
29 KiB
HTML
|
|
|||
|
<!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 — Searx Documentation (Searx-0.16.0.tex)</title>
|
|||
|
<link rel="stylesheet" href="../_static/searx.css" type="text/css" />
|
|||
|
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
|||
|
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/semantic-ui-2.4.1/segment.min.css" />
|
|||
|
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/semantic-ui-2.4.1/menu.min.css" />
|
|||
|
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/semantic-ui-2.4.1/tab.min.css" />
|
|||
|
<link rel="stylesheet" type="text/css" href="../_static/sphinx_tabs/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/language_data.js"></script>
|
|||
|
<script src="../_static/sphinx_tabs/semantic-ui-2.4.1/tab.min.js"></script>
|
|||
|
<script src="../_static/sphinx_tabs/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="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-0.16.0.tex)</a> »</li>
|
|||
|
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Administrator documentation</a> »</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">
|
|||
|
|
|||
|
<div class="section" id="uwsgi">
|
|||
|
<span id="searx-uwsgi"></span><h1>uwsgi<a class="headerlink" href="#uwsgi" title="Permalink to this headline">¶</a></h1>
|
|||
|
<div 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>
|
|||
|
</div>
|
|||
|
<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">
|
|||
|
<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 --> /usr/lib/systemd/system/uwsgi@.service
|
|||
|
uwsgi ini files --> /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 --> /etc/uwsgi.d/searx.ini
|
|||
|
to reload the instance edit timestamp --> touch /etc/uwsgi.d/searx.ini
|
|||
|
to stop instance remove ini --> rm /etc/uwsgi.d/searx.ini
|
|||
|
</pre></div>
|
|||
|
</div>
|
|||
|
</div></blockquote>
|
|||
|
</div>
|
|||
|
<div class="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 debian’s 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 <command> <confname> <confname> ...
|
|||
|
|
|||
|
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">
|
|||
|
<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 class="ui top attached tabular menu sphinx-menu docutils container">
|
|||
|
<div class="active item sphinx-data-tab-VWJ1bnR1IC8gZGViaWFu docutils container">
|
|||
|
<div class="docutils container">
|
|||
|
<p>Ubuntu / debian</p>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="item sphinx-data-tab-RmVkb3JhIC8gUkhFTA== docutils container">
|
|||
|
<div class="docutils container">
|
|||
|
<p>Fedora / RHEL</p>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="ui bottom attached sphinx-tab tab segment sphinx-data-tab-VWJ1bnR1IC8gZGViaWFu active docutils container">
|
|||
|
<p># init.d –> /usr/share/doc/uwsgi/README.Debian.gz
|
|||
|
# For uWSGI debian uses the LSB init process, this might be changed
|
|||
|
# one day, see <a class="reference external" href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833067">https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833067</a></p>
|
|||
|
<p>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
|
|||
|
..</p>
|
|||
|
</div>
|
|||
|
<blockquote>
|
|||
|
<div><p># systemd –> /usr/lib/systemd/system/uwsgi@.service
|
|||
|
# For uWSGI archlinux uses systemd template units, see
|
|||
|
# - <a class="reference external" href="http://0pointer.de/blog/projects/instances.html">http://0pointer.de/blog/projects/instances.html</a>
|
|||
|
# - <a class="reference external" href="https://uwsgi-docs.readthedocs.io/en/latest/Systemd.html#one-service-per-app-in-systemd">https://uwsgi-docs.readthedocs.io/en/latest/Systemd.html#one-service-per-app-in-systemd</a></p>
|
|||
|
<p>create: /etc/uwsgi/searx.ini
|
|||
|
enable: sudo -H systemctl enable <a class="reference external" href="mailto:uwsgi%40searx">uwsgi<span>@</span>searx</a>
|
|||
|
start: sudo -H systemctl start <a class="reference external" href="mailto:uwsgi%40searx">uwsgi<span>@</span>searx</a>
|
|||
|
restart: sudo -H systemctl restart <a class="reference external" href="mailto:uwsgi%40searx">uwsgi<span>@</span>searx</a>
|
|||
|
stop: sudo -H systemctl stop <a class="reference external" href="mailto:uwsgi%40searx">uwsgi<span>@</span>searx</a>
|
|||
|
disable: sudo -H systemctl disable <a class="reference external" href="mailto:uwsgi%40searx">uwsgi<span>@</span>searx</a>
|
|||
|
..</p>
|
|||
|
</div></blockquote>
|
|||
|
<div class="ui bottom attached sphinx-tab tab segment sphinx-data-tab-RmVkb3JhIC8gUkhFTA== docutils container">
|
|||
|
<p># systemd –> /usr/lib/systemd/system/uwsgi.service
|
|||
|
# The unit file starts uWSGI in emperor mode (/etc/uwsgi.ini), see
|
|||
|
# - <a class="reference external" href="https://uwsgi-docs.readthedocs.io/en/latest/Emperor.html">https://uwsgi-docs.readthedocs.io/en/latest/Emperor.html</a></p>
|
|||
|
<p>create: /etc/uwsgi.d/searx.ini
|
|||
|
restart: sudo -H touch /etc/uwsgi.d/searx.ini
|
|||
|
disable: sudo -H rm /etc/uwsgi.d/searx.ini
|
|||
|
..</p>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="sphinx-tabs docutils container">
|
|||
|
<div class="ui top attached tabular menu sphinx-menu docutils container">
|
|||
|
<div class="active item sphinx-data-tab-VWJ1bnR1IC8gZGViaWFu docutils container">
|
|||
|
<div class="docutils container">
|
|||
|
<p>Ubuntu / debian</p>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="item sphinx-data-tab-QXJjaCBMaW51eA== docutils container">
|
|||
|
<div class="docutils container">
|
|||
|
<p>Arch Linux</p>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="item sphinx-data-tab-RmVkb3JhIC8gUkhFTA== docutils container">
|
|||
|
<div class="docutils container">
|
|||
|
<p>Fedora / RHEL</p>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="ui bottom attached sphinx-tab tab segment sphinx-data-tab-VWJ1bnR1IC8gZGViaWFu active docutils container">
|
|||
|
<pre class="code ini literal-block"><code><span class="keyword">[uwsgi]</span>
|
|||
|
|
|||
|
<span class="comment single"># uWSGI core</span>
|
|||
|
<span class="comment single"># ----------</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core</span>
|
|||
|
|
|||
|
<span class="comment single"># Who will run the code</span>
|
|||
|
<span class="name attribute">uid</span> <span class="operator">=</span> <span class="literal string">searx</span>
|
|||
|
<span class="name attribute">gid</span> <span class="operator">=</span> <span class="literal string">searx</span>
|
|||
|
|
|||
|
<span class="comment single"># chdir to specified directory before apps loading</span>
|
|||
|
<span class="name attribute">chdir</span> <span class="operator">=</span> <span class="literal string">/usr/local/searx/searx-src/searx</span>
|
|||
|
|
|||
|
<span class="comment single"># searx configuration (settings.yml)</span>
|
|||
|
<span class="name attribute">env</span> <span class="operator">=</span> <span class="literal string">SEARX_SETTINGS_PATH=/etc/searx/settings.yml</span>
|
|||
|
|
|||
|
<span class="comment single"># disable logging for privacy</span>
|
|||
|
<span class="name attribute">disable-logging</span> <span class="operator">=</span> <span class="literal string">true</span>
|
|||
|
|
|||
|
<span class="comment single"># The right granted on the created socket</span>
|
|||
|
<span class="name attribute">chmod-socket</span> <span class="operator">=</span> <span class="literal string">666</span>
|
|||
|
|
|||
|
<span class="comment single"># Plugin to use and interpretor config</span>
|
|||
|
<span class="name attribute">single-interpreter</span> <span class="operator">=</span> <span class="literal string">true</span>
|
|||
|
|
|||
|
<span class="comment single"># enable master process</span>
|
|||
|
<span class="name attribute">master</span> <span class="operator">=</span> <span class="literal string">true</span>
|
|||
|
|
|||
|
<span class="comment single"># load apps in each worker instead of the master</span>
|
|||
|
<span class="name attribute">lazy-apps</span> <span class="operator">=</span> <span class="literal string">true</span>
|
|||
|
|
|||
|
<span class="comment single"># load uWSGI plugins</span>
|
|||
|
<span class="name attribute">plugin</span> <span class="operator">=</span> <span class="literal string">python3,http</span>
|
|||
|
|
|||
|
<span class="comment single"># By default the Python plugin does not initialize the GIL. This means your</span>
|
|||
|
<span class="comment single"># app-generated threads will not run. If you need threads, remember to enable</span>
|
|||
|
<span class="comment single"># them with enable-threads. Running uWSGI in multithreading mode (with the</span>
|
|||
|
<span class="comment single"># threads options) will automatically enable threading support. This *strange*</span>
|
|||
|
<span class="comment single"># default behaviour is for performance reasons.</span>
|
|||
|
<span class="name attribute">enable-threads</span> <span class="operator">=</span> <span class="literal string">true</span>
|
|||
|
|
|||
|
|
|||
|
<span class="comment single"># plugin: python</span>
|
|||
|
<span class="comment single"># --------------</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python</span>
|
|||
|
|
|||
|
<span class="comment single"># load a WSGI module</span>
|
|||
|
<span class="name attribute">module</span> <span class="operator">=</span> <span class="literal string">searx.webapp</span>
|
|||
|
|
|||
|
<span class="comment single"># set PYTHONHOME/virtualenv</span>
|
|||
|
<span class="name attribute">virtualenv</span> <span class="operator">=</span> <span class="literal string">/usr/local/searx/searx-pyenv</span>
|
|||
|
|
|||
|
<span class="comment single"># add directory (or glob) to pythonpath</span>
|
|||
|
<span class="name attribute">pythonpath</span> <span class="operator">=</span> <span class="literal string">/usr/local/searx/searx-src</span>
|
|||
|
|
|||
|
|
|||
|
<span class="comment single"># speak to upstream</span>
|
|||
|
<span class="comment single"># -----------------</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># Activate the 'http' configuration for filtron or activate the 'socket'</span>
|
|||
|
<span class="comment single"># configuration if you setup your HTTP server to use uWSGI protocol via sockets.</span>
|
|||
|
|
|||
|
<span class="comment single"># using IP:</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http</span>
|
|||
|
<span class="comment single"># Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html</span>
|
|||
|
|
|||
|
<span class="name attribute">http</span> <span class="operator">=</span> <span class="literal string">127.0.0.1:8888</span>
|
|||
|
|
|||
|
<span class="comment single"># using unix-sockets:</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># On some distributions you need to create the app folder for the sockets::</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># mkdir -p /run/uwsgi/app/searx</span>
|
|||
|
<span class="comment single"># chmod -R searx:searx /run/uwsgi/app/searx</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># socket = /run/uwsgi/app/searx/socket</span>
|
|||
|
|
|||
|
<span class="error">..</span></code></pre>
|
|||
|
</div>
|
|||
|
<div class="ui bottom attached sphinx-tab tab segment sphinx-data-tab-QXJjaCBMaW51eA== docutils container">
|
|||
|
<pre class="code ini literal-block"><code><span class="keyword">[uwsgi]</span>
|
|||
|
|
|||
|
<span class="comment single"># uWSGI core</span>
|
|||
|
<span class="comment single"># ----------</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core</span>
|
|||
|
|
|||
|
<span class="comment single"># Who will run the code</span>
|
|||
|
<span class="name attribute">uid</span> <span class="operator">=</span> <span class="literal string">searx</span>
|
|||
|
<span class="name attribute">gid</span> <span class="operator">=</span> <span class="literal string">searx</span>
|
|||
|
|
|||
|
<span class="comment single"># chdir to specified directory before apps loading</span>
|
|||
|
<span class="name attribute">chdir</span> <span class="operator">=</span> <span class="literal string">/usr/local/searx/searx-src/searx</span>
|
|||
|
|
|||
|
<span class="comment single"># searx configuration (settings.yml)</span>
|
|||
|
<span class="name attribute">env</span> <span class="operator">=</span> <span class="literal string">SEARX_SETTINGS_PATH=/etc/searx/settings.yml</span>
|
|||
|
|
|||
|
<span class="comment single"># disable logging for privacy</span>
|
|||
|
<span class="name attribute">logger</span> <span class="operator">=</span> <span class="literal string">systemd</span>
|
|||
|
<span class="name attribute">disable-logging</span> <span class="operator">=</span> <span class="literal string">true</span>
|
|||
|
|
|||
|
<span class="comment single"># The right granted on the created socket</span>
|
|||
|
<span class="name attribute">chmod-socket</span> <span class="operator">=</span> <span class="literal string">666</span>
|
|||
|
|
|||
|
<span class="comment single"># Plugin to use and interpretor config</span>
|
|||
|
<span class="name attribute">single-interpreter</span> <span class="operator">=</span> <span class="literal string">true</span>
|
|||
|
|
|||
|
<span class="comment single"># enable master process</span>
|
|||
|
<span class="name attribute">master</span> <span class="operator">=</span> <span class="literal string">true</span>
|
|||
|
|
|||
|
<span class="comment single"># load apps in each worker instead of the master</span>
|
|||
|
<span class="name attribute">lazy-apps</span> <span class="operator">=</span> <span class="literal string">true</span>
|
|||
|
|
|||
|
<span class="comment single"># load uWSGI plugins</span>
|
|||
|
<span class="name attribute">plugin</span> <span class="operator">=</span> <span class="literal string">python</span>
|
|||
|
|
|||
|
<span class="comment single"># By default the Python plugin does not initialize the GIL. This means your</span>
|
|||
|
<span class="comment single"># app-generated threads will not run. If you need threads, remember to enable</span>
|
|||
|
<span class="comment single"># them with enable-threads. Running uWSGI in multithreading mode (with the</span>
|
|||
|
<span class="comment single"># threads options) will automatically enable threading support. This *strange*</span>
|
|||
|
<span class="comment single"># default behaviour is for performance reasons.</span>
|
|||
|
<span class="name attribute">enable-threads</span> <span class="operator">=</span> <span class="literal string">true</span>
|
|||
|
|
|||
|
|
|||
|
<span class="comment single"># plugin: python</span>
|
|||
|
<span class="comment single"># --------------</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python</span>
|
|||
|
|
|||
|
<span class="comment single"># load a WSGI module</span>
|
|||
|
<span class="name attribute">module</span> <span class="operator">=</span> <span class="literal string">searx.webapp</span>
|
|||
|
|
|||
|
<span class="comment single"># set PYTHONHOME/virtualenv</span>
|
|||
|
<span class="name attribute">virtualenv</span> <span class="operator">=</span> <span class="literal string">/usr/local/searx/searx-pyenv</span>
|
|||
|
|
|||
|
<span class="comment single"># add directory (or glob) to pythonpath</span>
|
|||
|
<span class="name attribute">pythonpath</span> <span class="operator">=</span> <span class="literal string">/usr/local/searx/searx-src</span>
|
|||
|
|
|||
|
|
|||
|
<span class="comment single"># speak to upstream</span>
|
|||
|
<span class="comment single"># -----------------</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># Activate the 'http' configuration for filtron or activate the 'socket'</span>
|
|||
|
<span class="comment single"># configuration if you setup your HTTP server to use uWSGI protocol via sockets.</span>
|
|||
|
|
|||
|
<span class="comment single"># using IP:</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http</span>
|
|||
|
<span class="comment single"># Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html</span>
|
|||
|
|
|||
|
<span class="name attribute">http</span> <span class="operator">=</span> <span class="literal string">127.0.0.1:8888</span>
|
|||
|
|
|||
|
<span class="comment single"># using unix-sockets:</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># On some distributions you need to create the app folder for the sockets::</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># mkdir -p /run/uwsgi/app/searx</span>
|
|||
|
<span class="comment single"># chown -R searx:searx /run/uwsgi/app/searx</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># socket = /run/uwsgi/app/searx/socket</span>
|
|||
|
|
|||
|
<span class="error">..</span></code></pre>
|
|||
|
</div>
|
|||
|
<div class="ui bottom attached sphinx-tab tab segment sphinx-data-tab-RmVkb3JhIC8gUkhFTA== docutils container">
|
|||
|
<pre class="code ini literal-block"><code><span class="keyword">[uwsgi]</span>
|
|||
|
|
|||
|
<span class="comment single"># uWSGI core</span>
|
|||
|
<span class="comment single"># ----------</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># https://uwsgi-docs.readthedocs.io/en/latest/Options.html#uwsgi-core</span>
|
|||
|
|
|||
|
<span class="comment single"># Who will run the code</span>
|
|||
|
<span class="name attribute">uid</span> <span class="operator">=</span> <span class="literal string">searx</span>
|
|||
|
<span class="name attribute">gid</span> <span class="operator">=</span> <span class="literal string">searx</span>
|
|||
|
|
|||
|
<span class="comment single"># chdir to specified directory before apps loading</span>
|
|||
|
<span class="name attribute">chdir</span> <span class="operator">=</span> <span class="literal string">/usr/local/searx/searx-src/searx</span>
|
|||
|
|
|||
|
<span class="comment single"># searx configuration (settings.yml)</span>
|
|||
|
<span class="name attribute">env</span> <span class="operator">=</span> <span class="literal string">SEARX_SETTINGS_PATH=/etc/searx/settings.yml</span>
|
|||
|
|
|||
|
<span class="comment single"># disable logging for privacy</span>
|
|||
|
<span class="name attribute">disable-logging</span> <span class="operator">=</span> <span class="literal string">true</span>
|
|||
|
|
|||
|
<span class="comment single"># The right granted on the created socket</span>
|
|||
|
<span class="name attribute">chmod-socket</span> <span class="operator">=</span> <span class="literal string">666</span>
|
|||
|
|
|||
|
<span class="comment single"># Plugin to use and interpretor config</span>
|
|||
|
<span class="name attribute">single-interpreter</span> <span class="operator">=</span> <span class="literal string">true</span>
|
|||
|
|
|||
|
<span class="comment single"># enable master process</span>
|
|||
|
<span class="name attribute">master</span> <span class="operator">=</span> <span class="literal string">true</span>
|
|||
|
|
|||
|
<span class="comment single"># load apps in each worker instead of the master</span>
|
|||
|
<span class="name attribute">lazy-apps</span> <span class="operator">=</span> <span class="literal string">true</span>
|
|||
|
|
|||
|
<span class="comment single"># load uWSGI plugins</span>
|
|||
|
<span class="name attribute">plugin</span> <span class="operator">=</span> <span class="literal string">python3,http</span>
|
|||
|
|
|||
|
<span class="comment single"># By default the Python plugin does not initialize the GIL. This means your</span>
|
|||
|
<span class="comment single"># app-generated threads will not run. If you need threads, remember to enable</span>
|
|||
|
<span class="comment single"># them with enable-threads. Running uWSGI in multithreading mode (with the</span>
|
|||
|
<span class="comment single"># threads options) will automatically enable threading support. This *strange*</span>
|
|||
|
<span class="comment single"># default behaviour is for performance reasons.</span>
|
|||
|
<span class="name attribute">enable-threads</span> <span class="operator">=</span> <span class="literal string">true</span>
|
|||
|
|
|||
|
|
|||
|
<span class="comment single"># plugin: python</span>
|
|||
|
<span class="comment single"># --------------</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-python</span>
|
|||
|
|
|||
|
<span class="comment single"># load a WSGI module</span>
|
|||
|
<span class="name attribute">module</span> <span class="operator">=</span> <span class="literal string">searx.webapp</span>
|
|||
|
|
|||
|
<span class="comment single"># set PYTHONHOME/virtualenv</span>
|
|||
|
<span class="name attribute">virtualenv</span> <span class="operator">=</span> <span class="literal string">/usr/local/searx/searx-pyenv</span>
|
|||
|
|
|||
|
<span class="comment single"># add directory (or glob) to pythonpath</span>
|
|||
|
<span class="name attribute">pythonpath</span> <span class="operator">=</span> <span class="literal string">/usr/local/searx/searx-src</span>
|
|||
|
|
|||
|
|
|||
|
<span class="comment single"># speak to upstream</span>
|
|||
|
<span class="comment single"># -----------------</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># Activate the 'http' configuration for filtron or activate the 'socket'</span>
|
|||
|
<span class="comment single"># configuration if you setup your HTTP server to use uWSGI protocol via sockets.</span>
|
|||
|
|
|||
|
<span class="comment single"># using IP:</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># https://uwsgi-docs.readthedocs.io/en/latest/Options.html#plugin-http</span>
|
|||
|
<span class="comment single"># Native HTTP support: https://uwsgi-docs.readthedocs.io/en/latest/HTTP.html</span>
|
|||
|
|
|||
|
<span class="name attribute">http</span> <span class="operator">=</span> <span class="literal string">127.0.0.1:8888</span>
|
|||
|
|
|||
|
<span class="comment single"># using unix-sockets:</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># On some distributions you need to create the app folder for the sockets::</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># mkdir -p /run/uwsgi/app/searx</span>
|
|||
|
<span class="comment single"># chmod -R searx:searx /run/uwsgi/app/searx</span>
|
|||
|
<span class="comment single">#</span>
|
|||
|
<span class="comment single"># socket = /run/uwsgi/app/searx/socket</span>
|
|||
|
|
|||
|
<span class="error">..</span></code></pre>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
|
|||
|
<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/asciimoo/searx">Source</a>
|
|||
|
|
|||
|
<li><a href="https://github.com/asciimoo/searx/wiki">Wiki</a>
|
|||
|
|
|||
|
<li><a href="https://searx.space/">Public instances</a>
|
|||
|
|
|||
|
<li><a href="https://twitter.com/Searx_engine">Twitter</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">
|
|||
|
© Copyright 2015-2020, Adam Tauber, Noémi Ványi.
|
|||
|
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.1.1.
|
|||
|
</div>
|
|||
|
<script src="../_static/version_warning_offset.js"></script>
|
|||
|
|
|||
|
</body>
|
|||
|
</html>
|