标签:apache安装报错;apache; apr_sockaddr_info_get() failed ;
问题描述:通过yum install -y httpd 安装好Apache后启动报错,如下:
[root@it3246 ~]# service httpd start
正在启动 httpd:httpd: apr_sockaddr_info_get() failed for it3246
httpd: Could not reliably determine the server‘s fully qualified domain name, using 127.0.0.1 for ServerName [确定]
解决办法:
编辑hosts文件
[root@it3246 html]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 it3246
注意:根据自己的机器主机名改 it3246是我自己的机器名称 [root@it3246 html]里面@后面就是机器名
完成hosts文件编辑后,解决了一个问题。还有错误提示
[root@it3246 etc]# service httpd restart
停止 httpd: [确定]
正在启动 httpd:httpd: Could not reliably determine the server‘s fully qualified domain name, using 127.0.0.1 for ServerName
2.解决办法:
编辑httpd.conf文件,搜索到"#ServerName",添加ServerName it3246:80或者去掉原本的
#ServerName www.example.com:80 前面的注释 后面改成 it3246:80
[root@server conf]# ls
extra httpd.conf magic mime.types original
[root@server conf]# vi httpd.conf
#ServerName www.example.com:80
ServerName it3246:80
3.重启apache。
[root@it3246 etc]# service httpd status
httpd (pid 29506) 正在运行...
注意:文章中it3246是根据自己机器替换的 是自己的主机名
本文出自 “坚持不懈IT男” 博客,请务必保留此出处http://it3246.blog.51cto.com/7479386/1845244
标签:apache安装报错;apache; apr_sockaddr_info_get() failed ;
原文地址:http://it3246.blog.51cto.com/7479386/1845244