{"id":85,"date":"2026-02-05T20:00:27","date_gmt":"2026-02-05T20:00:27","guid":{"rendered":"https:\/\/www.hokutotokisama.fr\/?p=85"},"modified":"2026-02-08T16:20:42","modified_gmt":"2026-02-08T16:20:42","slug":"installation-apache-2-sur-ubuntu","status":"publish","type":"post","link":"https:\/\/www.hokutotokisama.fr\/?p=85","title":{"rendered":"Installation Apache 2 sur Ubuntu"},"content":{"rendered":"\n<p class=\"has-x-large-font-size\"><strong>1 &#8211; Installation du serveur Apache<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install -y apache2 apache2-utils<\/code><\/pre>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>2 &#8211; Normalement le serveur d\u00e9marre seul<\/strong><\/p>\n\n\n\n<p>2.1 &#8211; On peux v\u00e9rifier en faisant<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status apache2<\/code><\/pre>\n\n\n\n<p>2.2 &#8211; Si pas d\u00e9marr\u00e9, on le d\u00e9marre avec <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start apache2<\/code><\/pre>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>3 &#8211; Activer apache2 pour un d\u00e9marrage automatique<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable apache2<\/code><\/pre>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>4 &#8211; On peux tester la connexion<\/strong><\/p>\n\n\n\n<p>4.1 &#8211; on r\u00e9cup\u00e9re l&rsquo;ip du serveur<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ip a<\/code><\/pre>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a05fe49e6331&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a05fe49e6331\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"276\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.hokutotokisama.fr\/wp-content\/uploads\/2026\/02\/Capture-decran-2026-02-05-204353-1024x276.png\" alt=\"\" class=\"wp-image-86\" srcset=\"https:\/\/www.hokutotokisama.fr\/wp-content\/uploads\/2026\/02\/Capture-decran-2026-02-05-204353-1024x276.png 1024w, https:\/\/www.hokutotokisama.fr\/wp-content\/uploads\/2026\/02\/Capture-decran-2026-02-05-204353-300x81.png 300w, https:\/\/www.hokutotokisama.fr\/wp-content\/uploads\/2026\/02\/Capture-decran-2026-02-05-204353-768x207.png 768w, https:\/\/www.hokutotokisama.fr\/wp-content\/uploads\/2026\/02\/Capture-decran-2026-02-05-204353.png 1296w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Agrandir\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p>4.2 &#8211; on se connecte sur le serveur avec un navigateur<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a05fe49e6867&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a05fe49e6867\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"880\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.hokutotokisama.fr\/wp-content\/uploads\/2026\/02\/Capture-decran-2026-02-05-204506-1024x880.png\" alt=\"\" class=\"wp-image-87\" srcset=\"https:\/\/www.hokutotokisama.fr\/wp-content\/uploads\/2026\/02\/Capture-decran-2026-02-05-204506-1024x880.png 1024w, https:\/\/www.hokutotokisama.fr\/wp-content\/uploads\/2026\/02\/Capture-decran-2026-02-05-204506-300x258.png 300w, https:\/\/www.hokutotokisama.fr\/wp-content\/uploads\/2026\/02\/Capture-decran-2026-02-05-204506-768x660.png 768w, https:\/\/www.hokutotokisama.fr\/wp-content\/uploads\/2026\/02\/Capture-decran-2026-02-05-204506.png 1482w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Agrandir\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>5 &#8211; Apache cr\u00e9e automatiquement un utilisateur www-data et un groupe www-data. On va nommer cet utilisateur propri\u00e9taire du r\u00e9pertoire \/var\/www\/html qui est le r\u00e9pertoire des sites.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chown www-data:www-data \/var\/www\/html\/ -R<\/code><\/pre>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>6 &#8211; On teste la r\u00e9solution de nom<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apache2ctl -t<\/code><\/pre>\n\n\n\n<p>Si la r\u00e9ponse est \u00ab\u00a0Syntax OK\u00a0\u00bb alors tout est bon, on a fini<\/p>\n\n\n\n<p>Si la r\u00e9ponse est \u00ab\u00a0Could not reliably determine the server&rsquo;s fully qualified domain name, using 127.0.1.1. Set the &lsquo;ServerName&rsquo; directive globally to suppress this message\u00a0\u00bb alors on passe \u00e0 l&rsquo;etape 7.<\/p>\n\n\n\n<p>Cette erreur signifie que le nom d\u2019h\u00f4te du syst\u00e8me ne peux \u00eatre r\u00e9solu via DNS, il faut donc forcer un nom d\u2019h\u00f4te par apache<\/p>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>7 &#8211; Forcer le nom d\u2019h\u00f4te sur apache<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/apache2\/conf-available\/servername.conf<\/code><\/pre>\n\n\n\n<p> 7.1 &#8211; Ajouter la ligne<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ServerName localhost<\/code><\/pre>\n\n\n\n<p>On peux bien entendu mettre le nom de son domaine \u00e0 la place de localhost si on veux mettre apache sur son domaine<\/p>\n\n\n\n<p>7.2 &#8211; Activer ce fichier de configuration<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo a2enconf servername.conf<\/code><\/pre>\n\n\n\n<p>Red\u00e9marrer Apache<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl reload apache2<\/code><\/pre>\n\n\n\n<p class=\"has-x-large-font-size\"><strong>8 &#8211; La suite<\/strong><\/p>\n\n\n\n<p>On peux, par la suite, installer PHP. Le tuto se trouve <a href=\"https:\/\/www.hokutotokisama.fr\/?p=107\">ici<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1 &#8211; Installation du serveur Apache 2 &#8211; Normalement le serveur d\u00e9marre seul 2.1 &#8211; On peux v\u00e9rifier en faisant 2.2 &#8211; Si pas d\u00e9marr\u00e9, on le d\u00e9marre avec 3 &#8211; Activer apache2 pour un d\u00e9marrage automatique 4 &#8211; On peux tester la connexion 4.1 &#8211; on r\u00e9cup\u00e9re l&rsquo;ip du serveur 4.2 &#8211; on se [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[20],"class_list":["post-85","post","type-post","status-publish","format-standard","hentry","category-linux","tag-apache"],"_links":{"self":[{"href":"https:\/\/www.hokutotokisama.fr\/index.php?rest_route=\/wp\/v2\/posts\/85","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hokutotokisama.fr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hokutotokisama.fr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hokutotokisama.fr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hokutotokisama.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=85"}],"version-history":[{"count":4,"href":"https:\/\/www.hokutotokisama.fr\/index.php?rest_route=\/wp\/v2\/posts\/85\/revisions"}],"predecessor-version":[{"id":169,"href":"https:\/\/www.hokutotokisama.fr\/index.php?rest_route=\/wp\/v2\/posts\/85\/revisions\/169"}],"wp:attachment":[{"href":"https:\/\/www.hokutotokisama.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hokutotokisama.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hokutotokisama.fr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}