我在连接到互联网的局域网中运行Windows 2012服务器的虚拟机。 Windows服务器中还有一个wamp服务器..我在机器中配置了一个wamp虚拟主机,其中包含以下详细信息
Apache version is 2.4.18
Mysql version is 5.7.11
PHP version is 5.6.19
项目文件夹是数据中心 这是路径。
C:\wamp\www\datacentre
当我在网址中键入localhost时,我会看到wamp主页 当我在网址中键入localhost / datacentre时,我会收到数据中心主页 但是当我在数据中心输入数据中心时,它会将网络打开。
这是主机文件的路径
C:\Windows\System32\drivers\etc
这是来自Windows服务器的主机文件。
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#ne
# 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
127.0.0.1 datacentre
::1 localhost
::1 datacentre
这是httpd.conf文件的路径
C:\wamp\bin\apache\apache2.4.18\conf
取消注释虚拟主机线。
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
这是httpd-vhost文件的路径
C:\wamp\bin\apache\apache2.4.18\conf\extra
这是httpd-vhost.conf文件
#
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName datacentre
ServerAlias datacentre
DocumentRoot "c:/wamp/www/datacentre"
<Directory "c:/wamp/www/datacentre">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>