Linux之HTTP服务启动报错
实验环境:VMWARE11.0Linux系统:RedHat6.8如何解决在命令行执行命令:service httpd start后出现如下的错误提示:Starting httpd: httpd: apr_sockaddr_info_get() failed for My-Linuxhttpd: Could not reliably determine the server'
·
实验环境:VMWARE11.0
Linux系统:RedHat6.8
如何解决在命令行执行service httpd start后出现如下的错误提示:
Starting httpd: httpd: apr_sockaddr_info_get() failed for My-Linux
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName[ OK ]
命令行编辑文件:vim /etc/httpd/conf/httpd.conf
在末行模式下输入,即:/ServerName 然后回车找到下面这一行:#ServerName www.example.com:80
去掉#并改成你自己主机名,如:ServerName My-Linux:80
保存退出,命令行执行:service httpd restart,就会正常显示:
[root@My-Linux ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
PS:在编译安装http服务后,一共有两个配置文件(/etc/host和/etc/httpd/conf/httpd.conf,前者是后者的软连接文件)可供我们修改来避免此种报错,此处,建议直接修改原配置文件/etc/httpd/conf/httpd.conf。之所以出现这种错误是
因为当服务器进行反向地址解析的时候会去这个配置文件寻找主机名,如果没有匹配才会出现此种错误。
更多推荐
已为社区贡献1条内容
所有评论(0)