Posts tagged apache
Apache Fix : NameVirtualHost *:80 has no VirtualHosts
2I 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 determine the server's fully qualified domain name, using interviewstreet.com for ServerName
[warn] NameVirtualHost *:80 has no VirtualHosts ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using interviewstreet.com for ServerName
[warn] NameVirtualHost *:80 has no VirtualHosts [ OK ]
After some googling, I found the actual solution at http://serverfault.com/questions/1405/apache2-startup-warning-namevirtualhost-80-has-no-virtualhosts.
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.
So, this is how we fixed this issue.
1. Removed the line “NameVirtualHost *” from sites-available/default.
2. Changed “NamedVirtualHost *:80″ to “NamedVirtualHost *” in ports.conf
Done. That fixes the problem. Now apache restart shows something like this.
root@interviewstreet:/etc/apache2/sites-available# /etc/init.d/apache2 restart
* Restarting web server apache2 ... waiting [ OK ]












