嘿,我在Windows 7 Ultimate 64bit上运行XAMPP,我在本地主机设置方面遇到了一些问题,而且我已经在网上搜索了很长时间,试图解决这个问题,但无济于事。
我的设置如下:
我在XAMPP上运行apache和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中对我的vhosts文件进行所有必要的更改,并且它们都指向正确的地址。
现在当我在浏览器中键入localhost时,我得到了我想要的页面,但是如果我尝试其他任何一个地址,我会找不到页面。我已经尝试ping命令提示中的地址,并返回成功。我已经尝试了很多不同的东西来尝试并使其工作包括刷新dns,重新启动dns,我已经检查了主机文件正在被服务正确查找但无济于事。
非常感谢任何帮助。
答案 0 :(得分:1)
好的,这是解决方案,也许这可以帮到你。
在您的apache文件夹中找到的文件httpd.conf中添加此行或取消注释 - > CONF
Include conf/extra/httpd-vhosts.conf
编辑apache文件夹中的httpd-vhosts.conf - > conf - >额外
的httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "your-htdocs-path/legendary-games-folder"
ServerName legendary-games.localhost
</VirtualHost>
然后,重新启动apache。