Windows 7本地主机无法正常工作与XAMPP
嘿,我在Windows 7旗舰版64位上运行XAMPP,我有我的本地主机设置的一些问题,我一直在拖网互联网多年来试图得到这个固定但无济于事。Windows 7本地主机无法正常工作与XAMPP
我的设置如下:
我有Apache和XAMPP上没有问题运行MySQL,而且我已经编辑我的主机文件没有问题,确保我使用的记事等管理权限和它不保存为.txt文件等,目前看起来是这样的:
# Copyright (c) 1993-2006 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 handle within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 localhost
127.0.0.1 legendary-games.localhost
127.0.0.1 admin.legendary-games.localhost
127.0.0.1 shuuro.legendary-games.localhost
127.0.0.1 yearzero.legendary-games.localhost
127.0.0.1 chess.legendary-games.localhost
我也确信,使所有来我的虚拟主机文件进行必要的修改在Apache和所有指向正确的地址。
现在,当我在我的浏览器中输入localhost时,我得到了我打算使用的页面,但是如果我尝试其他地址中的任何一个,我会找不到一个页面。我已经尝试ping命令提示符中的地址,并且返回成功。我已经尝试了很多不同的方法来尝试使用这些工具,包括刷新DNS,重新启动DNS,我已经检查过hosts文件正在被服务正确查找,但无济于事。
任何帮助将不胜感激。
好的,这里是解决方案,也许这可以帮助你。
加入这行或者取消注释从文件httpd.conf在Apache的文件夹中找到 - > CONF
Include conf/extra/httpd-vhosts.conf
编辑的httpd-vhosts.conf在你的Apache文件夹中找到 - > CONF - >额外
httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "your-htdocs-path/legendary-games-folder"
ServerName legendary-games.localhost
</VirtualHost>
然后,重新启动apache。
我已经取消了apache conf文件中的include vhosts的注释,并且我已经将下列条目添加到了我的vhosts文件中:
澄清一下,当你键入localhost时,你会从htdocs中显示你的页面?但是,当您输入的地址不是来自本地托管的例如google.com时,您会收到未找到响应页面?你是这个意思吗? – 2012-03-27 08:24:51
是的,当我在浏览器中输入localhost时,我从htdocs中获取文件,但是当我从主机中获得一个地址文件时,例如legendary-games.localhost这给出了一个没有找到的页面。正常的互联网网址工作正常 – 2012-03-27 08:29:03
我明白了。你有没有在你的apache上启用虚拟主机模块?如果您已启用,那么您是否添加了别名legendary-games.localhost? – 2012-03-27 08:37:54