Linux – Apache2 Startup warning: NameVirtualHost *:80 and NameVirtualHost *:443 has no VirtualHosts

apache-2.2linux

I have a super simple Apache setup on a SUSE box that is giving me the error in the title. Any ideas what it could be? I have checked all the conf files and found no duplicate NameVirtualHost directives anywhere…

My listen.conf file looks like this (some goodies ommitted):

NameVirtualHost *:80
NameVirtualHost *:443

and my vhost.conf file looks like this (some goodies ommitted):

<VirtualHost *:443>
        ServerName subdomain.somedomain.com
        ## OTHER STUFF ##
</VirtualHost>

<VirtualHost *:443>
        ServerName anothersubdomain.somedomain.com
        ## OTHER STUFF ##
</VirtualHost>

<VirtualHost *:80>
        ServerName someotherserver.somedomain.com
        ## OTHER STUFF ##
</VirtualHost>

Best Answer

It looks like you need to enclose your ServerName somedomain.com ## OTHER STUFF ## inside

<VirtualHost *:80>
</VirtualHost>

tags. The error is saying that you have no virtual hosts defined for port 80 and 443. Change the *:80 to *:443 for an ssl host.