{"id":1108,"date":"2022-09-11T16:00:36","date_gmt":"2022-09-11T14:00:36","guid":{"rendered":"https:\/\/techtocraft.xyz\/?p=1108"},"modified":"2023-01-19T00:42:20","modified_gmt":"2023-01-18T23:42:20","slug":"apache-errorcode","status":"publish","type":"post","link":"https:\/\/hinakuu.xyz\/?p=1108","title":{"rendered":"Linux Apache Nginx [Error:code]"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\"><code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">AH00558: Could not reliably determine the server's fully qualified domain name<\/mark><\/code><\/h3>\n\n\n\n<p>Pour r\u00e9soudre l&rsquo;erreur&nbsp;<strong>AH00558: Could not reliably determine the server&rsquo;s fully qualified domain name<\/strong>, vous devrez ajouter une&nbsp;<code>ServerName<\/code> directive \u00e0 votre configuration Apache.&nbsp;<\/p>\n\n\n\n<p>Apache utilise la&nbsp;ServerName directive pour mapper les requ\u00eates HTTP entrantes sur une adresse IP ou un nom d&rsquo;h\u00f4te DNS \u00e0 l&rsquo;aide de&nbsp;VirtualHost directives&nbsp;afin de g\u00e9rer les requ\u00eates de plusieurs sites \u00e0 l&rsquo;aide d&rsquo;un seul serveur.<\/p>\n\n\n\n<p>Le message d&rsquo;erreur indique qu&rsquo;une&nbsp;ServerName directive globale doit \u00e9galement \u00eatre d\u00e9finie.&nbsp;Cela garantira qu&rsquo;Apache peut g\u00e9rer correctement les requ\u00eates entrantes qui ne correspondent pas \u00e0 a&nbsp;VirtualHost sans g\u00e9n\u00e9rer d&rsquo;erreurs suppl\u00e9mentaires.<\/p>\n\n\n\n<p>Pour une compatibilit\u00e9 maximale avec diverses configurations Apache, utilisez la valeur de pour votre&nbsp;directive&nbsp;127.0.0.1 globale .&nbsp;<\/p>\n\n\n\n<p>Vous pouvez utiliser une adresse IP ou un nom DNS diff\u00e9rent qui correspond \u00e0 la configuration de votre serveur si n\u00e9cessaire, mais il est plus s\u00fbr d&rsquo;utiliser&nbsp;127.0.0.1.<\/p>\n\n\n\n<p>Sur les syst\u00e8mes d\u00e9riv\u00e9s d&rsquo;Ubuntu et de Debian, ouvrez le fichier&nbsp;<code>\/etc\/apache2\/apache2.conf<\/code> avec les privil\u00e8ges root \u00e0 l&rsquo;aide de&nbsp;nano ou de votre \u00e9diteur de texte pr\u00e9f\u00e9r\u00e9&nbsp;:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">sudo nano \/etc\/apache2\/apache2.conf<\/mark><\/pre>\n\n\n\n<p>Ajoutez une ligne contenant&nbsp;<code>ServerName 127.0.0.1<\/code> \u00e0 la fin du fichier&nbsp;:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-pale-pink-color\">ServerName 127.0.0.1<\/mark><\/pre>\n\n\n\n<p>Une fois que vous avez ajout\u00e9 la&nbsp;<code>ServerName<\/code> directive \u00e0 votre configuration, ex\u00e9cutez&nbsp;<code>apachectl<\/code> pour tester la validit\u00e9 de la configuration.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">sudo apachectl configtest<\/mark> \n\nOutput\nSyntax OK<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">AH00547: Could not resolve host name mon.domaine.xyz &#8212; ignoring!<\/mark><\/h3>\n\n\n\n<p>Pour r\u00e9soudre cet erreur il faut modifier le vhost interface puis remplacer la ligne :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">&lt;VirtualHost \\*:80><\/mark> par <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">&lt;VirtualHost \\mon.domaine.xyz:80><\/mark><\/pre>\n\n\n\n<p>Exemple :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;VirtualHost \\mon.domaine.xyz:80&gt;\n     ServerAdmin localhost\n     DocumentRoot \/var\/www\/html\/website\n     ServerName mon.domaine.xyz\n    &lt;Directory \/var\/www\/html\/website&gt;\n         Options FollowSymlinks\n         AllowOverride All\n         Require all granted\n     &lt;\/Directory&gt;\n\nErrorLog ${APACHE_LOG_DIR}\/example.com_error.log\n\nCustomLog ${APACHE_LOG_DIR}\/your-domain.com_access.log combined\n\n&lt;\/VirtualHost&gt;\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Apache Renouvellement d&rsquo;un certificat let&rsquo;s encrypt &amp; redirection de port<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">certbot-renews.sh<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Failed to renew certificate mon.site.com with error: Problem binding to port 80: Could not bind to IPv4 or IPv6.<br>All renewals failed. The following certificates could not be renewed:<br>\/etc\/letsencrypt\/live\/mon.site.com\/fullchain.pem (failure)<br>1 renew failure(s), 0 parse failure(s)<\/mark><\/strong><\/h3>\n\n\n\n<p>Pour renouveler le certificat SSL vous devez d\u00e9sactiver apache le temps de lancer la commande :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl stop apache2\ncertbot-renews.sh\nsystemctl start apache2<\/pre>\n\n\n\n<p>Autre possibilit\u00e9 : <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>v\u00e9rifier les r\u00e8gles de votre pare-feu et le port forward<\/li>\n\n\n\n<li>v\u00e9rifier si le port 80 est bien configurer dans le fichier \/etc\/apache2\/ports.conf<\/li>\n\n\n\n<li>v\u00e9rifier si le port 80 est bien configurer dans \/etc\/apache2\/sites-available\/votre.site.conf<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Nginx Firewall NAT Port forward, erreur challenge https<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>root@roguesrv03:\/# certbot --nginx -d mon.domaine.xyz\nSaving debug log to \/var\/log\/letsencrypt\/letsencrypt.log\nPlugins selected: Authenticator nginx, Installer nginx\nRequesting a certificate for mon.domaine.xyz\nPerforming the following challenges:\nhttp-01 challenge for mon.domaine.xyz\nWaiting for verification...\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Challenge failed for domain mon.domaine.xyz<\/mark>\nhttp-01 challenge for mon.domaine.xyz\nCleaning up challenges\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Some challenges have failed.<\/mark>\n\nIMPORTANT NOTES:\n - The following errors were reported by the server:\n\n   Domain: mon.domaine.xyz\n   Type:   unauthorized\n   Detail: 77.777.77.777: Invalid response from\n   https:\/\/mon.domaine.xyz\/.well-known\/acme-challenge\/J41ff2k24yzESDD0rQnR                                                                                                                              06TsnlaqiOpLgKV2zJp6BtY:\n   404\n\n   To fix these errors, please make sure that your domain name was\n   entered correctly and the DNS A\/AAAA record(s) for that domain\n   contain(s) the right IP address.\n<\/code><\/pre>\n\n\n\n<p>Solution : r\u00e9organiser le port-forward sur le firewall si plusieurs machines occupent le m\u00eame port d&rsquo;\u00e9coute le temps d&rsquo;installer ou de renouveler le ccertificat  (exemple)<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/techtocraft.xyz\/wp-content\/uploads\/2022\/09\/firewallhttps.png\" alt=\"\" class=\"wp-image-1439\" width=\"754\" height=\"454\" srcset=\"https:\/\/hinakuu.xyz\/wp-content\/uploads\/2022\/09\/firewallhttps.png 995w, https:\/\/hinakuu.xyz\/wp-content\/uploads\/2022\/09\/firewallhttps-300x181.png 300w, https:\/\/hinakuu.xyz\/wp-content\/uploads\/2022\/09\/firewallhttps-768x463.png 768w\" sizes=\"auto, (max-width: 754px) 100vw, 754px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>AH00558: Could not reliably determine the server&rsquo;s fully qualified domain name Pour r\u00e9soudre l&rsquo;erreur&nbsp;AH00558: Could not reliably determine<\/p>\n","protected":false},"author":1,"featured_media":1457,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1108","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=\/wp\/v2\/posts\/1108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1108"}],"version-history":[{"count":31,"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=\/wp\/v2\/posts\/1108\/revisions"}],"predecessor-version":[{"id":1458,"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=\/wp\/v2\/posts\/1108\/revisions\/1458"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=\/wp\/v2\/media\/1457"}],"wp:attachment":[{"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}