首页 | 新闻 | 交流 | 问吧 | 文档 | 手册 | 下载 | 博客

收藏此问题 发表新评论

apache 本地虚拟主机的一个问题求助

<VirtualHost 127.0.0.3:80>
    DocumentRoot e:/www/zf
    ServerName 127.0.0.3:80
</VirtualHost>
以上可以用实现http://127.0.0.2

但要是把127.0.0.3:80换成abc后,
用http://abc就不能用,直接访问网上的去了。

请问怎么解决?
昵称: shgen  时间: 2009-05-03 15:29:00
访问hosts文件,路径一般是C:\Windows\System32\drivers\etc\hosts
修改成
# 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        abc


即可
昵称: microwind  时间: 2009-05-03 18:49:00
NameVirtualHost *:80

##################### ks ########################

  <VirtualHost *:80>
    ServerAdmin example@163.com
    DocumentRoot d:/haha/
    ServerName www.123.test   
</VirtualHost>

alias /haha "d:/haha/"
<Directory "d:/haha/">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
昵称: boris11201217  时间: 2009-11-16 17:54:00