码迷,mamicode.com
首页 > Web开发 > 详细

解决方案:httpd: Could not reliably determine the server's fully qualified domain name

时间:2015-02-11 18:40:40      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:

(1)一开始学习php的人都会安装wamp或者xamp或者phpstudy等集成环境软件。但是在现实中,公司服务器端的apache、php、mysql都是自己一个个安装的。


(2)我们说的安装apache,其实是说的安装apache http server软件,所以下载的软件一般名字是httpd-2.2.22-win32-x86之类的。

——官网下载很坑爹,各种网页打不开。还是百度了以下,在华为网盘下载的,是2.2.22版本,此时官方已到2.4.12版本。不过,一样用。

——安装过程,很简单。安装完成后,最好在系统的环境变量中增加一个路径。不然每次写httpd命令的时候,你得用完整的目录路径。

——httpd命令的几个主要选项。用-h可查看帮助。用-m查看可加载模块。用-l查看已加载模块。-t是检查httpd配置文件语法问题。如下:

>>>httpd -t
httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.1.122 for ServerName
Syntax OK

虽然语法没问题,但是有一个类似警告的东西:httpd: Could not reliably determine the server‘s fully qualified domain name, using 192.168.1.122 for ServerName。意思是没找到域名,就是域名设置有问题。


解决方案:修稿httpd.conf配置文件:找到下面这一段,把ServerName前面的#去掉。

我们在安装apache http server软件的时候虽然设置了域名,但是此处没有打开。所以,我们手动打开一下。此时在cmd中再使用httpd -t就不会出现这个警告。

# If your host doesn't have a registered DNS name, enter its IP address here.
#
<span style="color:#FF0000;">#</span>ServerName www.hello.com:80

虽然用httpd -t检查语法不需要重启apache。但是,如果服务器接受这个配置并且生效的话,需要重启apache服务器。

解决方案:httpd: Could not reliably determine the server's fully qualified domain name

标签:

原文地址:http://blog.csdn.net/weisubao/article/details/43735609

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!