Apache启动不了httpd: apr_sockaddr_info_get() failed xgp

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

我在service httpd restart的时候提示上述信息的。虽然启动成功了,但是也是很郁闷的。

这是因为我在配置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 name, 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 MYHOST

2

在Linux下安装完Apache 2.2.6,启动HTTP服务就报错,似乎不影响服务的使用,但是也挺别扭的。

[[email protected] 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.localdomain

PS:网上有这种办法,似乎是没用的,因为我认为apache在编译安装过程中会编译ARP的,因此下述操作有点多余。

apr 和apr-util包含在Apache httpd的发行源代码中,并且在绝大多数情况下使用都不会出现问题。当然,如果apr或apr-util的1.0或1.1版本已经安装在你的系统中了, 则必须将你的apr/apr-util升级到1.2版本,或者将httpd单独分开编译。要使用发行源代码中自带的apr/apr-util源代码进行安 装,你必须手动完成:

# 编译和安装 apr 1.2

apr

./configure --prefix=/x/httpd/apr

make

make install

apr-util

./configure --prefix=/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"

本机正确设定说明 必须为同一的

[[email protected] ~]# 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 spring

[[email protected] ~]# nl /etc/sysconfig/network

1 NETWORKING=yes

2 NETWORKING_IPV6=no

3 HOSTNAME=spring

4 #GATEWAY=192.168.8.1

[[email protected] ~]# less /etc/httpd/conf/httpd.conf|grep ServerName

# ServerName gives the name and port that the server uses to identify itself.

#ServerName www.example.com:80

ServerName 127.0.0.1

时间: 2024-10-11 11:43:19

Apache启动不了httpd: apr_sockaddr_info_get() failed xgp的相关文章

Apache启动提示 httpd: apr_sockaddr_info_get() failed for xxx

httpd: apr_sockaddr_info_get() failed for xxx httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName 在/usr/local/apache2/bin/apachectl start启动Apache服务的时候出现的错误 解决办法 vi /etc/hosts127.0.0.1 localhost

如何解决linux下apache启动时httpd: apr_sockaddr_info_get() failed for 报错

今天在家里的RHLE5.5上安装apache的时候,先用user1用户./configure命令配置,然后才用root用户make && make install,结果apache起来的时候就报如下错误: httpd: apr_sockaddr_info_get() failed for bogon httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 fo

启动apache报httpd: apr_sockaddr_info_get() failed for 103.localdomain错误问题

在启动或重启apache时报以下错误,虽然没有影响,但总感觉怪怪的.httpd: apr_sockaddr_info_get() failed for 103.localdomainhttpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName 解决方法: 1)进入apache的安装目录:(视个人安装情况而不同) /etc/httpd/conf

解决apache启动错误:httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

启动apache遇到提示: [[email protected] conf]# ../bin/apachectl -thttpd: apr_sockaddr_info_get() failed for bqh-119httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerNameSyntax OK[[email protected] conf]#

未apachectl -t错误 httpd: apr_sockaddr_info_get() failed for www

[[email protected] abc]# apachectl -thttpd: apr_sockaddr_info_get() failed for wwwhttpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerNameSyntax OK 解决办法

工作经验 部署阿帕奇的时候出现 Starting httpd: httpd: apr_sockaddr_info_get() failed for server1 httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

service httpd restart Starting httpd: httpd: apr_sockaddr_info_get() failed for server1 httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName 出现这种原因是因为  httpd.config  的 配置文件出现错 应该把 ServerName  这行

解决apache启动错误

问题描述:通过yum install -y httpd 安装好Apache后启动报错,如下: [[email protected] ~]# 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 Se

apache启动问题: Could not reliably determine the server's fully qualified domain name

[[email protected]]# service httpd startStarting httpd: httpd: apr_sockaddr_info_get() failed for ruskyhttpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName *********************** 解决方法: 修改httpd.

httpd启动报错httpd: Could not reliably determine the server's fully qualified domain name

安装完apache-httpd后,启动时报错如下: [[email protected] app]# service httpd start Starting httpd: httpd: apr_sockaddr_info_get() failed for ppt httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName  [  OK