zoukankan      html  css  js  c++  java
  • Centos安装Apache启动错误:

    Apache启动错误:httpd.exe: Could not reliably determine the server's fully qualified

           在自己电脑配置Apache开发环境问题的时候,可能会遇到apache的启动错误:httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168. x. x for ServerName,这个错误在error.log也会有输出。

    # ServerName gives the name and port that the server uses to identify itself.
    # This can often be determined automatically, but we recommend you specify
    # it explicitly to prevent problems during startup.
    #
    # If your host doesn't have a registered DNS name, enter its IP address here.
    #
    #ServerName www.xizhilang.com:8080
    # 在httpd.conf文件中添加下面这行,就能避免这个启动错误
    ServerName localhost:8080

           正如注释推荐的做法,直接将本机的名称指定为你的IP地址,而报出的那个错误就是因为未配置域名服务器或者域名服务器未能找到该域名的地址。把Apache服务的名称指定为本地IP地址,就不需要去通过DNS服务器去得到本机的IP地址,而localhost这个特殊的地址是由DNS自己本身实现的一个内置配置,所以这里用localhost也可以在本地完成地址的转换。

    我试着修改本地的hosts文件和httpd.conf文件,也能避免那个错误的出现,具体方法如下。

    首先,修改httpd.conf文件,在配置文件中添加该项配置 ServerName xizhilang.com:8080 ,即上面的那个配置。

    # ServerName gives the name and port that the server uses to identify itself.
    # This can often be determined automatically, but we recommend you specify
    # it explicitly to prevent problems during startup.
    #
    # If your host doesn't have a registered DNS name, enter its IP address here.
    #
    #ServerName www.xizhilang.com:8080
    ServerName xizhilang.com:8080

    然后,修改hosts文件,hosts文件的位置是 “系统盘符:WindowsSystem32driversetchosts” ,打开之后在最后添加两行,配置如下:

    # 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
    # 添加如下两行,将 xizhilang.com 域名解析成本地地址
     127.0.0.1  xizhilang.com
     ::1   xizhilang.com

    添加完后,打开apache之后,OK搞定,警告信息不再出现!

  • 相关阅读:
    微服务2:微服务全景架构
    SystemVerilog语言简介
    Slip打包与解包及MATLAB程序
    恶性卷积码
    通信原理之调制解调(2)QPSK
    FPGA仿真只适合开发定制IP的设计师?
    用CCS开发DSP应用程序的代码结构、加电装载及在线编程
    符号能量问题
    该如何选择?
    无线通信距离的计算
  • 原文地址:https://www.cnblogs.com/splin/p/4302590.html
Copyright © 2011-2022 走看看