{"id":501,"date":"2010-05-24T09:23:30","date_gmt":"2010-05-24T16:23:30","guid":{"rendered":"http:\/\/sp2hari.com\/?p=501"},"modified":"2020-06-20T08:30:10","modified_gmt":"2020-06-20T08:30:10","slug":"apache-fix-namevirtualhost-80-has-no-virtualhosts","status":"publish","type":"post","link":"https:\/\/sp2hari.com\/index.php\/2010\/05\/24\/apache-fix-namevirtualhost-80-has-no-virtualhosts\/","title":{"rendered":"Apache Fix : NameVirtualHost *:80 has no VirtualHosts"},"content":{"rendered":"<p>I get this error every time I install apache web-server in an ubuntu machine. We use LAMP stack at Interviewstreet and this error was nagging me all the this while.<\/p>\n<p>The error message shows up something like this.<\/p>\n<p><code><br \/>\nroot@interviewstreet:~# \/etc\/init.d\/apache2 restart<br \/>\n* Restarting web server apache2                                                                                             apache2: Could not reliably determine the server's fully qualified domain name, using interviewstreet.com for ServerName<br \/>\n[warn] NameVirtualHost *:80 has no VirtualHosts ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using interviewstreet.com for ServerName<br \/>\n[warn] NameVirtualHost *:80 has no VirtualHosts [ OK ]<br \/>\n<\/code><\/p>\n<p>After some googling, I found the actual solution at <a href=\"http:\/\/serverfault.com\/questions\/1405\/apache2-startup-warning-namevirtualhost-80-has-no-virtualhosts\">http:\/\/serverfault.com\/questions\/1405\/apache2-startup-warning-namevirtualhost-80-has-no-virtualhosts<\/a>.<\/p>\n<p>The reason why this happens is because of having NameVirtualHost in more than one place. In this case, it occurs at 2 different files, sites-available\/default and ports.conf.<\/p>\n<p>So, this is how we fixed this issue.<\/p>\n<p>1. Removed the line &#8220;NameVirtualHost *&#8221; from sites-available\/default.<br \/>\n2. Changed &#8220;NamedVirtualHost *:80&#8221; to &#8220;NamedVirtualHost *&#8221; in ports.conf<\/p>\n<p>Done. That fixes the problem. Now apache restart shows something like this.<\/p>\n<p><code>root@interviewstreet:\/etc\/apache2\/sites-available# \/etc\/init.d\/apache2 restart<br \/>\n* Restarting web server apache2  ... waiting [ OK ]<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I get this error every time I install apache web-server in an ubuntu machine. We use LAMP stack at Interviewstreet and this error was nagging me all the this while. The error message shows up something like this. root@interviewstreet:~# \/etc\/init.d\/apache2 restart * Restarting web server apache2 apache2: Could not reliably &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-501","post","type-post","status-publish","format-standard","hentry","category-code"],"_links":{"self":[{"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/posts\/501","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/comments?post=501"}],"version-history":[{"count":8,"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/posts\/501\/revisions"}],"predecessor-version":[{"id":1356,"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/posts\/501\/revisions\/1356"}],"wp:attachment":[{"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/media?parent=501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/categories?post=501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sp2hari.com\/index.php\/wp-json\/wp\/v2\/tags?post=501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}