+ -
当前位置:首页 → 问答吧 → apache 本地虚拟主机的一个问题求助

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

时间:2009-05-03

来源:互联网

<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

访问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

NameVirtualHost *:80

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

  <VirtualHost *:80>
    ServerAdmin [email protected]
    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

热门下载

更多