{"id":145,"date":"2019-05-13T11:13:45","date_gmt":"2019-05-13T11:13:45","guid":{"rendered":"https:\/\/blog.iabsolute.com\/?p=145"},"modified":"2019-05-13T11:13:45","modified_gmt":"2019-05-13T18:13:45","slug":"apache2-could-not-determine-the-servers-fully-qualified-domain-name-using-127-0-0-1-for-servername","status":"publish","type":"post","link":"https:\/\/blog.iabsolute.com\/?p=145","title":{"rendered":"apache2: Could not determine the server\u2019s fully qualified domain name, using 127.0.0.1 for ServerName"},"content":{"rendered":"\n<p>This is just a friendly warning and not really a problem (as in that something does not work).<\/p>\n\n\n\n<p>If you insert a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ServerName localhost\n<\/code><\/pre>\n\n\n\n<p>in either <code>httpd.conf<\/code> or <code>apache2.conf<\/code> in <code>\/etc\/apache2<\/code> and restart apache the notice will disappear.<\/p>\n\n\n\n<p>If you have a name inside <code>\/etc\/hostname<\/code> you can also use that name instead of <code>localhost<\/code>.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>And it uses <code>127.0.1.1<\/code> if it is inside your <code>\/etc\/hosts<\/code>:\n<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>127.0.0.1 localhost\n127.0.1.1 myhostname\n<\/code><\/pre>\n\n\n\n<p><strong><a href=\"https:\/\/help.ubuntu.com\/community\/ApacheMySQLPHP#Troubleshooting_Apache\">Preferred method<\/a><\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Troubleshooting Apache<\/p><\/blockquote>\n\n\n\n<p>If you get this error:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apache2: Could not determine the server's fully qualified domain name,\nusing 127.0.0.1 for ServerName\n<\/code><\/pre>\n\n\n\n<p>then use a text editor such as \u201csudo nano\u201d at the command line or \u201cgksudo gedit\u201d on the desktop to create a new file,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/apache2\/conf.d\/fqdn\n<\/code><\/pre>\n\n\n\n<p>or<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gksu \"gedit \/etc\/apache2\/conf.d\/fqdn\"\n<\/code><\/pre>\n\n\n\n<p>then add<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ServerName localhost\n<\/code><\/pre>\n\n\n\n<p>to the file and save. This can all be done in a single command with the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> echo \"ServerName localhost\" | sudo tee \/etc\/apache2\/conf.d\/fqdn\n<\/code><\/pre>\n\n\n\n<p>But on Ubuntu 14.04:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> echo \"ServerName localhost\" | sudo tee \/etc\/apache2\/conf-available\/fqdn.conf\n sudo a2enconf fqdn\n<\/code><\/pre>\n\n\n\n<p>Don\u2019t forget the \u201c.conf\u201d (without will not work).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is just a friendly warning and not really a problem (as in that something does not work). If you insert a in either httpd.conf or apache2.conf in \/etc\/apache2 and restart apache the notice will disappear. If you have a &hellip; <a href=\"https:\/\/blog.iabsolute.com\/?p=145\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-145","post","type-post","status-publish","format-standard","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/posts\/145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=145"}],"version-history":[{"count":1,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/posts\/145\/revisions"}],"predecessor-version":[{"id":146,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=\/wp\/v2\/posts\/145\/revisions\/146"}],"wp:attachment":[{"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.iabsolute.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}