国产三级农村妇女在线,国产精品毛片a∨一区二区三区,国产乱子伦视频大全,国产精品色拉拉,国产欧美日韩一区二区三区,

首頁 > 技術(shù) > Linux

apache啟動報錯:httpd: apr_sockaddr_info_get() failed

Linux 2022-11-28 12:34:31

重啟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就可以了。

附:網(wǎng)上找到的相關(guān)文章

1、在啟動 httpd 時出現(xiàn)
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.
這個問題應(yīng)該是沒有在 /etc/httpd/conf/httpd.conf 中設(shè)定 ServerName 所以它會用主機上的名稱來取代,首先會去找 /etc/hosts 中有沒有主機的定義。
所以要解決這個問題可以設(shè)定 ServerName 或者在 /etc/hosts 中填入自己的主機名稱 MYHOST,像這樣:
>vi /etc/hosts
127.0.0.1 localhost.localdomain localhost MYHOST

2、在Linux下安裝完Apache 2.2.6,啟動HTTP服務(wù)報錯
[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

經(jīng)分析發(fā)現(xiàn)是apache的conf目錄下的配置文件httpd.conf中關(guān)于hostname設(shè)置和/etc/sysconfig/network中的HOSTNAME設(shè)置不統(tǒng)一導(dǎo)致的,修改成統(tǒng)一的主機名即可解決該問題。

注:/etc/sysconfig/network 默認(rèn)主機名是:HOSTNAME=localhost.localdomain

PS:網(wǎng)上有這種辦法,似乎是沒用的,因為我認(rèn)為apache在編譯安裝過程中會編譯ARP的,因此下述操作有點多余。

apr 和apr-util包含在Apache httpd的發(fā)行源代碼中,并且在絕大多數(shù)情況下使用都不會出現(xiàn)問題。當(dāng)然,如果apr或apr-util的1.0或1.1版本已經(jīng)安裝在你的系統(tǒng)中了, 則必須將你的apr/apr-util升級到1.2版本,或者將httpd單獨分開編譯。要使用發(fā)行源代碼中自帶的apr/apr-util源代碼進(jìn)行安 裝,你必須手動完成:

復(fù)制代碼 代碼如下:

# 編譯和安裝 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"

本機正確設(shè)定說明 必須為同一的
[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 spring

[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
# ServerName gives the name and port that the server uses to identify itself.
#ServerName www.example.com:80
ServerName 127.0.0.1

TAg

加載中~

本網(wǎng)站LOGO受版權(quán)及商標(biāo)保護(hù),版權(quán)登記號:國作登字-2022-F-10126915,未經(jīng)湖南木星科技官方許可,嚴(yán)禁使用。
Copyright ? 2012-2022 湖南木星科技有限公司(木星網(wǎng))版權(quán)所有
轉(zhuǎn)載內(nèi)容版權(quán)歸作者及來源網(wǎng)站所有,本站原創(chuàng)內(nèi)容轉(zhuǎn)載請注明來源,商業(yè)媒體及紙媒請先聯(lián)系:aishangyiwan@126.com

工信部備案號:湘ICP備19012813號-5