小皮面板
PhpStudy国内12年老牌公益软件,集安全,高效,功能与一体,已获得全球用户认可安装,运维也高效。
支持一键LAMP,LNMP,集群,监控,网站,FTP,数据库,JAVA等100多项服务器管理功能。
小皮面板新增网站后无法打开
小皮面板是一款很多人使用的集成环境,我也在使用,今天在新增网站的时候发现添加了域名无法解析到本地IP,还是无法访问到自己创建的网站,经过排查,问题是出现在hosts文件里面。
hosts文件修改
那么怎么解决这个问题,刚开始下载使用这个软件的时候是没有问题的,可能是hosts文件损坏的问题,那么现在我们来解决这个问题。
- 打开小皮面板
- 点击设置
- 点击配置文件
- 点击hosts(用记事本打开)
图片操作步骤:4
打开hosts后内容如下,在最下面添加:127.0.0.1 你的域名
如下图所示:
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 a.cn
127.0.0.1 wordpress.com
到这里我的问题就已经解决了,可以用完美的用域名访问到自己的网站了。
暂无评论内容