修改windows系统的映射文件
背景
换了一个环境想换一个主机名,却总是无法访问web界面
排除了网络问题,剩下就是配置问题,然后考虑到映射
解决
修改windows上的映射关系
进入c盘
C:WindowsSystem32driversetc
把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 # ::1 localhost 127.0.0.1 activate.navicat.com 192.168.10.101 qianfeng01 192.168.10.102 qianfeng02 192.168.10.103 qianfeng03
最后三行才是映射关系。
ip和主机名中间是制表符,不是空格。
反思
多去总结搭建环境的过程。
上一篇:
通过多线程提高代码的执行效率例子