Je travail actuellement sur ubuntu for Windows. J'ai installé apache2 et j'ai un virtual host par défaut et le mien :
<VirtualHost dev.localhost:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName dev.localhost
ServerAlias www.dev.localhost
ServerAdmin webmaster@localhost
DocumentRoot /mnt/c/Users/PC-Thibault/Sites/mes-cours-en-ligne/public
<directory /mnt/c/Users/PC-Thibault/Sites/mes-cours-en-ligne/public/>
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
FallbackResource /index.php
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
J'ai ajouté dans mon fichier host windows :
127.0.0.1 dev.localhost
Sur Firefox quand je vais sur dev.localhost j'ai bien mon site. Par contre, sur Google Chrome, j'ai la page par défaut de Apache (même si je désactive le virtualhost par défaut.
Quelqu'un aurait une idée/déjà rencontré le soucis ?
En gros, tu tombes sur ton apache, qui reçoit une requête pour dev.localhost, comme avec firefox, donc il n'y a aucune raison que la requête soit traitée autrement.
Thomas | Community manager | ikoula Serveurs dédiés, VPS et Cloud Public