<?xml version="1.0" encoding="UTF-8" ?>
<!-- RSS generated by PHPBoost on Wed, 29 Apr 2026 05:39:37 +0200 -->
<rss version="2.0" xmlns:atom="https://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Wiki Les geekeries de rungis]]></title>
		<atom:link href="https://geekrungis.fr/syndication/rss/wiki/3" rel="self" type="application/rss+xml"/>
		<link>https://geekrungis.fr</link>
		<description><![CDATA[Derniers articles de la catégorie Serveurs web]]></description>
		<copyright>(C) 2005-2026 PHPBoost</copyright>
		<language>fr</language>
		<generator>PHPBoost</generator>
		
            <item>
                <title><![CDATA[Downgrader php sur Debian 12]]></title>
                <link>https://geekrungis.fr/wiki/downgrader-php-sur-debian-12</link>
                <guid>https://geekrungis.fr/wiki/downgrader-php-sur-debian-12</guid>
                <description><![CDATA[<p style="text-align: center;"><img src="https://geekrungis.fr/upload/php.webp" alt="php" /></p><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-intoduction">Intoduction</h2><br />

<br />
Article rapide sur comment revenir en arrière sur une version de php.<br />
J'ai mis à jour le serveur qui héberge le site web que vous consultez actuellement vers Debian 12 depuis Debian 11. Debian 12 fournit php en version 8.2 sauf qu'à l'heure où j'écris cet article (le 29/10/2023), phpboost qui propulse ce même site web ne supporte php que jusqu'à la version 8.1 d'où la nécessité d'un downgrade.<br />
<br />
<span class="message-helper bgc notice">Toutes les commandes ci-dessous sont à faire avec sudo ou en root</span><br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-dsinstallerphp8.2">Désinstaller php8.2</h2><br />

<br />
Tout d'abord, vous devez vérifier quels compléments à php sont installés sur votre système, pour cela :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
apt list <span style="color: #660033;">-i</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> php
&nbsp;</pre></pre></div></div><br />
<br />
Notez tous les paquets installés dans un coin puis désinstallez-les :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
apt remove php<span style="color: #000000; font-weight: bold;">*</span>
&nbsp;</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-ajouterledpitsury">Ajouter le dépôt sury</h2><br />

<br />
Il s'agit d'un dépôt avec lequel vous pourrez installer n'importe quelle version de php.<br />
<br />
On ajoute le dépôt et la clé :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
apt <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">-y</span> apt-transport-https lsb-release ca-certificates <span style="color: #c20cb9; font-weight: bold;">wget</span> 
<span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-O</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>trusted.gpg.d<span style="color: #000000; font-weight: bold;">/</span>php.gpg https:<span style="color: #000000; font-weight: bold;">//</span>packages.sury.org<span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span>apt.gpg
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"deb https://packages.sury.org/php/ <span style="color: #007800;">$(lsb_release -sc)</span> main"</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tee</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>sources.list.d<span style="color: #000000; font-weight: bold;">/</span>php.list
&nbsp;</pre></pre></div></div><br />
<br />
Puis on met à jour le cache d'apt :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
apt update
&nbsp;</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-installation-de-php-8-1">Installation de php 8.1</h2><br />

<br />
On peut ensuite installer la version de php que l'on souhaite :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
apt <span style="color: #c20cb9; font-weight: bold;">install</span> php8.1 php8.1-<span style="color: #7a0874; font-weight: bold;">&#123;</span>cli,common,curl,gd,intl,mbstring,mysql,opcache,readline,xml,<span style="color: #c20cb9; font-weight: bold;">zip</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> libapache2-mod-php8.1
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper bgc notice">les accolades permettent d'éviter de retaper php8.1- pour chaque paquet. Il faut adapter la liste en fonction de ce que vous aviez noter précédemment</span><br />
<br />
<span class="message-helper bgc success"><br />
Avec cette méthode, en ayant spécifier la version dans le nom des paquets, il n'y aura pas d'upgrade de version de php par inadvertance.<br />
</span><br />]]></description>
                <pubDate>Sun, 29 Oct 2023 22:26:45 +0100</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Installation d'un certificat Let's Encrypt sur son serveur nginx]]></title>
                <link>https://geekrungis.fr/wiki/installation-d-un-certificat-let-s-encrypt-sur-son-serveur-nginx</link>
                <guid>https://geekrungis.fr/wiki/installation-d-un-certificat-let-s-encrypt-sur-son-serveur-nginx</guid>
                <description><![CDATA[<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-introduction">Introduction</h2><br />

<br />
Comme décrit dans un article précédent, j'utilise un serveur nginx pour faire du reverse proxy. Je vais vous présenter ici comment mettre en place un certificat auto-signé Let's Encrypt sur ce serveur.<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-etapes-preliminaires">Etapes préliminaires</h2><br />

<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-parametrage-de-sa-box">Paramétrage de sa box</h3><br />

<br />
En premier lieu, il est nécessaire de rediriger les ports 80 et 443 de sa box vers le serveur web nginx. Je vous met ici pour exemple à quoi cela ressemble sur ma box SFR (les lignes 1 et 3 correspondent aux redirections en question).<br />
<br />
<img src="https://geekrungis.fr/upload/screenshot_ports_sfr_box.png" alt="screenshot_ports_sfr_box" title="screenshot_ports_sfr_box" /><br />
<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-desactivation-des-redirections">Désactivation des redirections</h3><br />

<br />
Afin de s'assurer de ne pas rediriger les requêtes en http vers https automatiquement (nous verrons cela par la suite), il est nécessaire de désactiver les sites activés. Plusieurs solutions sont possibles, je vous en propose une :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>sites-enabled
&nbsp;</pre></pre></div></div><br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-type</span> l <span style="color: #660033;">-exec</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>.tmp \;
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper success">Les fichiers de conf seront renommés en .tmp et ne seront donc plus pris en compte par nginx</span><br />
<br />
Ajouter une ligne dans le fichier suivant :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">vim</span>  <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nginx<span style="color: #000000; font-weight: bold;">/</span>proxy_params
&nbsp;</pre></pre></div></div><br />
<br />
Ajouter la ligne :<br />
<br />
<div class="formatter-container formatter-code code-TEXT"><span class="formatter-title">Code TEXT : </span><div class="formatter-content"><pre style="display:inline;"><pre class="text" style="font-family:monospace;">&nbsp;
proxy_redirect          off;
&nbsp;</pre></pre></div></div><br />
<br />
On redémarre le serveur web pour prendre en compte les paramétrages :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
nginx <span style="color: #660033;">-s</span> reload
&nbsp;</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-installation-du-certificat">Installation du certificat</h2><br />

<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-creation-du-certificat">Création du certificat</h3><br />

<br />
Installer certbot :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> apt <span style="color: #c20cb9; font-weight: bold;">install</span> certbot
&nbsp;</pre></pre></div></div><br />
<br />
Exécuter certbot :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
certbot certonly <span style="color: #660033;">-d</span> jeedom.mondomaine.fr,plex.mondomaine.fr,nas.mondomaine.fr
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper warning"><br />
L'option -d permet de spécifier le ou les domaines séparés par des virgules<br />
</span><br />
<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-reconfiguration-du-serveur-web">Reconfiguration du serveur web</h3><br />

Une fois le certificat installé, on remet en place les fichiers de configuration. On peut le faire avec la commande suivante ou manuellement si on a peu de fichiers de configuration :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-name</span> <span style="color: #ff0000;">"*.tmp"</span> <span style="color: #660033;">-exec</span> <span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'mv "$1" "${1%.tmp}"'</span> _ <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> \;
&nbsp;</pre></pre></div></div><br />
<br />
Recharger le serveur web :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
nginx <span style="color: #660033;">-s</span> reload
&nbsp;</pre></pre></div></div><br />
<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-pour-ajouter-un-domaine-ou-un-sous-domaine">Pour ajouter un domaine ou un sous-domaine</h3><br />

<br />
Si vous souhaitez ajouter un domaine ou un sous-domaine à votre certificat, c'est possible avec la commande suivante :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
certbot certonly <span style="color: #660033;">--expand</span> <span style="color: #660033;">-d</span> jeedom.mondomaine.fr,nas.mondomaine.fr,plex.mondomaine.fr,nextcloud.mondomaine.fr
&nbsp;</pre></pre></div></div><br />
<br />
<span class="message-helper notice"><br />
Il est nécessaire dans la commande de remettre les domaines et sous-domaines déjà certifiés<br />
</span><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-renouveller-le-certificat">Renouveller le certificat</h2><br />

<br />
Les certificats Let's Encrypt sont gratuits mais leur inconvénient est qu'ils ne sont valables que 3 mois, il faut donc les renouveler. Si vous avez entré votre adresse mail lors de la création du certificat, vous recevrez plusieurs mails dans les semaines qui précèdent leur expiration.<br />
<br />
Pour renouveler le certificat :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
certbot renew <span style="color: #660033;">--pre-hook</span> <span style="color: #ff0000;">"service nginx stop"</span> <span style="color: #660033;">--post-hook</span> <span style="color: #ff0000;">"service nginx start"</span>
&nbsp;</pre></pre></div></div><br />
<br />
Il est possible d'automatiser cette tâche avec cron, je vous renvoi vers des articles qui traitent de cron. Cependant, je vous recommande de tester une fois ou deux le renouvellement manuel afin de vérifier que cela fonctionne.<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-obtenir-des-informations-sur-les-certificats-installes">Obtenir des informations sur les certificats installés</h2><br />

<br />
Il est possible d'obtenir des informations sur le certificat installé (noms de domaines et sous-domaines, date de validité,...) :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
certbot certificates
&nbsp;</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-conclusion">Conclusion</h2><br />

<br />
Vous pouvez trouver d'avantages d'information sur la commande certbot et toutes ses options (elles sont nombreuses) : <a href="https://certbot.eff.org/docs/using.html">User Guide - Certbot</a>]]></description>
                <pubDate>Thu, 13 Jul 2023 13:33:33 +0200</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Réécriture d'URL sous Apache]]></title>
                <link>https://geekrungis.fr/wiki/reecriture-d-url-sous-apache</link>
                <guid>https://geekrungis.fr/wiki/reecriture-d-url-sous-apache</guid>
                <description><![CDATA[<img src="https://geekrungis.fr/upload/apache-server-logo.png" alt="apache-server-logo" title="apache-server-logo" /><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-introduction">Introduction</h2><br />

<br />
Encore un problème simple à résoudre mais qui m'a demandé beaucoup de temps. Sur ce site que vous consultez actuellement, j'utilise la réécriture d'URL. Je ne m'étendrai pas sur le sujet, si vous êtes ici c'est que vous savez de quoi je parle mais que cela ne fonctionne pas chez vous.<br />
<br />
Je ne vais pas détailler ici comment créer des règles de réécriture, le CMS que j'utilise (PhpBoost) le fait automatiquement mais la configuration de base du serveur Apache pour que cela fonctionne.<br />
<br />
<span class="message-helper warning">Faites attention à l'hébergement de votre site web, dans mon cas il est auto-hébergé donc pas de problème mais certains hébergeurs ne permettent pas la réécriture d'URL, renseignez-vous auprès de votre hébergeur</span><br />
<br />
En partant du principe que votre hébergement permet de faire de la réécriture d'URL, voici les quelques paramétrages à mettre en place.<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-activation-de-mod_rewrite">Activation de mod_rewrite</h2><br />

<br />
Pour activer mod_rewrite sur un serveur Apache, une simple commande :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">a2enmod rewrite</pre></pre></div></div><br />
<br />
Si la réponse à la commande est que a2enmod n'est pas installé, installez locate :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">apt <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">locate</span></pre></pre></div></div><br />
<br />
Puis recherchez la commande a2enmod :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">locate</span> a2enmod</pre></pre></div></div><br />
<br />
La réponse vous donnera la localisation, par exemple : <div class="formatter-container formatter-blockquote"><span class="formatter-title">Citation :</span><div class="formatter-content">/usr/sbin/a2enmod</div></div><br />
<br />
Vous pourrez alors taper la commande suivante (à adapter en fonction de la réponse précédente) :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>a2enmod rewrite</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-la-petite-astuce-qui-m-a-demande-tant-de-recherches">La petite astuce qui m'a demandé tant de recherches...</h2><br />

<br />
Malgré cette activation, cela ne fonctionnait toujours pas chez moi, ce qu'il manquait, c'est une toute petite modification dans la configuration d'Apache. Ouvrez le fichier /etc/apache2/apache2.conf et cherchez le bloc correspondant à la localisation de votre site web, généralement celui-ci :<br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #8000FF;"><</span>Directory <span style="color: #8000FF;">/</span><span style="color: #0000FF; font-weight: bold;">var</span><span style="color: #8000FF;">/</span>www<span style="color: #8000FF;">/></span>
        Options Indexes FollowSymLinks
        AllowOverride None
        <span style="color: #0000FF; font-weight: bold;">Require</span> all granted
<span style="color: #8000FF;"></</span>Directory<span style="color: #8000FF;">></span>
&nbsp;</pre></pre></div></div><br />
<br />
Remplacez "None" par "All" puis redémarrez le serveur Apache :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">systemctl restart apache2.service</pre></pre></div></div><br />
<br />
Et voilà, le problème est normalement réglé.<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-verifier-que-la-reecriture-fonctionne">Vérifier que la réécriture fonctionne</h2><br />

<br />
Créez un répertoire nommé "test" que vous placerez à la racine de votre site (il sera donc accessible via l'adresse <a href="http://www.votre-site.com/test/).<br">http://www.votre-site.com/test/).<br</a> />
Dans ce répertoire, créez un fichier HTML nommé test.html (<a href="http://www.votre-site.com/test/test.html">http://www.votre-site.com/test/test.html</a>) contenant uniquement les lignes suivantes :<br />
<br />
<div class="formatter-container formatter-code code-HTML"><span class="formatter-title">Code HTML : </span><div class="formatter-content"><pre style="display:inline;"><pre class="html" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><<a href="https://www.w3schools.com/tags/tag_html.asp"><span style="color: #000000; font-weight: bold;">html</span></a>><<a href="https://www.w3schools.com/tags/tag_head.asp"><span style="color: #000000; font-weight: bold;">head</span></a>><<a href="https://www.w3schools.com/tags/tag_title.asp"><span style="color: #000000; font-weight: bold;">title</span></a>></span>Test<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_title.asp"><span style="color: #000000; font-weight: bold;">title</span></a>><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_head.asp"><span style="color: #000000; font-weight: bold;">head</span></a>><<a href="https://www.w3schools.com/tags/tag_body.asp"><span style="color: #000000; font-weight: bold;">body</span></a>></span>OK !<span style="color: #009900;"><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_body.asp"><span style="color: #000000; font-weight: bold;">body</span></a>><<span style="color: #66cc66;">/</span><a href="https://www.w3schools.com/tags/tag_html.asp"><span style="color: #000000; font-weight: bold;">html</span></a>></span></pre></pre></div></div><br />
<br />
Vous pouvez vous rendre sur cette page avec votre navigateur pour vérifier (http://www.votre-site.com/test/), vous devriez avoir une page avec "OK !"<br />
<br />
Dans ce répertoire, créez un fichier nommé .htaccess contenant les lignes suivantes :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">&nbsp;
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^inconnu\.html$  <span style="color: #000000; font-weight: bold;">/</span>test<span style="color: #000000; font-weight: bold;">/</span>test.html <span style="color: #7a0874; font-weight: bold;">&#91;</span>L<span style="color: #7a0874; font-weight: bold;">&#93;</span>
&nbsp;</pre></pre></div></div><br />
<br />
Transférez ce répertoire et ces deux fichiers sur votre site, puis rendez-vous à l'adresse <a href="http://www.votre-site.com/test/inconnu.html">http://www.votre-site.com/test/inconnu.html</a><br />
<br />
Vous devriez normalement avoir le même résultat que précédemment.<br />
<br />
Et voilà !  <img src="https://geekrungis.fr/images/smileys/top.png" alt=":top" title=":top" class="smiley" /><br />
<br />]]></description>
                <pubDate>Fri, 31 Dec 2021 18:08:58 +0100</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Installation de piwigo]]></title>
                <link>https://geekrungis.fr/wiki/installation-de-piwigo</link>
                <guid>https://geekrungis.fr/wiki/installation-de-piwigo</guid>
                <description><![CDATA[<p style="text-align: center;"><img src="https://geekrungis.fr/upload/piwigo.png" alt="piwigo" title="piwigo" /></p><br />
<br />
Dans cet article, je vais vous expliquer comment installer Piwigo !<br />
Comme d'habitude, je vais utiliser mon hyperviseur Proxmox, j'utilise un conteneur Debian.<br />
<br />
Mais d'abord...<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-qu-est-ce-que-piwigo-e">Qu'est-ce que Piwigo ?</h2><br />

<br />
Piwigo est selon son site web "une photothèque open source en ligne qui permet de gérer, organiser, partager ses photos sur le web"<br />
Vous pouvez héberger Piwigo chez un hébergeur ou chez vous comme je le fais.<br />
<br />
Plus d'infos sur <a href="https://fr.piwigo.org">le site web de Piwigo</a><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-installation-des-pre-requis">Installation des pré-requis</h2><br />

<br />
Tout d'abord, il est nécessaire d'installer tout ce qu'il faut pour un serveur web ainsi qu'une base de données. On se connecte à son serveur (en ssh ou directement via l'interface si on est sur proxmox). Puis on installe le nécessaire (comme à mon habitude, je me connecte en root donc pas besoin de sudo :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">apt <span style="color: #c20cb9; font-weight: bold;">install</span> apache2 php mariadb-server imagemagick <span style="color: #c20cb9; font-weight: bold;">ffmpeg</span> poppler-utils <span style="color: #c20cb9; font-weight: bold;">unzip</span> <span style="color: #c20cb9; font-weight: bold;">gzip</span> <span style="color: #c20cb9; font-weight: bold;">make</span> php-<span style="color: #7a0874; font-weight: bold;">&#123;</span>curl,gd,intl,xml,<span style="color: #c20cb9; font-weight: bold;">zip</span>,mbstring,json,mysql<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></pre></div></div><br />
<br />
Il faut également installer ExifTool :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> https:<span style="color: #000000; font-weight: bold;">//</span>exiftool.org<span style="color: #000000; font-weight: bold;">/</span>Image-ExifTool-<span style="color: #000000;">12.38</span>.tar.gz
<span style="color: #c20cb9; font-weight: bold;">gzip</span> <span style="color: #660033;">-dc</span> Image-ExifTool-<span style="color: #000000;">12.38</span>.tar.gz <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xf</span> -
<span style="color: #7a0874; font-weight: bold;">cd</span> Image-ExifTool-<span style="color: #000000;">12.38</span>
<span style="color: #c20cb9; font-weight: bold;">perl</span> Makefile.PL
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #7a0874; font-weight: bold;">test</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></pre></div></div><br />
<br />
<span class="message-helper notice">Pensez à aller sur le <a href="https://exiftool.org/">site d'ExifTool</a> pour vérifier le numéro de la dernière version et adapter dans les commandes</span><br />
<br />
Il faut ensuite vérifier que son serveur web et son serveur de base de données fonctionnent. De mon côté, je vais vous présenter la résolution de deux problèmes que j'ai eus.<br />
<br />
Pour le serveur web :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">systemctl status apache2.service</pre></pre></div></div><br />
<br />
Si comme moi, vous avez l'erreur suivante :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">apache2.service: Failed to <span style="color: #000000; font-weight: bold;">set</span> up <span style="color: #c20cb9; font-weight: bold;">mount</span> namespacing</pre></pre></div></div><br />
<br />
Cela se résoud avec les commandes suivantes :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s,PrivateTmp=true,PrivateTmp=false\nNoNewPrivileges=yes,g'</span> <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>systemd<span style="color: #000000; font-weight: bold;">/</span>system<span style="color: #000000; font-weight: bold;">/</span>apache2.service
systemctl daemon-reload
systemctl start apache2.service</pre></pre></div></div><br />
<br />
Pour le serveur de base de données :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">systemctl status mysql.service</pre></pre></div></div><br />
<br />
Si comme moi, vous avez l'erreur suivante :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">mysql.service: Failed to <span style="color: #000000; font-weight: bold;">set</span> up <span style="color: #c20cb9; font-weight: bold;">mount</span> namespacing</pre></pre></div></div><br />
<br />
Cela se résoud avec les commandes suivantes :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s,ProtectHome=true,ProtectHome=flase,g'</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s,ProtectSystem=true,ProtectSystem=flase,g'</span> <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>systemd<span style="color: #000000; font-weight: bold;">/</span>system<span style="color: #000000; font-weight: bold;">/</span>apache2.service
systemctl daemon-reload
systemctl start apache2.service</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-parametrage-de-la-base-de-donnees">Paramétrage de la base de données</h2><br />

<br />
Piwigo s'appuie sur une base de données, d'où l'installation de maria-db.<br />
Pour configurer celle-ci, on va d'abord attribuer un mot de passe à root dans mysql :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">mysql_secure_installation</pre></pre></div></div><br />
<br />
Appuyer sur Entrée une première fois puis répondre YES à toutes les questions.<br />
<br />
Se connecter ensuite à la base de données :<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">mysql <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span></pre></pre></div></div><br />
<br />
Une fois dans la base de données, on va créé un utilisateur :<br />
<div class="formatter-container formatter-code code-SQL"><span class="formatter-title">Code SQL : </span><div class="formatter-content"><pre style="display:inline;"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">USE</span> mysql;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">USER</span> <span style="color: #ff0000;">'login'</span> <span style="color: #993333; font-weight: bold;">IDENTIFIED</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">'password'</span>;</pre></pre></div></div><br />
<br />
<span class="message-helper notice">login est le nom du nouvel utilisateur et password le mot de passe que vous souhaitez lui attribuer</span><br />
<br />
On lui donne les privilèges qui vont bien :<br />
<div class="formatter-container formatter-code code-SQL"><span class="formatter-title">Code SQL : </span><div class="formatter-content"><pre style="display:inline;"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">GRANT</span> <span style="color: #993333; font-weight: bold;">ALL</span> PRIVILEGES <span style="color: #993333; font-weight: bold;">ON</span> <span style="color: #66cc66;">*</span> <span style="color: #66cc66;">.</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">TO</span> <span style="color: #ff0000;">'login'</span>;
<span style="color: #993333; font-weight: bold;">FLUSH</span> PRIVILEGES;</pre></pre></div></div><br />
<br />
On peut ensuite quitter mysql et se reconnecter avec notre nouvel utilisateur :<br />
<div class="formatter-container formatter-code code-SQL"><span class="formatter-title">Code SQL : </span><div class="formatter-content"><pre style="display:inline;"><pre class="sql" style="font-family:monospace;">EXIT;</pre></pre></div></div><br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;">mysql <span style="color: #660033;">-u</span> <span style="color: #c20cb9; font-weight: bold;">login</span> <span style="color: #660033;">-p</span></pre></pre></div></div><br />
<br />
On créé ensuite une nouvelle base de données pour piwigo :<br />
<div class="formatter-container formatter-code code-SQL"><span class="formatter-title">Code SQL : </span><div class="formatter-content"><pre style="display:inline;"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> piwigo;</pre></pre></div></div><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-installation-de-piwigo">Installation de Piwigo</h2><br />

<br />
On peut ensuite passer à l'installation de Piwigo. Pour cela, il faut télécharger la dernière version et copier les fichiers sur le serveur web :<br />
<br />
<div class="formatter-container formatter-code code-BASH"><span class="formatter-title">Code BASH : </span><div class="formatter-content"><pre style="display:inline;"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-O</span> piwigo.zip https:<span style="color: #000000; font-weight: bold;">//</span>fr.piwigo.org<span style="color: #000000; font-weight: bold;">/</span>download<span style="color: #000000; font-weight: bold;">/</span>dlcounter.php?<span style="color: #007800;">code</span>=latest
<span style="color: #c20cb9; font-weight: bold;">unzip</span> piwigo.zip <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html<span style="color: #000000; font-weight: bold;">/</span></pre></pre></div></div><br />
<br />
Il suffit ensuite de se rendre sur son serveur web : http://[IP_DU_SERVEUR_WEB] et on arrive sur la page d'installation.<br />
<br />
<img src="https://geekrungis.fr/upload/page_installation_piwigo.png" alt="page_installation_piwigo" title="page_installation_piwigo" /><br />
<br />
Remplir les informations et cliquer sur Démarrer l'installation, l'installation dure à peine quelque secondes.<br />
<br />
<span class="message-helper notice">Dans le premier bloc, Utilisateur et Mot de passe correspondent à ceux de l'utilisateur créé sur mysql<br />
Le nom de la base de donnée correspond au nom que vous avez donner à votre base de données dans la commande CREATE DATABASE<br />
Pour le reste, à vous de mettre ce que vous souhaitez</span><br />]]></description>
                <pubDate>Wed, 29 Dec 2021 19:08:50 +0100</pubDate>
                
            </item>
		
            <item>
                <title><![CDATA[Serveurs web]]></title>
                <link>https://geekrungis.fr/wiki/serveurs-web</link>
                <guid>https://geekrungis.fr/wiki/serveurs-web</guid>
                <description><![CDATA[Quelques tutos sur les serveurs web Apache ou Nginx]]></description>
                <pubDate>Fri, 12 Feb 2021 10:41:39 +0100</pubDate>
                
            </item>
		
	</channel>
</rss>
