首頁  >  文章  >  後端開發  >  Apache環境,localhost 一直在加載中,但127.0.0.1可以正常訪問

Apache環境,localhost 一直在加載中,但127.0.0.1可以正常訪問

WBOY
WBOY原創
2016-12-01 00:56:453457瀏覽

Apache環境
localhost:82

問題:

  1. 瀏覽器輸入localhost:82,沒有回應(昨天還一切正常),但127.0.0.1:82可以存取

情況:
1.錯誤日誌如下
apache error.log
Apache環境,localhost 一直在加載中,但127.0.0.1可以正常訪問

  1. httpd.conf 紅筆是我所更改過的地方
    Apache環境,localhost 一直在加載中,但127.0.0.1可以正常訪問

Apache環境,localhost 一直在加載中,但127.0.0.1可以正常訪問

  1. hosts檔案如下

<code># Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost

127.0.0.1 localhost
localhost 127.0.0.1



#0.0.0.1 mssplus.mcafee.com


0.0.0.1    mssplus.mcafee.com
</code>

回覆內容:

Apache環境
localhost:82

問題:

  1. 瀏覽器輸入localhost:82,沒有回應(昨天還一切正常),但127.0.0.1:82可以存取

情況:
1.錯誤日誌如下
apache error.log
Apache環境,localhost 一直在加載中,但127.0.0.1可以正常訪問

  1. httpd.conf 紅筆是我所更改過的地方
    Apache環境,localhost 一直在加載中,但127.0.0.1可以正常訪問

Apache環境,localhost 一直在加載中,但127.0.0.1可以正常訪問

  1. hosts檔案如下

<code># Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost

127.0.0.1 localhost
localhost 127.0.0.1



#0.0.0.1 mssplus.mcafee.com


0.0.0.1    mssplus.mcafee.com
</code>

1:檢查一下連接埠是不是正常監聽狀態。是不是apache環境問題。
2:看看phpinfo()能不能執行。 看看是不是php執行環境問題。
3:看看程式碼是不是裡面有死循環或是bug。 display_error打開看看。
4:樓主,起碼貼個代碼或頁面什麼啊。 。這樣定位問題捉瞎狀態啊。囧

在httpd.conf檔案結尾加上
AcceptFilter http none
AcceptFilter https none
然後重新啟動看看

網上百度出來的結果不知道準不準

http://www.oschina.NET/questi...
http://httpd.apache.org/docs/...。

從錯誤日誌來看是ServerName綁定失敗, 所以httpd也還沒正確啟動

根據錯誤訊息google, 找到的是這個, 先嘗試下吧
http://www.t086.com/code/apac...

如果還有問題, 嘗試修改ServerName?

1.把你的hosts檔案貼出來。
2.試試訪問127.0.0.1:82

感謝大家的熱心幫助,我卸載了重新裝了一個,可以運行了

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn