在windows 目录下可以找到一个叫hosts的文件,
用记事本打开,在里面加上一行:
192.168.1.1 www.my.com就可以了,比如:# 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 host127.0.0.1 localhost
192.168.1.1 www.my.com
用记事本打开,在里面加上一行:
192.168.1.1 www.my.com就可以了,比如:# 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 host127.0.0.1 localhost
192.168.1.1 www.my.com
Apache可以建立域名,闻所未闻。
和APACHE的关系不大,除非要用虚拟主机
修改为 #ServerName www.my.com添加 <VirtualHost 192.168.1.1> ServerAdmin root@localhost ServerName www.my.comDocumentRoot c:/apache/htdocs ErrorLog c:/apache/logs/error_log TransferLog c:/apache/logs/access_log ScriptAlias /cgi-bin c:/apache/cgi-bin </VirtualHost> 改完之后,再设置一下浏览器里的internet选项中的居域网设置,将代理服务器设置为192.168.1.1 端口80
这样就可以使用http://www.my.com的形式来访问了,祝你成功!