Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eedd63cc authored by Markus Heiser's avatar Markus Heiser
Browse files

docs: revision of the installation instructions

parent a5eefea6
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -4,13 +4,18 @@
Buildhosts
Buildhosts
==========
==========


To get best results from build, its recommend to install additional packages
on build hosts.

.. sidebar:: This article needs some work
.. sidebar:: This article needs some work


   If you have any contribution send us your :pull:`PR <../pulls>`, see
   If you have any contribution send us your :pull:`PR <../pulls>`, see
   :ref:`how to contribute`.
   :ref:`how to contribute`.


To get best results from build, its recommend to install additional packages
.. contents:: Contents
on build hosts.
   :depth: 2
   :local:
   :backlinks: entry


.. _docs build:
.. _docs build:


+5 −0
Original line number Original line Diff line number Diff line
@@ -9,6 +9,11 @@ How to protect an instance


   - :ref:`filtron.sh`
   - :ref:`filtron.sh`


.. contents:: Contents
   :depth: 2
   :local:
   :backlinks: entry

.. _filtron: https://github.com/asciimoo/filtron
.. _filtron: https://github.com/asciimoo/filtron


Searx depens on external search services.  To avoid the abuse of these services
Searx depens on external search services.  To avoid the abuse of these services
+4 −1
Original line number Original line Diff line number Diff line
@@ -3,9 +3,12 @@ Administrator documentation
===========================
===========================


.. toctree::
.. toctree::
   :maxdepth: 1
   :maxdepth: 2
   :caption: Contents


   installation
   installation
   installation-nginx
   installation-apache
   settings
   settings
   api
   api
   architecture
   architecture
+94 −0
Original line number Original line Diff line number Diff line
.. _installation apache:

===================
Install with apache
===================

.. sidebar:: public HTTP servers

   On public searx instances use an application firewall (:ref:`filtron
   <filtron.sh>`).

.. contents:: Contents
   :depth: 2
   :local:
   :backlinks: entry

Add wsgi mod
============

.. tabs::

   .. group-tab:: Ubuntu / debian

      .. code:: sh

         sudo -H apt-get install libapache2-mod-uwsgi
         sudo -H a2enmod uwsgi

Add this configuration in the file ``/etc/apache2/apache2.conf``.  To limit
acces to your intranet replace ``Allow from all`` directive and replace
``192.168.0.0/16`` with your subnet IP/class.

.. _inranet apache site:

Note that if your instance of searx is not at the root, you should change
``<Location />`` by the location of your instance, like ``<Location /searx>``:

.. code:: apache

   # CustomLog /dev/null combined

   <IfModule mod_uwsgi.c>

     <Location />

          Options FollowSymLinks Indexes
          SetHandler uwsgi-handler
          uWSGISocket /run/uwsgi/app/searx/socket

          Order deny,allow
          Deny from all
          # Allow from fd00::/8 192.168.0.0/16 fe80::/10 127.0.0.0/8 ::1
          Allow from all

     </Location>

   </IfModule>

Enable apache mod_uwsgi and restart apache:

.. tabs::

   .. group-tab:: Ubuntu / debian

      .. code:: sh

         a2enmod uwsgi
         sudo -H systemctl restart apache2

disable logs
============

For better privacy you can disable Apache logs.  Go back to
``/etc/apache2/apache2.conf`` :ref:`[example] <inranet apache site>` and above
``<Location />`` activate directive:

.. code:: apache

    CustomLog /dev/null combined

Restart apache:

.. tabs::

   .. group-tab:: Ubuntu / debian

      .. code:: sh

         sudo -H systemctl restart apache2

.. warning::

   You can only disable logs for the whole (virtual) server not for a specific
   path.
+141 −0
Original line number Original line Diff line number Diff line
.. _installation nginx:

==================
Install with nginx
==================

.. sidebar:: public HTTP servers

   On public searx instances use an application firewall (:ref:`filtron
   <filtron.sh>`).

.. contents:: Contents
   :depth: 2
   :local:
   :backlinks: entry

If nginx is not installed (uwsgi will not work with the package
nginx-light):

.. tabs::

   .. group-tab:: Ubuntu / debian

      .. code:: sh

         sudo -H apt-get install nginx

Hosted at ``/``
===============

Create the configuration file ``/etc/nginx/sites-available/searx`` with this
content:

.. code:: nginx

    server {
        listen 80;
        server_name searx.example.com;
        root /usr/local/searx/searx;

        location /static {
        }

        location / {
                include uwsgi_params;
                uwsgi_pass unix:/run/uwsgi/app/searx/socket;
        }
    }

Create a symlink to sites-enabled:

.. code:: sh

   sudo -H ln -s /etc/nginx/sites-available/searx /etc/nginx/sites-enabled/searx

Restart service:

.. tabs::

   .. group-tab:: Ubuntu / debian

      .. code:: sh

         sudo -H systemctl restart nginx
         sudo -H systemctl restart uwsgi

from subdirectory URL (``/searx``)
==================================

Add this configuration in the server config file
``/etc/nginx/sites-enabled/default``:

.. code:: nginx

    location /searx/static {
            alias /usr/local/searx/searx/static;
    }

    location /searx {
            uwsgi_param SCRIPT_NAME /searx;
            include uwsgi_params;
            uwsgi_pass unix:/run/uwsgi/app/searx/socket;
    }


**OR** using reverse proxy (Please, note that reverse proxy advised to be used
in case of single-user or low-traffic instances.)

.. code:: nginx

    location /searx/static {
            alias /usr/local/searx/searx/static;
    }

    location /searx {
        proxy_pass http://127.0.0.1:8888;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Script-Name /searx;
        proxy_buffering off;
    }

Enable ``base_url`` in ``searx/settings.yml``

.. code:: yaml

    base_url : http://your.domain.tld/searx/

Restart service:

.. tabs::

   .. group-tab:: Ubuntu / debian

      .. code:: sh

         sudo -H systemctl restart nginx
         sudo -H systemctl restart uwsgi


disable logs
============

For better privacy you can disable nginx logs about searx.  How to proceed:
below ``uwsgi_pass`` in ``/etc/nginx/sites-available/default`` add:

.. code:: nginx

    access_log /dev/null;
    error_log /dev/null;

Restart service:

.. tabs::

   .. group-tab:: Ubuntu / debian

      .. code:: sh

         sudo -H systemctl restart nginx
Loading