首页 > 代码库 > 测试Apache服务器及httpd: Could not reliably determine the server's fully qualified domain name解决办法

测试Apache服务器及httpd: Could not reliably determine the server's fully qualified domain name解决办法

测试Apache服务器:

重启apache:

sudo /usr/local/apache/bin/apachectl restart

 

  若出现错误:

    httpd: Could not reliably determine the server‘s fully qualified domain name......

  解决办法:

  1)进入apache的安装目录:(视个人安装情况而不同)

     [root@XXXX]# cd /usr/local/apache/conf
  2)编辑httpd.conf文件
    [root@XXXX conf]# vi httpd.conf
    将 #ServerName www.example.com:80
    改为:ServerName localhost:80(注意去掉注释哦~)
  3)再重新启动apache
    [root@XXXX]# /usr/local/apache/bin/apachectl restart

 

在浏览器中打开 http://localhost/ ,回车后若看到类似如下页面,则说明Apache服务器安装成功。