新手小白咨询localhost解析不了

问题咨询 · michael · 于 5年前 发布 · 6012 次阅读

各位大神好, 在下小白一个,我在尝试安装fecshop,现在我去访问127.0.0.1的时候可以正常访问,但是访问http://localhost就访问不了。 提示 Network Error (dns_unresolved_hostname) Your requested host "localhost" could not be resolved by DNS. 我的C:\Windows\System32\drivers\etc\hosts里面配置如下: 127.0.0.1 localhost ::1 localhost 127.0.0.1 rock.fecshoptest.com # rockmongo的域名指向,rockmongo是mongodb的可视化界面,类似于mysql的phpmyadmin 127.0.0.1 my.fecshoptest.com # mysql的phpmyadmin的域名指向 127.0.0.1 appadmin.fecshoptest.com # 后台域名指向 127.0.0.1 appfront.fecshoptest.com # 前台pc端域名指向 127.0.0.1 appfront.fecshoptest.es # 前台pc端 es 语言的域名指向 127.0.0.1 apphtml5.fecshoptest.com # 前台html端的域名指向 127.0.0.1 appapi.fecshoptest.com # api端的域名指向 127.0.0.1 appserver.fecshoptest.com # server端的域名指向 127.0.0.1 img.fecshoptest.com #appimage/common 图片的域名指向 127.0.0.1 img2.fecshoptest.com #appimage/appadmin 图片的域名指向 127.0.0.1 img3.fecshoptest.com #appimage/appfront 图片的域名指向 127.0.0.1 img4.fecshoptest.com #appimage/apphtml5 图片的域名指向 127.0.0.1 img5.fecshoptest.com #appimage/appserver图片的域名指向 我的D:\Software\wamp\bin\apache\apache2.4.33\conf\extra\httpd-vhosts.conf里面配置如下:

appfront.fecshoptest.es -> xxx/appfront/web

ServerName localhost ServerAlias localhost DocumentRoot D:/Software/wamp/www Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local

appfront.fecshoptest.com -> xxx/appfront/web

appfront.fecshoptest.es -> xxx/appfront/web

ServerName appfront.fecshoptest.com ServerAlias appfront.fecshoptest.es DocumentRoot D:/Software/wamp/www/fecshop/appfront/web Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local

麻烦各位大牛,帮忙看一下哪个配置不正确,是不是还有别的地方没有配置?

本文由 michael 创作,采用 知识共享署名 3.0 中国大陆许可协议 进行许可。 可自由转载、引用,但需署名作者且注明文章出处。

共收到 10 条回复
michael#15年前 0 个赞

排版怎么显示到一行里了?是不是这样看上去不直观?图片没法添加。

Fecmall#25年前 0 个赞

先学习下maekdown排版吧

Fecmall#35年前 0 个赞

我的win host配置如下:

# Copyright (c) 1993-2009 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 handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost


127.0.0.1       localhost




112.74.35.57      rock.fecshoptest.com     # rockmongo的域名指向,rockmongo是mongodb的可视化界面,类似于mysql的phpmyadmin
112.74.35.57      my.fecshoptest.com       # mysql的phpmyadmin的域名指向
112.74.35.57      appadmin.fecshoptest.com # 后台域名指向
112.74.35.57      appfront.fecshoptest.com # 前台pc端域名指向
112.74.35.57      appfront.fecshoptest.es  # 前台pc端 es 语言的域名指向
112.74.35.57      apphtml5.fecshoptest.com # 前台html端的域名指向
112.74.35.57      apphtml5.fecshoptest.es # 前台html端的域名指向
112.74.35.57      appapi.fecshoptest.com   # api端的域名指向
112.74.35.57      appserver.fecshoptest.com # server端的域名指向
112.74.35.57      img.fecshoptest.com		#appimage/common   图片的域名指向
112.74.35.57      img2.fecshoptest.com	#appimage/appadmin 图片的域名指向
112.74.35.57      img3.fecshoptest.com	#appimage/appfront 图片的域名指向
112.74.35.57      img4.fecshoptest.com	#appimage/apphtml5 图片的域名指向
112.74.35.57      img5.fecshoptest.com	#appimage/appserver图片的域名指向
112.74.35.57      vue.fecshoptest.com

供你参考

michael#45年前 0 个赞

wamp\bin\apache\apache2.4.33\conf\extra\httpd-vhosts.conf这个文件的配置什么样啊?谢谢你的答复。

michael#55年前 0 个赞

appfront.fecshoptest.es -> xxx/appfront/web

ServerName localhost ServerAlias localhost DocumentRoot D:/Software/wamp/www Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local

appfront.fecshoptest.com -> xxx/appfront/web

appfront.fecshoptest.es -> xxx/appfront/web

ServerName appfront.fecshoptest.com ServerAlias appfront.fecshoptest.es DocumentRoot D:/Software/wamp/www/fecshop/appfront/web Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local
michael#65年前 0 个赞

我是严格按照安装文档操作的,能否请大神看看哪个地方参数不对?

7楼 已删除.
8楼 已删除.
Fecmall#95年前 0 个赞

@michael #6楼 新手去用docker部署吧,仔细看文档操作,很多人验证过了的,不能通过,自己调整姿势。

michael#105年前 0 个赞

好的,谢谢答复。应该是个小问题,直接输入127.0.0.1可以访问,但是输入http://localhost就提示DNS解析错误。

michael#115年前 0 个赞

@Fecshop能否把你的httpd-vhosts.conf文档前面部分截个图发一下?我比对一下。

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics