{"id":2214,"date":"2024-08-31T21:44:09","date_gmt":"2024-08-31T20:44:09","guid":{"rendered":"https:\/\/ve2cuy.com\/420-3c3\/?page_id=2214"},"modified":"2024-09-12T18:27:15","modified_gmt":"2024-09-12T17:27:15","slug":"apache2-mise-en-route","status":"publish","type":"page","link":"https:\/\/ve2cuy.com\/420-3c3\/?page_id=2214","title":{"rendered":"Apache2 &#8211; Mise en route"},"content":{"rendered":"\n<h2 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">1. Contenu<\/h2>\n\n\n<div class=\"wp-block-image p20\">\n<figure class=\"alignleft size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" width=\"450\" height=\"599\" src=\"https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/08\/Apache_Logo.png\" alt=\"\" class=\"wp-image-2250\" style=\"aspect-ratio:0.5659432387312187;width:108px;height:auto\" srcset=\"https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/08\/Apache_Logo.png 450w, https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/08\/Apache_Logo-225x300.png 225w\" sizes=\"(max-width: 450px) 100vw, 450px\" \/><\/figure><\/div>\n\n\n<ul>\n<li><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\"><strong>Installation<\/strong><\/mark><\/li>\n\n\n\n<li><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-cyan-bluish-gray-color\"><strong>Dossiers<\/strong><\/mark> : <a href=\"#\">\/var\/www<\/a>, <a href=\"#\">\/etc\/apache2<\/a><\/li>\n\n\n\n<li><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\"><strong>Configuration<\/strong><\/mark> : <strong>Globale<\/strong> &#8211;  <a href=\"#\">apache2.conf<\/a>, <strong>Locale<\/strong> &#8211; sites-available, <a href=\"#\">.htaccess<\/a><\/li>\n\n\n\n<li><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\"><strong>Droits d&rsquo;acc\u00e8s<\/strong><\/mark> : Require, not, ip, All, &#8230; <\/li>\n\n\n\n<li><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"><strong>Directives<\/strong><\/mark> : RequireAll, RequireAny, Files, &#8230; <\/li>\n\n\n\n<li><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\"><strong>H\u00f4tes virtuels<\/strong><\/mark><\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\"><strong>NOTE<\/strong><\/mark>: Les exemples de ce document utilisent la syntaxe de la <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\"><strong>version 2.4<\/strong><\/mark> d&rsquo;Apache2<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">2. Apache2<\/h2>\n\n\n\n<p><a href=\"https:\/\/httpd.apache.org\/docs\/current\/\">Apache2<\/a> est un serveur web open-source largement reconnu, d\u00e9velopp\u00e9 par la <a href=\"https:\/\/www.apache.org\">Fondation Apache<\/a>. Il constitue un pilier essentiel de l&rsquo;infrastructure Internet, permettant l&rsquo;h\u00e9bergement et la diffusion de contenus via les protocoles <a href=\"https:\/\/fr.wikipedia.org\/wiki\/Hypertext_Transfer_Protocol\">HTTP<\/a> et <a href=\"https:\/\/fr.wikipedia.org\/wiki\/Hypertext_Transfer_Protocol_Secure\">HTTPS<\/a>. <\/p>\n\n\n\n<p>Sa popularit\u00e9 r\u00e9side dans sa flexibilit\u00e9 et son extensibilit\u00e9, gr\u00e2ce \u00e0 une architecture modulaire qui permet l&rsquo;int\u00e9gration de diverses fonctionnalit\u00e9s suppl\u00e9mentaires, telles que la gestion des scripts PHP, le chiffrement via SSL\/TLS, et bien d&rsquo;autres. <\/p>\n\n\n\n<p>En outre, Apache2 est compatible avec une large gamme de syst\u00e8mes d&rsquo;exploitation, y compris <a href=\"#\">Linux<\/a>, <a href=\"#\">Windows<\/a>, et <a href=\"#\">macOS<\/a>, ce qui en fait une solution versatile et robuste pour un large \u00e9ventail de d\u00e9ploiements web.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">3. Alternative<\/h2>\n\n\n\n<p>Il existe plusieurs alternatives \u00e0 Apache2 pour servir des sites web, chacune ayant ses propres caract\u00e9ristiques et avantages selon les besoins sp\u00e9cifiques. Parmi les plus courantes, on peut citer :<\/p>\n\n\n\n<ol>\n<li><strong><a href=\"https:\/\/nginx.org\">Nginx<\/a><\/strong> : Connu pour sa performance et son efficacit\u00e9, Nginx est souvent pr\u00e9f\u00e9r\u00e9 pour les sites \u00e0 fort trafic. Il est particuli\u00e8rement efficace pour g\u00e9rer les connexions concurrentes gr\u00e2ce \u00e0 son architecture \u00e9v\u00e9nementielle, ce qui en fait un excellent choix pour les applications n\u00e9cessitant une grande \u00e9chelle.<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/www.lighttpd.net\">Lighttpd<\/a><\/strong> : Un serveur web l\u00e9ger con\u00e7u pour \u00eatre rapide tout en consommant peu de ressources. Il est souvent utilis\u00e9 dans des environnements \u00e0 ressources limit\u00e9es ou pour des projets o\u00f9 la simplicit\u00e9 et l&rsquo;efficacit\u00e9 sont prioritaires.<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/www.iis.net\">Microsoft IIS<\/a> (Internet Information Services)<\/strong> : Un serveur web d\u00e9velopp\u00e9 par Microsoft, principalement utilis\u00e9 sur les serveurs Windows. Il offre une int\u00e9gration pouss\u00e9e avec l&rsquo;\u00e9cosyst\u00e8me Microsoft, ce qui le rend id\u00e9al pour les entreprises utilisant des technologies Microsoft.<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/caddyserver.com\">Caddy<\/a><\/strong> : Un serveur web moderne et facile \u00e0 configurer, particuli\u00e8rement appr\u00e9ci\u00e9 pour sa gestion automatique des certificats SSL\/TLS et son approche orient\u00e9e vers la s\u00e9curit\u00e9.<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/www.litespeedtech.com\">Litespeed<\/a><\/strong> : Un serveur web commercial compatible avec Apache2, connu pour sa performance \u00e9lev\u00e9e, notamment dans l&rsquo;h\u00e9bergement partag\u00e9. Il offre des fonctionnalit\u00e9s avanc\u00e9es comme l&rsquo;optimisation de la mise en cache et la compatibilit\u00e9 avec les directives Apache.<\/li>\n<\/ol>\n\n\n\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">4. Pr\u00e9-requis<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" width=\"624\" height=\"329\" src=\"https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/08\/docker-multi-services.png\" alt=\"\" class=\"wp-image-2260\" style=\"aspect-ratio:1.8966565349544073;width:392px;height:auto\" srcset=\"https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/08\/docker-multi-services.png 624w, https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/08\/docker-multi-services-300x158.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/figure><\/div>\n\n\n<p>Avoir acc\u00e8s \u00e0 un serveur Ubuntu \u00e0 jour. <\/p>\n\n\n\n<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=\"\">sudo apt update &amp;&amp; sudo apt upgrade -y<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">5. Installation d&rsquo;apache2<\/h2>\n\n\n\n<p>\u00c0 partir d&rsquo;un serveur Ubuntu;<\/p>\n\n\n\n<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=\"\">sudo apt installer apache2 -y\n\n# NOTE:  Voici comment v\u00e9rifier les versions disponibles sur les d\u00e9p\u00f4ts:\n\n$ apt-cache policy apache2\n\napache2:\n  Installed: 2.4.58-1ubuntu8.4\n  Candidate: 2.4.58-1ubuntu8.4\n  Version table:\n *** 2.4.58-1ubuntu8.4 500\n        500 http:\/\/ca.archive.ubuntu.com\/ubuntu noble-updates\/main amd64 Packages\n        500 http:\/\/security.ubuntu.com\/ubuntu noble-security\/main amd64 Packages\n        100 \/var\/lib\/dpkg\/status\n     2.4.58-1ubuntu8 500\n        500 http:\/\/ca.archive.ubuntu.com\/ubuntu noble\/main amd64 Packages\n\n# Et installer une version sp\u00e9cifique:\n\n$ sudo apt install apache2=2.4.58-1ubuntu8.4<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">6. V\u00e9rifier le fonctionnement d&rsquo;apache2<\/h2>\n\n\n\n<p>Dans un fureteur, inscrire l&rsquo;adresse IP du serveur Ubuntu.<\/p>\n\n\n\n<p>Par exemple,<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" width=\"849\" height=\"808\" src=\"https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/08\/Capture-decran-le-2024-08-31-a-18.45.00.png\" alt=\"\" class=\"wp-image-2265\" style=\"aspect-ratio:1.0507425742574257;width:607px;height:auto\" srcset=\"https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/08\/Capture-decran-le-2024-08-31-a-18.45.00.png 849w, https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/08\/Capture-decran-le-2024-08-31-a-18.45.00-300x286.png 300w, https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/08\/Capture-decran-le-2024-08-31-a-18.45.00-768x731.png 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/figure><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">7. Le dossier \/var\/www<\/h2>\n\n\n\n<p><strong>Emplacement des Fichiers Web<\/strong>&nbsp;: <\/p>\n\n\n\n<p>Le r\u00e9pertoire&nbsp;<code>\/var\/www<\/code>&nbsp;est g\u00e9n\u00e9ralement utilis\u00e9 comme l&#8217;emplacement par d\u00e9faut pour stocker les fichiers web d&rsquo;un serveur Apache2. C&rsquo;est l\u00e0 que sont plac\u00e9s les fichiers HTML, CSS, JavaScript, les images, et autres ressources n\u00e9cessaires pour servir les pages web aux clients.<\/p>\n\n\n\n<p><strong>Structure Typique<\/strong>&nbsp;:<\/p>\n\n\n\n<ul>\n<li><strong><code>\/var\/www\/html<\/code><\/strong>\u00a0: C&rsquo;est le r\u00e9pertoire du premier site Web d&rsquo;Apache2.  Ce dossier est le r\u00e9pertoire racine du site web par d\u00e9faut.<\/li>\n\n\n\n<li><strong>Autres Sous-R\u00e9pertoires<\/strong>\u00a0: Sous <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\/var\/www<\/mark><\/strong>, il est \u00e9galement possible d&rsquo;avoir des sous-r\u00e9pertoires pour diff\u00e9rents sites web.  Par exemple,\u00a0<code>\/var\/www\/site1<\/code>\u00a0et\u00a0<code>\/var\/www\/site2<\/code>\u00a0pour diff\u00e9rents sites. Voir le document sur les <a href=\"https:\/\/ve2cuy.com\/420-3c3\/?page_id=1663\" data-type=\"page\" data-id=\"1663\">h\u00f4te virtuels<\/a> (vhosts). <\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading has-vivid-green-cyan-color has-text-color\">7.1 &#8211; Exp\u00e9rimentation avec le contenu du dossier \/var\/www\/html<\/h3>\n\n\n\n<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=\"\">\u250c\u2500\u2500[19:47:02]\u2500[0]\u2500[serveur01:\/home\/etudiant]\n\u2514\u2500\u2500| ls \/var\/www\/html\/ -l\n-rw-r--r-- 1 root root 10671 Aug 30 22:51 index.html<\/pre>\n\n\n\n<ul>\n<li>Remplacer le contenu du fichier index.html par un contenu personnalis\u00e9<\/li>\n\n\n\n<li>R\u00e9 afficher la page du fureteur<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">8. Configuration d&rsquo;Apache, le dossier <em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\/etc\/apache2<\/mark><\/em><\/h2>\n\n\n\n<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=\"\">\u250c\u2500\u2500[13:23:28]\u2500[0]\u2500[serveur01:\/etc\/apache2]                 \n\u2514\u2500\u2500| ls -Al                                                \ntotal 84                                                   \n-rw-r--r-- 1 root root  7494 Sep  3 19:46 apache2.conf         # Configuration globale d'Apache2\ndrwxr-xr-x 2 root root  4096 Aug 30 22:51 conf-available       # Configuration suppl\u00e9mentaire\ndrwxr-xr-x 2 root root  4096 Aug 30 22:51 conf-enabled         # a2enconf, a2disconf\n-rw-r--r-- 1 root root  1782 Mar 18 11:41 envvars              # Variables d'environnement, APACHE_RUN_USER=www-data, ...\n-rw-r--r-- 1 root root 31063 Mar 18 11:41 magic                # D\u00e9finition des MIME\ndrwxr-xr-x 2 root root 12288 Aug 30 22:51 mods-available       # Modules disponible\ndrwxr-xr-x 2 root root  4096 Sep  3 19:44 mods-enabled         # a2enmod, a2dismod\n-rw-r--r-- 1 root root   287 Aug 30 23:42 ports.conf           # Ports IP \u00e9cout\u00e9s par apache2, 80, 443, ...\ndrwxr-xr-x 2 root root  4096 Sep  3 19:19 sites-available      # Sites disponibles - H\u00f4tes virtuels\ndrwxr-xr-x 2 root root  4096 Aug 30 22:51 sites-enabled        # a2ensite, a2dissite<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">9. Configuration globale, le fichier <em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">apache2.conf<\/mark><\/em><\/h2>\n\n\n\n<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=\"\"># This is the main Apache server configuration file.  It contains the\n# configuration directives that give the server its instructions.\n# Do NOT add a slash at the end of the directory path.\n#\n#ServerRoot \"\/etc\/apache2\"\n\n#\n# Timeout: The number of seconds before receives and sends time out.\n#\nTimeout 300\n\n# KeepAlive: Whether or not to allow persistent connections\n#\nKeepAlive On\n\n# These need to be set in \/etc\/apache2\/envvars\nUser ${APACHE_RUN_USER}\nGroup ${APACHE_RUN_GROUP}\n\nErrorLog ${APACHE_LOG_DIR}\/error.log\n\n# LogLevel: Control the severity of messages logged to the error_log.\n# Available values: trace8, ..., trace1, debug, info, notice, warn,\n# error, crit, alert, emerg.\nLogLevel warn\n\n# Include module configuration:\nIncludeOptional mods-enabled\/*.load\nIncludeOptional mods-enabled\/*.conf\n\n# Include list of ports to listen on\nInclude ports.conf\n\n# Sets the default security model of the Apache2 HTTPD server. \n# NOTE: Il ne sera pas possible pour le serveur Apache2 d'avoir acc\u00e8s aux dossiers\n#       \u00e0 l'ext\u00e9rieure de ceux d\u00e9finis ici:\n\n&lt;Directory \/>\n\tOptions FollowSymLinks\n\tAllowOverride None\n\tRequire all denied\n&lt;\/Directory>\n\n&lt;Directory \/usr\/share>\n\tAllowOverride None\n\tRequire all granted\n&lt;\/Directory>\n\n&lt;Directory \/var\/www\/>\n\tOptions -Indexes +FollowSymLinks\n\tAllowOverride All\n\tRequire all granted\n&lt;\/Directory>\n\n# AccessFileName: The name of the file to look for in each directory\n# for additional configuration directives.  See also the AllowOverride\n# directive.\nAccessFileName .htaccess\n\n# The following lines prevent .htaccess and .htpasswd files from being\n# viewed by Web clients.\n&lt;FilesMatch \"^\\.ht\">\n\tRequire all denied\n&lt;\/FilesMatch>\n\n# Include generic snippets of statements\nIncludeOptional conf-enabled\/*.conf\n\n# Include the virtual host configurations:\nIncludeOptional sites-enabled\/*.conf<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">9.2 &#8211; Les ports IP d&rsquo;\u00e9coute,  le fichier <em><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">ports.conf<\/mark><\/em><\/h2>\n\n\n\n<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=\"\"># If you just change the port or add more ports here, you will likely also\n# have to change the VirtualHost statement in\n# \/etc\/apache2\/sites-enabled\/000-default.conf\n\nListen 80\n# Listen autre_port\n\n&lt;IfModule ssl_module>\n        Listen 443\n&lt;\/IfModule>\n\n&lt;IfModule mod_gnutls.c>\n        Listen 443\n&lt;\/IfModule><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-luminous-vivid-amber-color has-text-color\">9.3 &#8211; Consultation des variables d&rsquo;environnement d&rsquo;apache<\/h2>\n\n\n\n<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=\"\"># NOTE: Les variables d'environnement d'Apache ne sont disponibles que durant une session apache2. \n# Pour les consulter, il faut explicitement les charger:\n\n$ source \/etc\/apache2\/envvars\n\n$ env | grep APACHE\n\nAPACHE_LOG_DIR=\/var\/log\/apache2\nAPACHE_PID_FILE=\/var\/run\/apache2\/apache2.pid\nAPACHE_RUN_GROUP=www-data\nAPACHE_LOCK_DIR=\/var\/lock\/apache2\nAPACHE_RUN_DIR=\/var\/run\/apache2\nAPACHE_RUN_USER=www-data\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">10. <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"><strong>Directives et droits d&rsquo;acc\u00e8s<\/strong><\/mark><\/h2>\n\n\n\n<p>Le module&nbsp;<code><a href=\"https:\/\/httpd.apache.org\/docs\/current\/mod\/mod_authz_core.html\">mod_authz_core<\/a><\/code>&nbsp;met \u00e0 disposition des fournisseurs d&rsquo;autorisation g\u00e9n\u00e9riques utilisables avec la directive&nbsp;<code><a href=\"https:\/\/httpd.apache.org\/docs\/current\/mod\/mod_authz_core.html#require\">Require<\/a><\/code>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Les directives <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">Require<\/mark><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">10.1 &#8211; <a>Require all<\/a><\/h3>\n\n\n\n<p class=\"has-text-align-left\">Le fournisseur&nbsp;<code><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">all<\/mark><\/strong><\/code>&nbsp;accepte un argument dont les deux valeurs possibles sont : &lsquo;<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">granted<\/mark><\/strong>&lsquo; ou &lsquo;<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">denied<\/mark><\/strong>&lsquo;. Les exemples suivants autorisent ou interdisent l&rsquo;acc\u00e8s \u00e0 toutes les requ\u00eates.<\/p>\n\n\n\n<p>Exemples d&rsquo;utilisation: <\/p>\n\n\n\n<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=\"\"> \/\/ Acc\u00e8s \u00e0 toutes le ressources du dossier suivant:\n &lt;Directory \/var\/www\/html>\n         Require all granted\n &lt;\/Directory>\n\n \/\/ Aucun acc\u00e8s aux ressources du dossier suivant:\n &lt;Directory \/>\n         Require all denied\n &lt;\/Directory>\n\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">10.2 &#8211; <a>Require ip <\/a>plages d&rsquo;adresses<\/h3>\n\n\n\n<p class=\"has-text-align-left\">Les clients dont les adresses IP font partie des tranches sp\u00e9cifi\u00e9es auront acc\u00e8s \u00e0 la ressource.<\/p>\n\n\n\n<p>Exemples d&rsquo;utilisation:<\/p>\n\n\n\n<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=\"\"> &lt;Directory \/var\/www\/html\/dossiers_internes>\n         Require ip 10.10 172.20 192.168\n &lt;\/Directory>\n\n &lt;Directory \/var\/www\/html\/externe_seulement>\n         Require not ip 192.168\n &lt;\/Directory>\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">11. Le site Web par d\u00e9faut &#8211; H\u00f4tes virtuels<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">11.1 &#8211; Le fichier \/etc\/apache2\/sites-available\/<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">000-default.conf <\/mark><\/h3>\n\n\n\n<p>Le fichier <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">000-default.conf<\/mark> contient les param\u00e8tres de configuration du site web par d\u00e9faut.  Les fichiers de contenu de ce site web sont situ\u00e9s \u00e0 <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\/var\/www\/html<\/mark>.  Ces param\u00e8tres ont pr\u00e9s\u00e9ances  sur ceux du fichier <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\/etc\/apache2\/apache2.conf<\/mark>.<\/p>\n\n\n\n<p>Voici son contenu de d\u00e9part:<\/p>\n\n\n\n<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=\"\"># Configuration de d\u00e9part du site web par d\u00e9faut\n&lt;VirtualHost *:80>\n        #ServerName www.example.com\n        ServerAdmin webmaster@localhost\n        DocumentRoot \/var\/www\/html\n        ErrorLog ${APACHE_LOG_DIR}\/error.log\n        CustomLog ${APACHE_LOG_DIR}\/access.log combined\n&lt;\/VirtualHost><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">11.2 &#8211; Consultation du journal d&rsquo;Apache2<\/h3>\n\n\n\n<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=\"\"># Consultation du journal d'apache2\nsudo tail -f \/var\/log\/apache2\/access.log\n# -f =  output appended data as the file grows<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading has-vivid-green-cyan-color has-text-color\">11.3 &#8211; Exp\u00e9rimentation avec la configuration du site par d\u00e9faut<\/h3>\n\n\n\n<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=\"\">&lt;VirtualHost *:80>\n        #ServerName www.example.com\n\n        ServerAdmin webmaster@localhost\n        DocumentRoot \/var\/www\/html\n\n        &lt;Directory \/var\/www\/html>\n                Options -Indexes\n                AllowOverride None\n                Require all granted\n        &lt;\/Directory>\n\n        &lt;Directory \/var\/www\/html\/documents>\n                Options +Indexes\n                AllowOverride None\n                Require all granted\n        &lt;\/Directory>\n\n        ErrorLog ${APACHE_LOG_DIR}\/error.log\n        CustomLog ${APACHE_LOG_DIR}\/access.log combined\n\n&lt;\/VirtualHost><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-red-color has-text-color\">12.3 &#8211; Laboratoire<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" width=\"450\" height=\"360\" src=\"https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/09\/labo.jpg\" alt=\"\" class=\"wp-image-2313\" style=\"aspect-ratio:1.25;object-fit:cover;width:260px\" srcset=\"https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/09\/labo.jpg 450w, https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/09\/labo-300x240.jpg 300w\" sizes=\"(max-width: 450px) 100vw, 450px\" \/><\/figure><\/div>\n\n\n<p class=\"has-text-align-left\">Il faut modifier la configuration du site web par d\u00e9faut, pour que le contenu Web soit publi\u00e9 \u00e0 partir du dossier <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\/la_cie_abc\/public_html<\/mark><\/strong> &#8211;  (<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">ATTENTION<\/mark><\/strong>, Il faut cr\u00e9er cette structure \u00e0 la racine du syst\u00e8me de fichiers)<\/p>\n\n\n\n<p>1 &#8211; Cr\u00e9er deux fichiers dans ce dossier:<\/p>\n\n\n\n<ul>\n<li><em><strong>motdepasse.txt<\/strong><\/em> (\u00c0 vous d&rsquo;y placer un peu de texte)<\/li>\n\n\n\n<li><strong><em>page.html <\/em><\/strong>(\u00c0 vous d&rsquo;y placer quelques balises HTML)<\/li>\n<\/ul>\n\n\n\n<p>2 &#8211; Il ne faut pas permettre l&rsquo;affichage du contenu du dossier dans le fureteur.<\/p>\n\n\n\n<p>3 &#8211; Cr\u00e9er le dossier <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\/la_cie_abc\/public_html\/documents<\/mark><\/strong><\/p>\n\n\n\n<p>4 &#8211; Cr\u00e9er les trois fichiers suivants dans le dossier <strong><em>documents<\/em><\/strong>:<\/p>\n\n\n\n<ul>\n<li>procedures.pdf<\/li>\n\n\n\n<li>exemple.cpp<\/li>\n\n\n\n<li>liste.html<\/li>\n<\/ul>\n\n\n\n<p>5 &#8211;  Il faut permettre l&rsquo;affichage du contenu du dossier <em><strong>documents<\/strong><\/em> dans le fureteur.<\/p>\n\n\n\n<p>6 &#8211; Permettre l&rsquo;acc\u00e8s au site web par le port IP 8080. Par exemple, <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"><strong>http:\/\/192.168.c.d:8080\/page.html<\/strong><\/mark><\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">INDICE<\/mark><\/strong>:  Par d\u00e9faut, <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">Apache2<\/mark> ne permet pas la publication de documents Web \u00e0 l&rsquo;ext\u00e9rieur du dossier <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\/var\/www<\/mark><\/strong> ou l&rsquo;\u00e9coute sur des ports IP autres que <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">80<\/mark><\/strong> et <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">443<\/mark><\/strong>.  Il faut permettre ces acc\u00e8s via les fichiers <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">apache2.conf<\/mark><\/strong> et <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">ports.conf<\/mark><\/strong> .  Apr\u00e8s modification, il faudra relancer <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">apache2<\/mark> : <em><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">sudo systemctl restart apache2<\/mark><\/strong><\/em>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">14 &#8211; Site de l&rsquo;utilisateur<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"433\" src=\"https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/09\/user-personas-header.jpg-1024x433.webp\" alt=\"\" class=\"wp-image-2312\" style=\"aspect-ratio:2.3648960739030023;width:412px;height:auto\" srcset=\"https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/09\/user-personas-header.jpg-1024x433.webp 1024w, https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/09\/user-personas-header.jpg-300x127.webp 300w, https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/09\/user-personas-header.jpg-768x325.webp 768w, https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/09\/user-personas-header.jpg-1536x649.webp 1536w, https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/09\/user-personas-header.jpg-2048x865.webp 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>Apache2 permet aux utilisateurs du syst\u00e8me de publier un site web personnel.<\/p>\n\n\n\n<p>Le site sera accessible via une URL de se format:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">http:\/\/192.168.2.214\/~etudiant\/<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">14.1 &#8211; Voici la proc\u00e9dure:<\/h3>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\u00c9tape 1<\/mark><\/strong> &#8211; Activer le module &lsquo;<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">userdir<\/mark><\/strong>&lsquo;<\/p>\n\n\n\n<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=\"\">sudo a2enmod userdir<\/pre>\n\n\n\n<p><br><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Voir le fichier<\/mark><\/strong>: <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\"><strong>\/etc\/apache2\/mods-available\/userdir.conf<\/strong><\/mark><\/p>\n\n\n\n<p><\/p>\n\n\n\n<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=\"\">UserDir public_html\nUserDir disabled root\n\n&lt;Directory \/home\/*\/public_html>\n        AllowOverride FileInfo AuthConfig Limit Indexes\n        Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec\n        Require method GET POST OPTIONS\n&lt;\/Directory><\/pre>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\u00c9tape 2<\/mark><\/strong> &#8211; L&rsquo;utilisateur doit placer son contenu web dans le dossier &lsquo;<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">~\/public_html<\/mark><\/strong>&lsquo;<\/p>\n\n\n\n<p>R\u00e9f\u00e9rence:  <a href=\"https:\/\/httpd.apache.org\/docs\/2.4\/mod\/overrides.html#override-fileinfo\">AllowOverride: FileInfo<\/a>, <a href=\"https:\/\/httpd.apache.org\/docs\/2.4\/mod\/overrides.html#override-authconfig\">AuthConfig<\/a>, <a href=\"https:\/\/httpd.apache.org\/docs\/2.4\/mod\/core.html#limit\">Limit<\/a>, <a href=\"https:\/\/httpd.apache.org\/docs\/2.4\/mod\/overrides.html#override-indexes\">Indexes<\/a><\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\u00c9tape 3<\/mark><\/strong> &#8211; L&rsquo;utilisateur &lsquo;<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">www-data<\/mark><\/strong>&lsquo; dit \u00eatre membre du groupe de l&rsquo;utilisateur qui d\u00e9sire publier sur le Web.<\/p>\n\n\n\n<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=\"\">usermod -a -G etudiant www-data<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-red-color has-text-color\">14.2 &#8211; Laboratoire<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" width=\"450\" height=\"360\" src=\"http:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/09\/labo.jpg\" alt=\"\" class=\"wp-image-2313\" style=\"aspect-ratio:1.25;width:260px;height:auto\" srcset=\"https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/09\/labo.jpg 450w, https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/09\/labo-300x240.jpg 300w\" sizes=\"(max-width: 450px) 100vw, 450px\" \/><\/figure><\/div>\n\n\n<ul>\n<li>Il faut cr\u00e9er l&rsquo;utilisateur <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">administrateur<\/mark><\/strong><\/li>\n\n\n\n<li>L&rsquo;URL: <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">http:\/\/adresse_ip_du_serveur\/~administrateur<\/mark><\/strong>,\n<ul>\n<li>Doit afficher le message suivant:  <strong>Ceci est le site de l&rsquo;Administrateur du serveur<\/strong>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Le site de l&rsquo;administrateur ne doit \u00eatre accessible qu&rsquo;\u00e0 partir de l&rsquo;adresse IP de votre poste de travail et de celui de votre voisin.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">15 &#8211; La directive <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">ErrorDocument<\/mark><\/h2>\n\n\n\n<p>Apache2 propose une m\u00e9thode pour personnaliser les messages d&rsquo;erreur Web.  Par exemple, lors d&rsquo;une requ\u00eate sur une adresse invalide, au lieu du message:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">404 - Not Found<\/pre>\n\n\n\n<p>Il est possible d&rsquo;afficher un page personnalis\u00e9e comme,<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" width=\"660\" height=\"577\" src=\"http:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/08\/404b.jpg\" alt=\"\" class=\"wp-image-2209\" style=\"aspect-ratio:1.143847487001733;width:379px;height:auto\" srcset=\"https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/08\/404b.jpg 660w, https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/08\/404b-300x262.jpg 300w\" sizes=\"(max-width: 660px) 100vw, 660px\" \/><\/figure><\/div>\n\n\n<p>Ceci sera obtenu grace \u00e0 la directrice &lsquo;ErrorDocument&rsquo;.  Voici des exemples:<\/p>\n\n\n\n<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=\"\">ErrorDocument 500 http:\/\/example.com\/cgi-bin\/server-error.cgi\nErrorDocument 404 \/errors\/bad_urls.php\nErrorDocument 401 \/subscription_info.html\nErrorDocument 403 \"Sorry can't allow you access today\"\nErrorDocument 403 Forbidden!\nErrorDocument 403 \/errors\/forbidden.py?referrer=%{escape:%{HTTP_REFERER}}\n\n# Retour au message d'origine:\n&lt;Directory \"\/web\/docs\">\n  ErrorDocument 404 default\n&lt;\/Directory><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">15.1 &#8211; Personnalisation d&rsquo;un 404<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" width=\"686\" height=\"286\" src=\"https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/09\/pasted-image-0.png\" alt=\"\" class=\"wp-image-2316\" style=\"aspect-ratio:2.3986013986013988;width:394px;height:auto\" srcset=\"https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/09\/pasted-image-0.png 686w, https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/09\/pasted-image-0-300x125.png 300w\" sizes=\"(max-width: 686px) 100vw, 686px\" \/><\/figure><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading has-luminous-vivid-orange-color has-text-color\">Apportons les modifications suivantes au site web par d\u00e9faut. <\/h3>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\u00c9tape 1<\/mark><\/strong>  &#8211; Ajouter le code suivant au fichier 000-default.conf<\/p>\n\n\n\n<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=\"\"># Sous DocumentRoot\nErrorDocument 404 https:\/\/ve2cuy.com\/420-3c3\/?page_id=2210\n\n# Enregistrer, recharger (systemctl reload) et tester!<\/pre>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\u00c9tape 2<\/mark><\/strong> &#8211; Ajouter le code suivant \u00e0 la section <em><strong>documents<\/strong><\/em><\/p>\n\n\n\n<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=\"\">&lt;Directory \/var\/www\/html\/documents>\n ...\n   ErrorDocument 404 default\n&lt;\/Directory>\n\n# Enregistrer, recharger (systemctl) et tester!<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-green-cyan-color has-text-color\">16 &#8211; RequireAny, RequireAll, RequireNone<\/h2>\n\n\n\n<p>Les balises <a href=\"https:\/\/httpd.apache.org\/docs\/2.4\/mod\/mod_authz_core.html#requireany\">RequireAny<\/a>, <a href=\"https:\/\/httpd.apache.org\/docs\/2.4\/mod\/mod_authz_core.html#requireall\">RequireAll<\/a> er <a href=\"https:\/\/httpd.apache.org\/docs\/2.4\/mod\/mod_authz_core.html#requirenone\">RequireNone<\/a> permettent de regrouper plusieurs directives.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">16.1 &#8211; Voici des exemples d&rsquo;utilisation:<\/h3>\n\n\n\n<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=\"\">&lt;RequireAny>\n    Require ip 192.168\n    Require ip 10.10\n    Require ip 2a02:4126:2aa4::\/48\n&lt;\/RequireAny>\n\n&lt;Files adminer.php>\n    &lt;RequireAny>\n        Require local\n        Require ip 192.168\n        Require ip 10\n    &lt;\/RequireAny>\n&lt;\/Files>\n\n# NOTE: Dans le cas d'une n\u00e9gation, il faut utilise la formule 'Tout sauf'\n&lt;RequireAll>\n    Require all granted\n    Require not ip 111.111.111.111\n    Require not ip 222.222.222.222\n    Require not ip 123.123.123.123\n&lt;\/RequireAll>\n\n&lt;RequireNone>\n  # Si une ou plusieurs directives contenues dans cette directive retournent un r\u00e9sultat positif alors la directive RequireNone \u00e9chouera.\n&lt;\/RequireNone>\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-pale-pink-color has-text-color\">17 &#8211; Les h\u00f4tes virtuelles (virtual hosts)<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" width=\"768\" height=\"407\" src=\"https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/09\/virtual_host.jpg\" alt=\"\" class=\"wp-image-2324\" style=\"aspect-ratio:1.886977886977887;width:410px;height:auto\" srcset=\"https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/09\/virtual_host.jpg 768w, https:\/\/ve2cuy.com\/420-3c3\/wp-content\/uploads\/2024\/09\/virtual_host-300x159.jpg 300w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/figure><\/div>\n\n\n<p><a href=\"https:\/\/ve2cuy.com\/420-3c3\/?page_id=1663\" data-type=\"page\" data-id=\"1663\">Le document est disponible ici<\/a>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>FIN DU DOCUMENT<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Contenu NOTE: Les exemples de ce document utilisent la syntaxe de la version 2.4 d&rsquo;Apache2 2. Apache2 Apache2 est un serveur web open-source largement reconnu, d\u00e9velopp\u00e9 par la Fondation Apache. Il constitue un pilier essentiel de l&rsquo;infrastructure Internet, permettant l&rsquo;h\u00e9bergement et la diffusion de contenus via les protocoles HTTP et HTTPS. Sa popularit\u00e9 r\u00e9side [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"_links":{"self":[{"href":"https:\/\/ve2cuy.com\/420-3c3\/index.php?rest_route=\/wp\/v2\/pages\/2214"}],"collection":[{"href":"https:\/\/ve2cuy.com\/420-3c3\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ve2cuy.com\/420-3c3\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ve2cuy.com\/420-3c3\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ve2cuy.com\/420-3c3\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2214"}],"version-history":[{"count":63,"href":"https:\/\/ve2cuy.com\/420-3c3\/index.php?rest_route=\/wp\/v2\/pages\/2214\/revisions"}],"predecessor-version":[{"id":2336,"href":"https:\/\/ve2cuy.com\/420-3c3\/index.php?rest_route=\/wp\/v2\/pages\/2214\/revisions\/2336"}],"wp:attachment":[{"href":"https:\/\/ve2cuy.com\/420-3c3\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}