apache启动报错httpd: apr怎么解决


本篇内容介绍了“apache启动报错httpd: apr怎么解决”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!httpd: Could not reliably determ开发云主机域名ine the server’s fully qualified domain name, using 127.0.0.1 for ServerName
重启apache:
service httpd restart
虽然重启成功,但却给出如下的提示信息:
httpd: apr_sockaddr_info_get() failed for hoteel
httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName究其原因是因为在配置DNS的时候hostname hoteel造成的,重新hostname localhost就可以了。1、在启动 httpd 时出现
Starting httpd: httpd: apr_sockaddr_info_get() failed for MYHOST
httpd: Could not reliably determine the server’s fully qualified domain nam开发云主机域名e, using 127.0.0.1 for ServerName.
这个问题应该是没有在 /etc/httpd/conf/httpd.conf 中设定 ServerName 所以它会用主机上的名称来取代,首先会去找 /etc/hosts 中有没有主机的定义。
所以要解决这个问题可以设定 ServerName 或者在 /etc/hosts 中填入自己的主机名称 MYHOST,像这样:vi /etc/hosts
127.0.0.1 localhost.localdomain localhost MYHOST2、在Linux下安装完Apache 2.2.6,启动HTTP服务报错
[root@linux http]# ./apachectl start
httpd: apr_sockaddr_info_get() failed for linux(在BSD上是apr_sockaddr_info_get() failed for freebsdla)
httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName经分析发现是apache的conf目录下的配置文件httpd.conf中关于hostname设置和/etc/sysconfig/network中的HOSTNAME设置不统一导致的,修改成统一的主机名即可解决该问题。注:/etc/sysconfig/network 默认主机名是:HOSTNAME=localhost.localdomainPS:网上有这种办法,似乎是没用的,因为我认为apache在编译安装过程中会编译ARP的,因此下述操作有点多余。apr 和apr-util包含在Apache httpd的发行源代码中,并且在绝大多数情况下使用都不会出现问题。当然,如果apr或apr-util的1.0或1.1版本已经安装在你的系统中了, 则必须将你的apr/apr-util升级到1.2版本,或者将httpd单独分开编译。要使用发行源代码中自带的apr/apr-util源代码进行安 装,你必须手动完成:复制代码 代码如下:apr
./configure –prefix=/x/httpd/apr
make
make install
apr-util
./configure –pre开发云主机域名fix=/x/httpd/apr_util –with-apr=/x/httpd/apr
make
make install
apache
./configure –prefix=/x/httpd/apache2
–enable-so
–enable-cgi
–enable-rewrite
–enable-mods-shared=all
–with-apr=/x/httpd/apr
–with-apr-util=/x/httpd/apr_util
LDFLAGS=”-L/usr/lib64 -L/lib64″本机正确设定说明 必须为同一的
[root@spring ~]# nl /etc/hosts
1 # Do not remove the following line, or various programs
2 # that require network functionality will fail.
3 127.0.0.1 localhost.localdomain springhttp://www.iis7.com/a/lm/ftp/[root@spring ~]# nl /etc/sysconfig/network
1 NETWORKING=yes
2 NETWORKING_IPV6=no
3 HOSTNAME=spring
4 #GATEWAY=192.168.8.1[root@spring ~]# less /etc/httpd/conf/httpd.conf|grep ServerName“apache启动报错httpd: apr怎么解决”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注开发云网站,小编将为大家输出更多高质量的实用文章!

相关推荐: 域名劫持的原理及实现方式

域开发云主机域名名劫持的原理及实现方式?针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。域名作为企业形象的重要组成部分,需要仔细保护。如果域名被其他人控制,可能会对在线业务产生恶劣的影响。自己购买…

免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。

(0)
打赏 微信扫一扫 微信扫一扫
上一篇 03/24 18:04
下一篇 03/24 18:04

相关推荐