localhost不能访问,127.0.0.1能访问,这是为什么

来源:百度知道 编辑:UC知道 时间:2024/06/15 18:55:38
我的hosts文件
# copyright (c) 1993-1999 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

127.0.0.1 localhost

我的服务器是Apache2.2,我用localhost不能访问,但是用ip:127.0.0.1能访问,请高手解决一下

这个应该是权限问题,看了下,你的hosts文件配置是正确的。

更多PHP环境搭建问题,请访问视线网:http://www.sxecn.com

启动参数加上 -b 0.0.0.0
就是这个办法解决的,咱遇到的问题一样,不过我用的是jboss4.2而已

如果你只是在本机使用,设置你的网站目录安全里用户允许everyone修改

你去参考http://www.dw8.cn/dw8_6/157.asp这里,能解决你的问题。