NameVirtualHost *:80 has no VirtualHosts error

Bij het herstarten van Apache verschijnt de error: NameVirtualHost *:80 has no VirtualHosts

Dit probleem ontstaat als meerdere keren NameVirtualHost is gedefinieerd;

Somewhere in your configuration, probably in the Apache default configuration file (I think /etc/apache2/httpd.conf in Ubuntu? someone can correct me in the comments), is a line that looks like:

NameVirtualHost *:80

# Also
Listen 80
Listen 443

Comment them out, and in your VirtualHost configuration files, add:

Listen 111.111.111.111:80
Listen 222.222.222.222:80

NameVirtualHost 111.111.111.111:80
NameVirtualHost 222.222.222.222:80

In many default Apache configurations, the Listen and NameVirtualHost directives are supplied with wildcards, or globally to apply to all network interfaces. Since you’re using multiple IP addresses bound to different configurations, you need to be more specific in your config directives than your distribution’s default config file.

Laat een reactie achter

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *