Raspi - Wiki

Installation de RaspiOS

Outils pour utilisateurs

Outils du site


web:authentification

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
web:authentification [2022/02/24 17:59] – créée michelweb:authentification [2022/03/09 14:23] (Version actuelle) michel
Ligne 1: Ligne 1:
 ====== HTTP Authentification ====== ====== HTTP Authentification ======
 +Il faut commencer par créer des utilisateur, pour cela nous avons besoins de htpasswd pour gérer notre ficher chiffré d'utilisateurs.
 +Afin d'accéder à cette commande, nous avons besoin d'installer le paquet apache2-utils. 
 +<code>
 +sudo apt install apache2-utils
 +sudo htpasswd -c /etc/nginx/.htpasswd pi
 +</code>
 +Puis on configure nginx en editant le fichier //**/etc/nginx/sites-available/monsite**//
 +<file conf monsite>
 +server {
 + listen 80;
 + listen [::]:80;
 + root /var/www/monsite;
 + index index.php index.html index.htm
 + server_name monsite.com;
 + location / {
 +                try_files $uri $uri/ =404;
 + auth_basic "Secure area - Authentication requise";
 +                auth_basic_user_file /etc/nginx/.htpasswd;
 + }
 + location ~ \.php$ {
 + include snippets/fastcgi-php.conf;
 + fastcgi_pass unix:/run/php/php7.4-fpm.sock;
 + }
 +}
 +</file>
 +Et comme pour virtualhost il faut recharger la configuration de NGINX
  
 +
 +
 +{{counter}}
web/authentification.1645721957.txt.gz · Dernière modification : 2022/02/24 17:59 de michel