Home > Article > Backend Development > Apache environment, localhost is always loading, but 127.0.0.1 can be accessed normally
Apache environment
localhost:82
Question:
Enter localhost:82 in the browser and there is no response (everything was normal yesterday), but 127.0.0.1:82 can be accessed
Situation:
1. The error log is as follows
apache error.log
httpd.conf The red pen is the place I changed
hosts file is as follows
<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 environment
localhost:82
Question:
Enter localhost:82 in the browser and there is no response (everything was normal yesterday), but 127.0.0.1:82 can be accessed
Situation:
1. The error log is as follows
apache error.log
httpd.conf The red pen is the place I changed
hosts file is as follows
<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: Check whether the port is in normal listening state. Is it a problem with the apache environment?
2: See if phpinfo() can be executed. Check to see if it is a problem with the PHP execution environment.
3: Check if there are infinite loops or bugs in the code. Open display_error and take a look.
4: The original poster, at least post a code or page or something. . Locating the problem in this way catches the blind state.囧
Add
AcceptFilter http none
AcceptFilter https none
At the end of the httpd.conf file and then restart and see
I don’t know if the results from Baidu are accurate
http://www.oschina.NET/questi...
http://httpd.apache.org/docs/....
Judging from the error log, ServerName binding failed, so httpd has not started correctly yet
According to the error message on google, I found this, try it first
http://www.t086.com/code/apac...
If you still have problems, try changing the ServerName?
1. Post your hosts file.
2. Try accessing 127.0.0.1:82
Thank you for your enthusiastic help. I uninstalled and reinstalled it and it works now