国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > 建站經驗 > 正文

apache啟動報錯:httpd: apr

2019-11-02 16:06:17
字體:
來源:轉載
供稿:網友

重啟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 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服務報錯

[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.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"

本機正確設定說明 必須為同一的

[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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 岑溪市| 凤庆县| 江油市| 双峰县| 巨鹿县| 东乡族自治县| 大同县| 岚皋县| 吕梁市| 黄龙县| 灵武市| 江达县| 常州市| 巴林右旗| 日照市| 循化| 社旗县| 德惠市| 阳春市| 竹北市| 岱山县| 铁岭县| 横峰县| 庄浪县| 嵊泗县| 松溪县| 沈丘县| 民乐县| 谢通门县| 吴旗县| 绥德县| 沂源县| 开鲁县| 元谋县| 平原县| 凤翔县| 黄大仙区| 武安市| 马公市| 炎陵县| 新宁县|