searx/admin/installation-uwsgi.html

247 lines
12 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">
<title>uwsgi &#8212; Searx Documentation (Searx-0.17.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.17.0.tex)</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Administrator documentation</a> &#187;</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 --&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">
<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">
<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-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">
</div>
<div class="ui bottom attached sphinx-tab tab segment sphinx-data-tab-QXJjaCBMaW51eA== docutils container">
</div>
<div class="ui bottom attached sphinx-tab tab segment sphinx-data-tab-RmVkb3JhIC8gUkhFTA== docutils container">
</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">
</div>
<div class="ui bottom attached sphinx-tab tab segment sphinx-data-tab-QXJjaCBMaW51eA== docutils container">
</div>
<div class="ui bottom attached sphinx-tab tab segment sphinx-data-tab-RmVkb3JhIC8gUkhFTA== docutils container">
</div>
</div>
</div>
</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">
&#169; Copyright 2015-2020, Adam Tauber, Noémi Ványi.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 3.0.1.
</div>
<script src="../_static/version_warning_offset.js"></script>
</body>
</html>