解決apache啟動錯誤

來源:互聯網
上載者:User

標籤:apache安裝報錯;apache; apr_sockaddr_info_get() failed ;

問題描述:通過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 ServerName                                                           [確定]

解決辦法:

  1. 編輯hosts檔案

 [[email protected] html]# vi /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

127.0.0.1   it3246

注意:根據自己的機器主機名稱改 it3246是我自己的機器名稱 [[email protected] html]裡面@後面就是機器名


完成hosts檔案編輯後,解決了一個問題。還有錯誤提示


[[email protected] etc]# service httpd restart

停止 httpd:                                               [確定]

正在啟動 httpd:httpd: Could not reliably determine the server‘s fully qualified domain name, using 127.0.0.1 for ServerName

2.解決辦法:

   編輯httpd.conf檔案,搜尋到"#ServerName",添加ServerName it3246:80或者去掉原本的

#ServerName www.example.com:80  前面的注釋 後面改成 it3246:80

[[email protected] conf]# ls

extra  httpd.conf  magic  mime.types  original

[[email protected] conf]# vi httpd.conf

#ServerName www.example.com:80

ServerName it3246:80

3.重啟apache。

[[email protected] etc]# service httpd status

httpd (pid  29506) 正在運行...


注意:文章中it3246是根據自己機器替換的 是自己的主機名稱

本文出自 “堅持不懈IT男” 部落格,請務必保留此出處http://it3246.blog.51cto.com/7479386/1845244

解決apache啟動錯誤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.