因为在服务器上的网站老是出问题,所以我们想现在本地添加完文章,然后留个备份,然后完善一下传到服务器上,需要别的同事可以访问到我的电脑网站。
所以爬行的蜗牛介绍下怎么实现这个功能
找到这个文件
C:\WINDOWS\system32\drivers\etc 下面的 hosts这个文件
# 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 host
127.0.0.1 localhost
这是这个文件默认的内容
只需要在这个文件下面 加上
192.168.0.156 localhost
192.168.0.151 localhost
这样就可以访问这两个ip 上面的网站了
如果有多个站点 后面写站点的名称,如果没有站点名称或者只有一个站点的话 就写localhost就可以了
注:hosts这个文件在这个文件夹内无法修改,如果需要可以直接把这个文件拷贝到桌面上,修改完然后再覆盖下
希望能帮到大家:爬行的蜗牛:欢迎转载:http://www.pxwoniu.com/wzzt/9.html
希望能帮到大家:爬行的蜗牛:欢迎转载:http://www.pxwoniu.com/wzzt/9.html
爬行的蜗牛
爬行的蜗牛
飘过