Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
serveur_hebergement:installer_une_instance_searx [2022/10/05 14:01] – fate | serveur_hebergement:installer_une_instance_searx [2025/01/25 17:19] (Version actuelle) – [Redis] fate | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== | + | ====== Searxng ====== |
===== Présentation de Searxng ===== | ===== Présentation de Searxng ===== | ||
- | [[https:// | + | [[https:// |
===== Préparation ===== | ===== Préparation ===== | ||
- | Installez les dépendances : <code bash> | + | Installez les dépendances : <code bash> |
Créez un utilisateur searxng : | Créez un utilisateur searxng : | ||
<code bash> | <code bash> | ||
- | Créez le répertoire home : | + | Créez le répertoire home ainsi que le sous répertoire pour le socket uWSGI : |
- | <code bash> | + | <code bash> |
Modifiez le propriétaire du répertoire home : | Modifiez le propriétaire du répertoire home : | ||
Ligne 32: | Ligne 32: | ||
<code bash> | <code bash> | ||
- | Déconnectez vous avec la commande <code bash> | + | Déconnectez-vous avec la commande <code bash> |
Connectez-vous de nouveau avec l' | Connectez-vous de nouveau avec l' | ||
<code bash> | <code bash> | ||
Ligne 46: | Ligne 46: | ||
Lancez l' | Lancez l' | ||
<code bash> | <code bash> | ||
- | cd "/ | + | cd "/ |
pip install -e . | pip install -e . | ||
</ | </ | ||
Ligne 142: | Ligne 142: | ||
* safe_search: | * safe_search: | ||
* autocomplete: | * autocomplete: | ||
- | * formats: - html -> seule l' | + | * formats: - html -> seule l' |
* limiter: true -> active le filtre anti-bot | * limiter: true -> active le filtre anti-bot | ||
* results_on_new_tab: | * results_on_new_tab: | ||
* use_mobile_ui: | * use_mobile_ui: | ||
- | * | + | |
+ | ===== Redis ===== | ||
+ | |||
+ | Redis va stocker la base de donnée du plugin " | ||
+ | |||
+ | On va utiliser le script d' | ||
+ | <code bash> | ||
+ | sudo -s | ||
+ | sudo / | ||
+ | </ | ||
+ | |||
+ | Choisissez les réponses par défaut à chaque question. | ||
===== uWSGI ===== | ===== uWSGI ===== | ||
Ligne 156: | Ligne 167: | ||
Collez-y les lignes suivantes : | Collez-y les lignes suivantes : | ||
<code bash> | <code bash> | ||
+ | # -*- mode: conf; coding: utf-8 -*- | ||
[uwsgi] | [uwsgi] | ||
Ligne 163: | Ligne 175: | ||
# https:// | # https:// | ||
- | # Who will run the code | + | # Who will run the code / Hint: in emperor-tyrant mode uid & gid setting will be |
+ | # ignored [1]. Mode emperor-tyrant is the default on fedora (/ | ||
+ | # | ||
+ | # [1] https:// | ||
+ | # | ||
uid = searxng | uid = searxng | ||
gid = searxng | gid = searxng | ||
Ligne 173: | Ligne 189: | ||
# chdir to specified directory before apps loading | # chdir to specified directory before apps loading | ||
- | chdir = / | + | chdir = / |
- | # searxng | + | # SearXNG |
- | env = SEARX_SETTINGS_PATH=/ | + | env = SEARXNG_SETTINGS_PATH=/ |
# disable logging for privacy | # disable logging for privacy | ||
Ligne 210: | Ligne 226: | ||
# load a WSGI module | # load a WSGI module | ||
- | module = searxng.webapp | + | module = searx.webapp |
# set PYTHONHOME/ | # set PYTHONHOME/ | ||
- | virtualenv = / | + | virtualenv = / |
# add directory (or glob) to pythonpath | # add directory (or glob) to pythonpath | ||
Ligne 221: | Ligne 237: | ||
# speak to upstream | # speak to upstream | ||
# ----------------- | # ----------------- | ||
- | # | ||
- | # Activate the ' | ||
- | # configuration if you setup your HTTP server to use uWSGI protocol via sockets. | ||
- | # using IP: | + | socket = /usr/local/searxng/run/socket |
- | # | + | buffer-size = 8192 |
- | # https://uwsgi-docs.readthedocs.io/en/latest/Options.html# | + | |
- | # Native HTTP support: https:// | + | |
- | http = 127.0.0.1: | + | # uWSGI serves |
- | + | ||
- | # using unix-sockets: | + | |
- | # | + | |
- | # On some distributions you need to create | + | |
# | # | ||
- | # mkdir -p / | + | # ui: |
- | # chown -R searxng:searxng | + | # static_use_hash: true |
# | # | ||
- | # socket | + | static-map |
+ | # expires set to one year since there are hashes | ||
+ | static-expires = /* 31557600 | ||
+ | static-gzip-all = True | ||
+ | offload-threads = %k | ||
# Cache | # Cache | ||
Ligne 253: | Ligne 264: | ||
===== Configuration d' | ===== Configuration d' | ||
- | On va configurer Apache2 pour pour voir accéder à notre instance Searx via un sous domaine style searx.domaine.fr (je ne traiterai pas la gestion du nom de domaine) | + | On va configurer Apache2 pour pouvoir |
Activez les modules Apache2 nécessaires : | Activez les modules Apache2 nécessaires : | ||
- | <code bash> | + | <code bash> |
Créez le fichier de config Apache2 : | Créez le fichier de config Apache2 : | ||
<code bash> | <code bash> | ||
- | Copiez-y les lignes suivantes (remplacez le noom de domaine par le votre ainsi que l' | + | Copiez-y les lignes suivantes (remplacez le noom de domaine par le vôtre |
<code apache> | <code apache> | ||
< | < | ||
ServerName searx.nomdedomaine.fr | ServerName searx.nomdedomaine.fr | ||
- | ServerAdmin fate@nomdedomaine.fr | ||
Redirect / https:// | Redirect / https:// | ||
</ | </ | ||
+ | |||
+ | < | ||
+ | ServerName searx.rasp.fr | ||
LogLevel warn | LogLevel warn | ||
ErrorLog ${APACHE_LOG_DIR}/ | ErrorLog ${APACHE_LOG_DIR}/ | ||
- | < | + | |
- | SSLEngine on | + | SSLEngine on |
- | SSLProxyEngine On | + | SSLProxyEngine On |
- | ProxyRequests Off | + | ProxyRequests Off |
- | ProxyPreserveHost On | + | ProxyPreserveHost On |
- | SSLCertificateFile / | + | SSLCertificateFile / |
- | SSLCertificateKeyFile / | + | SSLCertificateKeyFile / |
- | AddDefaultCharset utf-8 | + | AddDefaultCharset utf-8 |
- | HostnameLookups off | + | HostnameLookups off |
- | UseCanonicalName off | + | UseCanonicalName off |
- | ProxyBadHeader Ignore | + | ProxyBadHeader Ignore |
- | KeepAlive off | + | KeepAlive off |
- | Header set Content-Security-Policy " | + | Header set Content-Security-Policy " |
- | </ | + | |
| | ||
ProxyPreserveHost On | ProxyPreserveHost On | ||
Ligne 300: | Ligne 312: | ||
</ | </ | ||
- | # modern configuration, | ||
- | SSLProtocol | ||
- | SSLCipherSuite | ||
- | SSLHonorCipherOrder | ||
- | SSLCompression | ||
- | SSLSessionTickets | ||
- | |||
- | # OCSP Stapling, only in httpd 2.3.3 and later | ||
- | SSLUseStapling | ||
- | SSLStaplingResponderTimeout 5 | ||
- | SSLStaplingReturnResponderErrors off | ||
- | SSLStaplingCache | ||
</ | </ | ||
Ligne 317: | Ligne 317: | ||
<code bash> | <code bash> | ||
- | ===== Redis ===== | + | Votre instance SearXNG est maintenant accessible à l' |
- | Redis va stocker la base de donnée du plugin " | + | ===== Mise à jour de SearXNG |
- | + | ||
- | On va utiliser le script d' | + | |
- | <code bash> | + | |
- | + | ||
- | Choissisez les réponses par défaut à chaque question. | + | |
- | + | ||
- | Votre instance SearXNG est maintenant accessible à l' | + | |
+ | Pour mettre à jour votre instance, il vous suffit de lancer la commande suivante : | ||
+ | <code bash> | ||