<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>Archives des sécurisation - La programmation sur le web</title>
	<atom:link href="https://programmation.surleweb-france.fr/tag/securisation/feed/" rel="self" type="application/rss+xml" />
	<link>https://programmation.surleweb-france.fr/tag/securisation/</link>
	<description>La programmation gratuite pour tous</description>
	<lastBuildDate>Wed, 26 May 2021 09:30:13 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2023/08/cropped-19518430-icone-de-programmation-pour-votre-site-web-mobile-presentation-et-conception-de-logo-gratuit-vectoriel.jpg?fit=32%2C32&#038;ssl=1</url>
	<title>Archives des sécurisation - La programmation sur le web</title>
	<link>https://programmation.surleweb-france.fr/tag/securisation/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">176210735</site>	<item>
		<title>Apache, sécuriser un dossier avec .htaccess</title>
		<link>https://programmation.surleweb-france.fr/apache-securiser-un-dossier-avec-htaccess/</link>
					<comments>https://programmation.surleweb-france.fr/apache-securiser-un-dossier-avec-htaccess/#respond</comments>
		
		<dc:creator><![CDATA[Zigomato]]></dc:creator>
		<pubDate>Wed, 26 May 2021 09:30:12 +0000</pubDate>
				<category><![CDATA[Développement Web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[sécurisation]]></category>
		<category><![CDATA[serveur]]></category>
		<guid isPermaLink="false">https://programmation.surleweb-france.fr/?p=1014</guid>

					<description><![CDATA[<p>Voici la mise en place d'une zone sécurisée pour son site avec un accès grâce à un identifiant et mot de passe sur un serveur Apache.</p>
<p class="continue-reading-button"> <a class="continue-reading-link" href="https://programmation.surleweb-france.fr/apache-securiser-un-dossier-avec-htaccess/">Continuer la lecture<i class="crycon-right-dir"></i></a></p>
<p>L’article <a href="https://programmation.surleweb-france.fr/apache-securiser-un-dossier-avec-htaccess/">Apache, sécuriser un dossier avec .htaccess</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>La mise en place d&rsquo;une zone protégée que ce soit pour les membres ou pour l&rsquo;administration nécessite d&rsquo;installer un système d&rsquo;identification par mot de passe, il ne serait pas très malin de laisser la morte ouverte à n&rsquo;importe qui à son site surtout sur la partie administration et du côté membre, quel serait l&rsquo;avantage si leur espace était ouvert à tous.</p>



<p>Nous allons voir les différentes étapes pour la mise en place de cette authentification pour un espace d&rsquo;administration  placé dans un dossier.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img fetchpriority="high" decoding="async" width="451" height="252" src="//i1.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/05/image-8.png" alt="" class="wp-image-1015" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/05/image-8.png?w=451&amp;ssl=1 451w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/05/image-8.png?resize=300%2C168&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/05/image-8.png?resize=150%2C84&amp;ssl=1 150w" sizes="(max-width: 451px) 100vw, 451px" /></figure></div>



<p>Cet article est destiné aux utilisateurs du serveur Apache pour voir son installation, je t&rsquo;invite à suivre <a href="https://programmation.surleweb-france.fr/installer-serveur-web-complet/" target="_blank" rel="noreferrer noopener">cet article</a>.</p>



<p>L&rsquo;ensemble des fichiers pour cet article sont disponible sur mon dépôt <a href="https://github.com/zigomato/ArticleApache/tree/main/SecuriserAvecApache" target="_blank" rel="noreferrer noopener">GITHUB</a>.</p>



<h2 class="wp-block-heading">L&rsquo;architecture</h2>



<p>Pour cet article, nous allons simplement (dans notre dossier du site), un fichier<strong><em> index.php</em></strong> qui sera l&rsquo;accueil de notre site et un dossier <strong><em>admin </em></strong>qui contiendra lui aussi un fichier <strong><em>index.php</em></strong>. C&rsquo;est ce dossier que tu protègeras.</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img decoding="async" src="//i2.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/05/image-9.png" alt="" class="wp-image-1016" width="273" height="131"/></figure></div>



<p>Les fichiers sont directement accessible sur mon dépôt <a href="https://github.com/zigomato/ArticleApache/tree/main/SecuriserAvecApache" target="_blank" rel="noreferrer noopener">GITHUB</a>.</p>



<h2 class="wp-block-heading">Préparation des informations</h2>



<p>Nous allons avoir besoin de récupérer le chemin absolu du dossier à protéger (« <strong><em>admin</em></strong>« ) ainsi qu&rsquo;un mot de passe crypté, pour cela, nous allons créer dans le dossier <strong><em>admin</em></strong>, un fichier php qui nous  permettra de tout récupérer :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="php" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">&lt;?php
echo 'Chemin du dossier a securiser : &lt;strong>'.__DIR__.'&lt;/strong>&lt;br />';

$username = 'username';
$password = 'mot_de_passe';
$encryptedPassword = crypt($password,base64_encode($password));

echo 'Phrase a recopier :&lt;br />';
echo '&lt;strong>'.$username.':'.$encryptedPassword.'&lt;/strong>';

?></pre>



<h2 class="wp-block-heading">Création du fichier .htaccess</h2>



<p>A présent, tu vas créer ton ficher <strong><em>.htaccess</em></strong>. Ce fichier est à placer dans le dossier <strong><em>admin</em></strong>.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Attention, il s&rsquo;agit bien d&rsquo;un fichier sans nom disposant seulement du point suivi de l&rsquo;extension.</p></blockquote>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">AuthName "Section administration"
AuthType Basic
AuthUserFile "MON_CHEMIN_ABSOLU\.htpasswd"
Require valid-user
</pre>



<p>Penses à remplacer MON_CHEMIN_ABSOLU par ce que le fichier précédent t&rsquo;a fourni.</p>



<h2 class="wp-block-heading">Création du fichier .htpasswd</h2>



<p>Il n&rsquo;y a aucun obligation que ce fichier se nomme ainsi, d&rsquo;ailleurs, <strong>il est préférable de changer son nom</strong>.</p>



<p>Comme pour le fichier .<em><strong>htaccess</strong></em>, il s&rsquo;agit d&rsquo;un fichier sans nom mais juste d&rsquo;une extension. </p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">username:pwd_a_remplacer</pre>



<p><strong><em>pwd_a_remplacer</em></strong> doit être remplacé par le mot de passe générer.</p>



<p>Il peut y avoir plusieurs utilisateurs.</p>



<h2 class="wp-block-heading">Tester la protection</h2>



<p>Maintenant, rends-toi sur l&rsquo;adresse <strong><em>ton-site.fr/admin/index.php</em></strong>, tu auras le droit à la fenêtre de connexion.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>Voici comment mettre en place rapidement une zone sécurisée sur ton site.</p>
<p>L’article <a href="https://programmation.surleweb-france.fr/apache-securiser-un-dossier-avec-htaccess/">Apache, sécuriser un dossier avec .htaccess</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programmation.surleweb-france.fr/apache-securiser-un-dossier-avec-htaccess/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1014</post-id>	</item>
	</channel>
</rss>
