View Single Post
  #8  
Old 26th May 2011, 04:45
defconjuan defconjuan is offline
Junior Member
 
Join Date: Apr 2011
Posts: 17
Thanks: 1
Thanked 2 Times in 1 Post
Default

I know this is old but I came accross this and it bugged the heck out of me (I hate error messages).

[warn] NameVirtualHost *:443 has no VirtualHosts

Simply Put: Apache is listening on 443 but there are no VirtualHosts (websites) defined on that port. (See /etc/apache2/ports.conf):
Code:
NameVirtualHost *:80
Listen 80

<IfModule mod_ssl.c>
    NameVirtualHost *:443
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    NameVirtualHost *:443
    Listen 443
</IfModule>
You have two options to get rid of the harmless error message:

Option 1 - Enable the default SSL config (Preferred, less destructive)
Define a site on 443 (the easiest way is to run the following code):
Code:
ln -s /etc/apache2/sites-available/default-ssl 000-default-ssl
# then restart apache
/etc/init.d/apache2 restart
Option 2 - Unbind Apache from Port 443
Comment out the "NameVirtualHost *:443" and "Listen 443" lines of /etc/apache2/ports.conf (e.g. add a # symbol in from of those lines so the new ports config file looks something like
Code:
NameVirtualHost *:80
Listen 80

<IfModule mod_ssl.c>
    # NameVirtualHost *:443
    # Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    # NameVirtualHost *:443
    # Listen 443
</IfModule>
Reply With Quote