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/10/28 20:17] (Version actuelle) – [Installation de Searxng] 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 42: | Ligne 42: | ||
| pip install -U wheel | pip install -U wheel | ||
| pip install -U pyyaml | pip install -U pyyaml | ||
| + | pip install -U dateutils | ||
| + | pip install -U isodate | ||
| + | pip install -U typer | ||
| + | pip install -U msgspec | ||
| + | pip install -U uvloop | ||
| + | pip install -U httpx_socks | ||
| + | pip install -U httpx | ||
| + | pip install -U lxml | ||
| + | pip install -U redis | ||
| + | pip install -U markdown-it-py | ||
| + | pip install -U flask_babel | ||
| + | pip install -U flask | ||
| + | pip install -U pygments | ||
| + | |||
| </ | </ | ||
| Lancez l' | Lancez l' | ||
| <code bash> | <code bash> | ||
| - | cd "/ | + | cd "/ |
| - | pip install -e . | + | pip install |
| </ | </ | ||
| Ligne 142: | Ligne 156: | ||
| * 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 181: | ||
| Collez-y les lignes suivantes : | Collez-y les lignes suivantes : | ||
| <code bash> | <code bash> | ||
| + | # -*- mode: conf; coding: utf-8 -*- | ||
| [uwsgi] | [uwsgi] | ||
| Ligne 163: | Ligne 189: | ||
| # 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 203: | ||
| # 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 240: | ||
| # 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 251: | ||
| # speak to upstream | # speak to upstream | ||
| # ----------------- | # ----------------- | ||
| - | # | ||
| - | # Activate the ' | ||
| - | # configuration if you setup your HTTP server to use uWSGI protocol via sockets. | ||
| - | |||
| - | # using IP: | ||
| - | # | ||
| - | # https:// | ||
| - | # Native HTTP support: https:// | ||
| - | http = 127.0.0.1: | + | socket |
| + | buffer-size = 8192 | ||
| - | # using unix-sockets: | + | # uWSGI serves the static files and in settings.yml we use:: |
| # | # | ||
| - | # On some distributions you need to create the app folder for the sockets:: | + | # ui: |
| + | # | ||
| # | # | ||
| - | # | + | static-map = /static=/usr/local/ |
| - | # | + | # expires set to one year since there are hashes |
| - | # | + | static-expires |
| - | # socket | + | static-gzip-all = True |
| + | offload-threads = %k | ||
| # Cache | # Cache | ||
| Ligne 253: | Ligne 278: | ||
| ===== 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 326: | ||
| </ | </ | ||
| - | # 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 331: | ||
| <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> | ||