【发布时间】:2016-11-27 02:09:49
【问题描述】:
在将其标记为已回答之前,请阅读整篇文章,因为是的,这些问题有很多,但没有一个答案有效。
在过去的 6 个月里,我在这里和网络上查看了大约 50 个不同的表单帖子,试图让我的 XAMPP 虚拟主机正常工作。
主机文件
127.0.0.1 localhost
127.0.0.1 vws.localhost
127.0.0.1 instancegaming.net
127.0.0.1 vws.instancegaming.net
http-vhosts 文件(7/26 更新)
# Virtual Hosts
#
# Required modules: mod_log_config
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
# NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ##ServerName or ##ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:\xampp\htdocs"
<Directory "C:\xampp\htdocs">
DirectoryIndex index.php
</Directory>
</VirtualHost>
我不知道该怎么做,我尝试将所有字段放到 localhost 然后放到 instancegaming.net,但似乎没有任何效果。我已经阅读了 Apache 日志,发现只有 SSL 错误。
当我尝试访问 [ http:// ] vws.localhost、vws.192.168.0.47、vws.instancegaming.net 时,所有这些在 chrome 中都会出现相同的错误:
ERR_NAME_NOT_RESOLVED
然后我尝试清空 chromes 主机缓存,但这也无济于事。 旁注:我重新安装了 XAMPP 4 次试图使这项工作。
【问题讨论】:
-
ERR_NAME_NOT_RESOLVED与 apache 无关,名称解析有问题。如果您从命令行尝试ping vws.instancegaming.net会发生什么? -
我得到以下信息:C:\Windows\System32>ping vws.instancegaming.net 用 32 字节数据 ping vws.instancegaming.net [127.0.0.1]:来自 127.0.0.1 的回复:字节=32 time
-
你能从命令行下载curl并尝试
curl -v vws.instancegaming.net吗? -
Curl 的结果:C:\Users\JAcOb\Desktop\stuff\curl>curl.exe -v vws.instancegaming.net * 将 URL 重建为:vws.instancegaming.net/ * 正在尝试 127.0。 0.1... * 连接到 127.0.0.1 端口 80 失败:连接被拒绝 * 无法连接到 vws.instancegaming.net 端口 80:连接被拒绝 * 关闭连接 0 curl:(7)无法连接到 vws.instancegaming.net 端口80:连接被拒绝
标签: apache google-chrome xampp virtual host