Outils personnels

Message : NameVirtualHost *:80 has no VirtualHosts

De wikiGite

Sur debian squeeze lorsque apache redémarre il nous gratifie d'une erreur :

Restarting web server: apache2[Sun May 06 12:10:41 2012] [warn] NameVirtualHost *:80 has no VirtualHosts
... waiting [Sun May 06 12:10:42 2012] [warn] NameVirtualHost *:80 has no VirtualHosts


Solution :

Commenter la ligne :

NameVirtualHost *:80

Dans le fichier /etc/apache2/ports.conf

Plus d'infos :

zcat /usr/share/doc/apache2.2-common/NEWS.Debian.gz
* The directive "NameVirtualHost *" has been changed to "NameVirtualHost
   *:80". It has also been moved from sites-available/default to ports.conf.
   This allows to ship a proper SSL default virtual host config in
   sites-available/default-ssl, but it means that if you use several name
   based virtual hosts:

   - you will have to change <VirtualHost *> to <VirtualHost *:80> in your
     name based virtual hosts

   - you need to add more NameVirtualHost directives if you use other ports
     than 80 with name based virtual hosts. You may also have to add these
     ports to the default virtual host in /etc/apache2/sites-available/default
     (like this: "<VirtualHost *:80 *:81>").

   If you prefer to revert to the old setup instead (and don't need the
   default-ssl host), just change "NameVirtualHost *:80" back to
   "NameVirtualHost *" in ports.conf and "<VirtualHost *:80>" to
   "<VirtualHost *>" in sites-available/default.