【发布时间】:2014-07-21 08:31:11
【问题描述】:
系统:Windows7 64 位 WAMP 服务器 32 位版本:Apache:2.4.9 MySQL:5.6.17 PHP:5.5.12 PHPMyAdmin:4.1.14 SqlBuddy:1.3.3 XDebug:2.2.5
我的问题是,当我导航到我的项目“local.blamo1.com”时 - 通过 WAMP“Localhost” chrome 返回:“糟糕!谷歌浏览器找不到 local.blamo1.com”
我可以使用“localhost/local.blamo1.com”访问我的项目文件夹 - 但据我了解,这是一种不好的做法,因为它会通过一个目录丢弃服务器映射。我希望能够使用指定的服务器别名访问该项目。我已经实现了以下...
httpd-vhosts.conf 位置:“C:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.config”
# 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.
<VirtualHost *:80>
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "c:/wamp/www">
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "c:/wamp/www/local.blamo1.com"
ServerName local.blamo1.com
ServerAlias local.blamo1.com
<Directory "c:/wamp/www/local.blamo1.com">
AllowOverride All
Require local
</Directory>
</VirtualHost>
主机文件 位置:“C:\Windows\System32\drivers\etc\hosts”
# 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
127.0.0.1 localhost
127.0.0.1 local.blamo1.com
#::1 localhost
#::1 local.blamo1.com
httpd.conf 位置:“C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf
我已取消注释这些行
Include conf/extra/httpd-vhosts.conf
LoadModule vhost_alias_module modules/mod_vhost_alias.so
当前诊断
Apache httpd -t 返回:“语法正常”
我认为这与我的 DNS 或端口或其他有关 - 因为我在此级别上没有足够的经验,或者 DNS 无法解析域:
在我尝试 ping 项目后:
ping local.blamo1.com "Ping 请求找不到主机 local.blamo.com。请检查名称并重试。
请帮助我了解为什么会出现此问题。我已经为此工作了一天半。如果没有足够的信息供您诊断问题,我们深表歉意。我会根据需要提供更多信息。
尽我所能。
【问题讨论】:
标签: apache dns localhost wamp virtualhost