Bonjour à tous,
Je voudrais créer 2 site web différents dans le même serveur Wamp
Os : Windows 7
Wamp : 5.6.7
Note :
J'ai réussi à créer un VirtualHost avec un premier site web.
Je souhaite ajouter un second site dans un autre répertoire. J'ai donc crée un second virtual host.
Néanmoins je crois que je m'y prend mal , quand j'ai crée le second virtual host je n'ai plus d'accès au premier.
Contenu de httpd-vhosts:
<VirtualHost *:80>
ServerName localhost
DocumentRoot C:/wamp/www
<Directory "C:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost 192.168.4.50:80>
ServerName sastdl
DocumentRoot c:/wamp/www/TDL
<Directory "c:/wamp/www/TDL/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost 192.168.4.51:80>
ServerName infimed
DocumentRoot c:/wamp/www/infimed
<Directory "c:/wamp/www/infimed/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Contenu du fichier host dans le repertoire C:\Windows\System32\etc
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 localhost
::1 localhost
127.0.0.1 sastdl
::1 sastdl
127.0.0.1 infimed
::1 infimed
J'ai trouvé un tutoriel en anglais qui indique d'ajouter des lignes dans le httpd.conf de wamp
# Tells Apache to identify which site by name
NameVirtualHost *:80
# Tells Apache to serve the default WAMP Server page to "localhost"
<VirtualHost 127.0.0.1>
ServerName localhost
DocumentRoot "C:/wamp/www"
</VirtualHost>
# Tells Apache to serve Client 1's pages to "client1.localhost"
# Duplicate and modify this block to add another client
<VirtualHost 127.0.0.1>
# The name to respond to
ServerName sastdl
# Folder where the files live
DocumentRoot "C:/wamp/www/TDL"
# A few helpful settings...
<Directory "C:/wamp/www/TDL">
allow from all
order allow,deny
# Enables .htaccess files for this site
AllowOverride All granted
</Directory>
# Apache will look for these two files, in this order, if no file is specified in the URL
DirectoryIndex index.html index.php
</VirtualHost>
<VirtualHost 127.0.0.1>
# The name to respond to
ServerName infimed
# Folder where the files live
DocumentRoot "C:/wamp/www/infimed"
# A few helpful settings...
<Directory "C:/wamp/www/infimed">
allow from all
order allow,deny
# Enables .htaccess files for this site
AllowOverride All granted
</Directory>
# Apache will look for these two files, in this order, if no file is specified in the URL
DirectoryIndex index.html index.php
</VirtualHost>
Néanmoins je n'y arrive pas.
J'aurais besoin d'un peu d'aide si quelqu'un s'y connait un peu.
Je me tiens à disposition si vous avez besoin d'info supplémentaires.
D'avance merci.
Cordialement,
Max
Je voudrais créer 2 site web différents dans le même serveur Wamp
Os : Windows 7
Wamp : 5.6.7
Note :
J'ai réussi à créer un VirtualHost avec un premier site web.
Je souhaite ajouter un second site dans un autre répertoire. J'ai donc crée un second virtual host.
Néanmoins je crois que je m'y prend mal , quand j'ai crée le second virtual host je n'ai plus d'accès au premier.
Contenu de httpd-vhosts:
<VirtualHost *:80>
ServerName localhost
DocumentRoot C:/wamp/www
<Directory "C:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost 192.168.4.50:80>
ServerName sastdl
DocumentRoot c:/wamp/www/TDL
<Directory "c:/wamp/www/TDL/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost 192.168.4.51:80>
ServerName infimed
DocumentRoot c:/wamp/www/infimed
<Directory "c:/wamp/www/infimed/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Contenu du fichier host dans le repertoire C:\Windows\System32\etc
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 localhost
::1 localhost
127.0.0.1 sastdl
::1 sastdl
127.0.0.1 infimed
::1 infimed
J'ai trouvé un tutoriel en anglais qui indique d'ajouter des lignes dans le httpd.conf de wamp
# Tells Apache to identify which site by name
NameVirtualHost *:80
# Tells Apache to serve the default WAMP Server page to "localhost"
<VirtualHost 127.0.0.1>
ServerName localhost
DocumentRoot "C:/wamp/www"
</VirtualHost>
# Tells Apache to serve Client 1's pages to "client1.localhost"
# Duplicate and modify this block to add another client
<VirtualHost 127.0.0.1>
# The name to respond to
ServerName sastdl
# Folder where the files live
DocumentRoot "C:/wamp/www/TDL"
# A few helpful settings...
<Directory "C:/wamp/www/TDL">
allow from all
order allow,deny
# Enables .htaccess files for this site
AllowOverride All granted
</Directory>
# Apache will look for these two files, in this order, if no file is specified in the URL
DirectoryIndex index.html index.php
</VirtualHost>
<VirtualHost 127.0.0.1>
# The name to respond to
ServerName infimed
# Folder where the files live
DocumentRoot "C:/wamp/www/infimed"
# A few helpful settings...
<Directory "C:/wamp/www/infimed">
allow from all
order allow,deny
# Enables .htaccess files for this site
AllowOverride All granted
</Directory>
# Apache will look for these two files, in this order, if no file is specified in the URL
DirectoryIndex index.html index.php
</VirtualHost>
Néanmoins je n'y arrive pas.
J'aurais besoin d'un peu d'aide si quelqu'un s'y connait un peu.
Je me tiens à disposition si vous avez besoin d'info supplémentaires.
D'avance merci.
Cordialement,
Max