apache啟動報錯:httpd: apr
httpd: Could not reliably determine 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 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
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69911024/viewspace-2637436/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- apache提示錯誤:httpd-ahssl.confApachehttpd
- Linux yum安裝httpd報錯 No package httpd available ?LinuxhttpdPackageAI
- httpd啟動指令碼httpd指令碼
- Apache(httpd)詳解Apachehttpd
- HBase啟動報錯:ERROR:org.apache.hadoop.hbase.ipc.ServerNotRunningYetException:ServerisnotrunningyetErrorApacheHadoopServerException
- linux系統下Apache服務啟動時80埠報錯LinuxApache
- Linux——搭建Apache(httpd)伺服器LinuxApachehttpd伺服器
- myeclipse啟動報錯Eclipse
- Apache Tomcat 7 Configuration BIO NIO AIO APR ThreadPoolApacheTomcatAIthread
- Apache httpd和php的結合方式ApachehttpdPHP
- Apache啟動報錯No space left on device: AH00023該怎麼解決Apachedev
- 設定開機自啟動nginx和httpdNginxhttpd
- Homestead 啟動 elasticsearch 報錯Elasticsearch
- 本地nacos啟動報錯
- httpd使用systemctl啟動超時解決過程httpd
- Mac 上啟動 appium 報錯MacAPP
- 解決啟動openfeign報錯
- laravel sail 首次啟動報錯LaravelAI
- An incompatible version 1.1.33 of the APR based Apache Tomcat Native library is installed, while TomApacheTomcatWhile
- Centos7啟動Nginx報錯。CentOSNginx
- Redis 啟動報錯Address already in useRedis
- nginx 啟動報錯 unknown directive "server"NginxServer
- Xcode啟動RN報錯"`fsevents` unavailable"XCodeAI
- mongodb啟動報錯怎麼辦MongoDB
- zabbix-server啟動報錯解決Server
- sshd啟動報錯Could not load host key
- 測試類啟動報錯缺失servletWebServerApplicationContextServletWebServerAPPContext
- The APR based Apache Tomcat Native library which allows optimal performance in production ...解決方案ApacheTomcatORM
- Apache HTTPd 2.4.49 路徑穿越漏洞(CVE-2021-41773)復現Apachehttpd
- keepalived啟動報錯解決一例
- MySQL 啟動報錯 error while loading shared librariesMySqlErrorWhile
- 解決 Rust WebAssembly 啟動 Web 程式報錯RustWeb
- 使用root使用者啟動hadoop報錯Hadoop
- Flink啟動Yarn session模式的部署報錯YarnSession模式
- ElasticSearch啟動報錯 ERROR: [4] bootstrap checks failedElasticsearchErrorbootAI
- Feign整合Sentinel 開啟 feign.sentinel.enabled=true 啟動報錯
- 11.2.0.1.0 RAC啟動使用root使用者啟動crs報錯CRS-4535
- tomcat-啟動報錯Multiple Contexts have a path of "/xxxx"TomcatContext