Bonjour,
Je m'arrache les cheveux depuis quelques jours avec Apache et les hôtes virtuels.
J'ai configuré un hôte virtuel comme indiqué dans la documentation:
sites.conf
# Activation des hôtes virtuels
NameVirtualHost *:80
# Hôte virtuel par défaut
<VirtualHost *:80>
# home du site : URL = http://localhost/
ServerName localhost
# Dossier contenant les pages
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
AllowOverride FileInfo AuthConfig Limit
</Directory>
# jeu de caractères (UTF-8 par défaut)
AddDefaultCharset UTF-8)
# Activation des sites de quelques utilisateurs : http://localhost/~nomutilisateur
UserDir enabled mistral
UserDir public_html
<Directory /home/*/public_html>
AllowOverride all
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
</Directory>
# Activation de l'adresse : http://localhost/server-status
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
</Location>
# Activation de l'adresse : http://localhost/server-info
<Location /server-info>
SetHandler server-info
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
</Location>
</VirtualHost>
# Site
<VirtualHost *:80>
# home du site : URL = http://site/
ServerName site
# Dossier contenant les pages
DocumentRoot /home/mistral/public_html/site
<Directory /home/mistral/public_html/site>
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
AllowOverride FileInfo AuthConfig Limit
</Directory>
# jeu de caractères (UTF-8 par défaut)
AddDefaultCharset UTF-8)
</VirtualHost>
hosts :
127.0.0.1 localhost site localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost site localhost.localdomain localhost6 localhost6.localdomain6
J'ai placé une page de test dans le dossier "site".
Lorsque je suis connecté à un réseau sans fil/cablé,
aucun soucis que ce soit pour "localhost" ou "site".
Lorsque je suis déconnecté,
aucun soucis pour "localhost", en revanche,
impossible d'afficher la page pour "site".
Un ping, et "site" répond sans broncher
[mistral@Verne ~]$ ping site
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_req=1 ttl=64 time=0.054 ms
64 bytes from localhost (127.0.0.1): icmp_req=2 ttl=64 time=0.057 ms
64 bytes from localhost (127.0.0.1): icmp_req=3 ttl=64 time=0.057 ms
^C
--- localhost ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.054/0.056/0.057/0.001 ms
Si quelqu'un a la moindre idée du pourquoi, je suis preneur! 🙂
Merci d'avance!
Mistral
PS : Le problème est présent sous FF et Chromium